Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- /*
- =====================================================
- DataLife Engine - by SoftNews Media Group
- -----------------------------------------------------
- http://dle-news.ru/
- -----------------------------------------------------
- Copyright (c) 2004,2011 SoftNews Media Group
- =====================================================
- Данный код защищен авторскими правами
- =====================================================
- Файл: categories.php
- -----------------------------------------------------
- Назначение: управление категориями
- =====================================================
- */
- if( !defined( 'DATALIFEENGINE' ) OR !defined( 'LOGGED_IN' ) ) {
- die( "Hacking attempt!" );
- }
- $result = "";
- $catid = intval( $_REQUEST['catid'] );
- if( ! $user_group[$member_id['user_group']]['admin_categories'] ) {
- msg( "error", $lang['index_denied'], $lang['cat_perm'] );
- }
- function get_sub_cats($id, $subcategory = false) {
- global $cat_info;
- $subfound = array ();
- if( ! $subcategory ) {
- $subcategory = array ();
- $subcategory[] = $id;
- }
- foreach ( $cat_info as $cats ) {
- if( $cats['parentid'] == $id ) {
- $subfound[] = $cats['id'];
- }
- }
- foreach ( $subfound as $parentid ) {
- $subcategory[] = $parentid;
- $subcategory = get_sub_cats( $parentid, $subcategory );
- }
- return $subcategory;
- }
- function check_gallery($array) {
- if (count($array)){
- foreach ($array as $value)
- if ($value != '') {
- return TRUE;
- break;
- }
- } else
- return FALSE;
- }
- function makeDropDown($options, $name, $selected) {
- $output = "<select size=1 name=\"$name\">\r\n";
- foreach ( $options as $value => $description ) {
- $output .= "<option value=\"$value\"";
- if( $selected == $value ) {
- $output .= " selected ";
- }
- $output .= ">$description</option>\n";
- }
- $output .= "</select>";
- return $output;
- }
- function makeDropDown2($options, $name, $selected) {
- $output = "<select name=\"studio-select\" id=\"studio-select\">\r\n";
- foreach ( $options as $value => $description ) {
- $output .= "<option selected=\"selected\" value=\"$value\"";
- if( $selected == $value ) {
- $output .= " selected ";
- }
- $output .= ">$description</option>\n";
- }
- $output .= "</select>";
- return $output;
- }
- function SelectSkin($skin) {
- global $lang;
- $templates_list = array ();
- $handle = opendir( ROOT_DIR . '/templates' );
- while ( false !== ($file = readdir( $handle )) ) {
- if( is_dir( ROOT_DIR . "/templates/$file" ) and ($file != "." and $file != ".." and $file != "smartphone") ) {
- $templates_list[] = $file;
- }
- }
- closedir( $handle );
- $skin_list = "<select name=skin_name>";
- $skin_list .= "<option value=\"\">" . $lang['cat_skin_sel'] . "</option>";
- foreach ( $templates_list as $single_template ) {
- if( $single_template == $skin ) $selected = " selected";
- else $selected = "";
- $skin_list .= "<option value=\"$single_template\"" . $selected . ">$single_template</option>";
- }
- $skin_list .= '</select>';
- return $skin_list;
- }
- // ********************************************************************************
- // Сортировка категорий
- // ********************************************************************************
- if( $_REQUEST['action'] == 'sort' ) {
- foreach ( $_POST["posi"] as $id => $posi ) {
- if( $posi != "" ) {
- $posi = intval( $posi );
- $id = intval( $id );
- $db->query( "UPDATE " . PREFIX . "_category SET posi='{$posi}' WHERE id = '{$id}'" );
- }
- }
- @unlink( ENGINE_DIR . '/cache/system/category.php' );
- header( "Location:$PHP_SELF?mod=categories" );
- }
- // ********************************************************************************
- // Добавление категории
- // ********************************************************************************
- if( $action == "add" ) {
- if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
- die( "Hacking attempt! User not found" );
- }
- include_once ENGINE_DIR . '/classes/parse.class.php';
- $parse = new ParseFilter( Array (), Array (), 1, 1 );
- $quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r" );
- if( $_POST['cat_icon'] == $lang['cat_icon'] ) {
- $_POST['cat_icon'] = "";
- }
- $cat_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_name'] ) ), ENT_QUOTES) );
- $skin_name = trim( totranslit($_POST['skin_name'], false, false) );
- $cat_icon = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_icon']) ), ENT_QUOTES) );
- if (!isset($_POST['alt_cat_name'])) $_POST['alt_cat_name'] = totranslit($cat_name);
- $year = intval($_POST['year']);
- $studio = intval($_POST['studio']);
- $type = intval($_POST['type']);
- $actors = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['actors'] ) ), ENT_QUOTES) );
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['ganre'] ) ), ENT_QUOTES) )) as $key => $value){
- $ganre[totranslit($value)] = $value; }
- $ganre = serialize($ganre);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['translator'] ) ), ENT_QUOTES) )) as $key => $value){
- $translator[totranslit($value)] = $value; }
- $translator = serialize($translator);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['edition'] ) ), ENT_QUOTES) )) as $key => $value){
- $edition[totranslit($value)] = $value; }
- $edition = serialize($edition);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['designer'] ) ), ENT_QUOTES) )) as $key => $value){
- $designer[totranslit($value)] = $value; }
- $designer = serialize($designer);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['lyrics'] ) ), ENT_QUOTES) )) as $key => $value){
- $lyrics[totranslit($value)] = $value; }
- $lyrics = serialize($lyrics);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['dubber'] ) ), ENT_QUOTES) )) as $key => $value){
- $dubber[totranslit($value)] = $value; }
- $dubber = serialize($dubber);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['country'] ) ), ENT_QUOTES) )) as $key => $value){
- $country[totranslit($value)] = $value; }
- $country = serialize($country);
- $director = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['director'] ) ), ENT_QUOTES) );
- $manga = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['manga'] ) ), ENT_QUOTES) );
- $original = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['original'] ) ), ENT_QUOTES) );
- $prod = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['prod'] ) ), ENT_QUOTES) );
- $alt_cat_name = totranslit( stripslashes( $_POST['alt_cat_name'] ), true, false );
- if ( ! $alt_cat_name ) $alt_cat_name = totranslit($cat_name);
- if( ! $cat_name ) {
- msg( "error", $lang['cat_error'], $lang['cat_ername'], "javascript:history.go(-1)" );
- }
- if( ! $alt_cat_name ) {
- msg( "error", $lang['cat_error'], $lang['cat_erurl'], "javascript:history.go(-1)" );
- }
- if ( in_array($_POST['news_sort'], array("date", "rating", "news_read", "title")) ) {
- $news_sort = $db->safesql( $_POST['news_sort'] );
- } else $news_sort = "";
- if ( in_array($_POST['news_msort'], array("ASC", "DESC")) ) {
- $news_msort = $db->safesql( $_POST['news_msort'] );
- } else $news_msort = "";
- if ( $_POST['news_number'] > 0)
- $news_number = intval( $_POST['news_number'] );
- else $news_number = 0;
- if ( $_POST['category'] > 0)
- $category = intval( $_POST['category'] );
- else $category = 0;
- /*Работа с картинкой блеать*/
- if (check_gallery($_FILES['gallery']['tmp_name'])) { //Добавлены ли в форму новые фото или вообще добавлены ли они
- /*Небольшой конфиг*/
- $config_path_image_upload = ROOT_DIR . "/uploads/stills/"; //Место загрузки картинок
- $screenshot_width = 300; // ширина логотипа
- $screenshot_watermark = 0; // наложение водяного знака
- foreach ($_FILES['gallery']['tmp_name'] as $key => $tmp_name) {
- $file_prefix = time () . "_";
- if (! is_dir ( $config_path_image_upload )) {
- @mkdir ( $config_path_image_upload, 0777 );
- @chmod ( $config_path_image_upload, 0777 );
- }
- if (! is_dir ( $config_path_image_upload ))
- $error .= "- Directory Error. " . $config_path_image_upload . " cannot created. <br />";
- $allowed_extensions = array ("gif", "jpg", "png", "jpe", "jpeg" );
- if (! is_dir ( $config_path_image_upload . 'mini/' )) {
- @mkdir ( $config_path_image_upload . 'mini/', 0777 );
- @chmod ( $config_path_image_upload . 'mini/', 0777 );
- }
- if (! is_dir ( $config_path_image_upload . 'mini/' ))
- $error .= "- Directory Error. " . $config_path_image_upload . "mini/ cannot created. <br />";
- $image = $_FILES['gallery']['tmp_name'][$key];
- $image_name = $_FILES['gallery']['name'][$key];
- $image_size = $_FILES['gallery']['size'][$key];
- $img_name_arr = explode ( ".", $image_name );
- $type = totranslit ( end ( $img_name_arr ) );
- if ($image_name != "")
- {
- $curr_key = key ( $img_name_arr );
- unset ( $img_name_arr [$curr_key] );
- $image_name = totranslit ( implode ( ".", $img_name_arr ) ) . "." . $type;
- }
- $i++;
- if ($image_name == "")
- $error .= "- Не удалось определить изображение. Фото № {$i}";
- elseif (! (in_array ( $type, $allowed_extensions ) or in_array ( strtolower ( $type ), $allowed_extensions )))
- $error .= "- Данный тип изображения не поддерживается. Фото № {$i}";
- elseif ($image_size > ($config['max_up_size'] * 1024) and ! $config ['max_up_side'])
- $error .= "- Размер загружаемого изображения превышает максимально допустимые размеры. Фото № {$i}";
- else {
- @move_uploaded_file ( $image, $config_path_image_upload . $file_prefix . $image_name ) or $img_result = "<div><font color=red>$lang[images_uperr_3]</font></div>";
- if (@file_exists ( $config_path_image_upload . $file_prefix . $image_name ))
- {
- @chmod ( $config_path_image_upload . $file_prefix . $image_name, 0666 );
- include_once ENGINE_DIR . '/classes/thumb.class.php';
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- if ($thumb->size_auto ( $screenshot_width, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- /*if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );*/
- $thumb->save ( $config_path_image_upload . "mini/" . $file_prefix . $image_name );
- }
- /*$thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- if ($thumb->size_auto ( $screenshot_width2, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . "main/" . $file_prefix . $image_name );
- }*/
- if (@file_exists ( $config_path_image_upload . "mini/" . $file_prefix . $image_name )) {
- $img_result_th .= "<div><font color=blue>$image_name -> $lang[images_thok]</font></div>";
- $thumb_img = $image_name;
- }
- @chmod ( $config_path_image_upload . "mini/" . $file_prefix . $image_name, 0666 );
- $config ['max_up_side'] = intval ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1" or $config ['max_up_side'])
- {
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($config ['max_up_side'])
- $thumb->size_auto ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . $file_prefix . $image_name );
- }
- }
- }
- /*Собираем массив новых фоток (Свежих)*/
- if ($image_name)
- $gallery_array[$key] = $file_prefix . $image_name;
- }
- //Формирование массива загруженных картинок
- if ($error)
- msg( "error", $lang['cat_error'], $error, "javascript:history.go(-1)" );
- else
- $gallery = serialize($gallery_array);
- }
- /*Работа с картинкой*/
- $screenshot_width = 250; // ширина логотипа
- $screenshot_width2 = 80; // ширина логотипа
- $screenshot_watermark = 1; // наложение водяного знака
- if (intval($_POST['down_poster']) == 1 AND intval($_POST['id_rating']) > 0) {
- $image_url = "http://st.kinopoisk.ru/images/film_big/".intval($_POST['id_rating']).".jpg";
- $new_image_url = time () . "_" . strtolower($alt_cat_name) . ".jpg";
- $new_poster_path = ROOT_DIR . "/uploads/posters/";
- if (copy($image_url, $new_poster_path . $new_image_url)) {
- @chmod ( $new_poster_path . $new_image_url, 0666 );
- include_once ENGINE_DIR . '/classes/thumb.class.php';
- $thumb = new thumbnail ( $new_poster_path . $new_image_url );
- if ($thumb->size_auto ( $screenshot_width, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $new_poster_path . "mini/" . $new_image_url );
- }
- $thumb = new thumbnail ( $new_poster_path . $new_image_url );
- if ($thumb->size_auto ( $screenshot_width2, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $new_poster_path . "main/" . $new_image_url );
- }
- if ($screenshot_watermark == "1" or $config ['max_up_side'])
- {
- $thumb = new thumbnail ( $new_poster_path . $new_image_url );
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($config ['max_up_side'])
- $thumb->size_auto ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $new_poster_path . $new_image_url );
- }
- $thumb_img = $new_image_url;
- } else
- msg( "error", $lang['cat_error'], "Извеняй браток, КП не одобряет когда я пытаюсь пиздануть постер. Загрузи ка ты его ручками", "javascript:history.go(-1)" );
- }
- $error = "";
- if (isset($_FILES['cat_icon']['name']))
- {
- $file_prefix = time () . "_";
- $config_path_image_upload = ROOT_DIR . "/uploads/posters/";
- if (! is_dir ( $config_path_image_upload )) {
- @mkdir ( $config_path_image_upload, 0777 );
- @chmod ( $config_path_image_upload, 0777 );
- }
- if (! is_dir ( $config_path_image_upload ))
- $error .= "- Directory Error. " . $config_path_image_upload . " cannot created. <br />";
- $allowed_extensions = array ("gif", "jpg", "png", "jpe", "jpeg" );
- if (! is_dir ( $config_path_image_upload . 'mini/' )) {
- @mkdir ( $config_path_image_upload . 'mini/', 0777 );
- @chmod ( $config_path_image_upload . 'mini/', 0777 );
- }
- if (! is_dir ( $config_path_image_upload . 'mini/' ))
- $error .= "- Directory Error. " . $config_path_image_upload . "mini/ cannot created. <br />";
- $current_image = "cat_icon";
- $image = $_FILES [$current_image] ['tmp_name'];
- $image_name = $_FILES [$current_image] ['name'];
- $image_size = $_FILES [$current_image] ['size'];
- $img_name_arr = explode ( ".", $image_name );
- $type = totranslit ( end ( $img_name_arr ) );
- if ($image_name != "")
- {
- $curr_key = key ( $img_name_arr );
- unset ( $img_name_arr [$curr_key] );
- $image_name = totranslit ( implode ( ".", $img_name_arr ) ) . "." . $type;
- }
- if ($image_name == "")
- $error .= "- Не удалось определить изображение.";
- elseif (! (in_array ( $type, $allowed_extensions ) or in_array ( strtolower ( $type ), $allowed_extensions )))
- $error .= "- Данный тип изображения не поддерживается.";
- elseif ($image_size > ($config['max_up_size'] * 1024) and ! $config ['max_up_side'])
- $error .= "- Размер загружаемого изображения превышает максимально допустимые размеры.";
- else {
- @move_uploaded_file ( $image, $config_path_image_upload . $file_prefix . $image_name ) or $img_result = "<div><font color=red>$lang[images_uperr_3]</font></div>";
- if (@file_exists ( $config_path_image_upload . $file_prefix . $image_name ))
- {
- @chmod ( $config_path_image_upload . $file_prefix . $image_name, 0666 );
- include_once ENGINE_DIR . '/classes/thumb.class.php';
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- if ($thumb->size_auto ( $screenshot_width, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . "mini/" . $file_prefix . $image_name );
- }
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- if ($thumb->size_auto ( $screenshot_width2, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . "main/" . $file_prefix . $image_name );
- }
- if (@file_exists ( $config_path_image_upload . "mini/" . $file_prefix . $image_name )) {
- $img_result_th .= "<div><font color=blue>$image_name -> $lang[images_thok]</font></div>";
- $thumb_img = $image_name;
- }
- @chmod ( $config_path_image_upload . "mini/" . $file_prefix . $image_name, 0666 );
- $config ['max_up_side'] = intval ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1" or $config ['max_up_side'])
- {
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($config ['max_up_side'])
- $thumb->size_auto ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . $file_prefix . $image_name );
- }
- }
- }
- $file_name_thumb = $image_name;
- if ($file_name_thumb)
- $file_name_thumb = $file_prefix . $file_name_thumb;
- else
- $file_name_thumb = "";
- if ($thumb_img)
- $thumb_img = $file_prefix . $thumb_img;
- else
- $thumb_img = "";
- }
- ##=============================Сохранение данных в базу данных===================================##
- if ($error)
- msg( "error", $lang['cat_error'], $error, "javascript:history.go(-1)" );
- /*Работа с картинкой*/
- $short_tpl = totranslit( stripslashes( trim( $_POST['short_tpl'] ) ) );
- $full_tpl = totranslit( stripslashes( trim( $_POST['full_tpl'] ) ) );
- $meta_title = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['meta_title'] ) ) ) );
- $description = $db->safesql( strip_tags( stripslashes( $_POST['descr'] ) ) );
- $lirika = $db->safesql( strip_tags( stripslashes( $_POST['lir'] ) ) );
- $subs = $db->safesql( strip_tags( stripslashes( $_POST['titry'] ) ) );
- $board = $db->safesql( strip_tags( stripslashes( $_POST['forum'] ) ) );
- $keywords = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['keywords'] ) ) ) );
- $vk_poll = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['vk_poll'] ) ) ) );
- $date_start = $db->safesql( strip_tags( stripslashes( $_POST['date_start'] ) ) );
- $real_name = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['real_name'] ) ) ) );
- $descr_content = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['short_story'], false ) ) );
- $lir_content = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['lir'], false ) ) );
- $titry_content = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['titry'], false ) ) );
- $forum_content = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['forum'], false ) ) );
- //$video = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['treiler'], false ) ) );
- $video = $db->safesql( $parse->BB_Parse($_POST['treiler']) );
- $row = $db->super_query( "SELECT alt_name FROM " . PREFIX . "_category WHERE alt_name ='{$alt_cat_name}'" );
- if( $row['alt_name'] ) {
- msg( "error", $lang['cat_error'], $lang['cat_eradd'], "?mod=categories" );
- }
- if ($thumb_img)
- $cat_icon = $config['http_home_url'] . "uploads/posters/mini/" . $thumb_img;
- else
- $cat_icon = $config['http_home_url'] . "uploads/posters/" . $thumb_img;
- $db->query( "INSERT INTO " . PREFIX . "_category (parentid, name, real_name, year, type, studio, country, actors, janre, translate, edit, design, lyric, dub, director, manga, original, prod, alt_name, icon, skin, descr, lir, titry, forum, keywords, news_sort, news_msort, news_number, short_tpl, full_tpl, metatitle, id_rating, descr_content, gallery, video, vk_poll, date_start) values ('$category', '$cat_name', '$real_name', '$year', '$type', '$studio', '$country', '$actors', '$ganre', '$translator', '$edition', '$designer', '$lyrics', '$dubber', '$director', '$manga', '$original', '$prod', '$alt_cat_name', '$cat_icon', '$skin_name', '$description', '$lir', '$titry', '$forum', '$keywords', '$news_sort', '$news_msort', '$news_number', '$short_tpl', '$full_tpl', '$meta_title', '".intval($_POST['id_rating'])."', '$descr_content', '$gallery', '$video', '$vk_poll', '$date_start')" );
- $s_id = $db->insert_id();
- $p_id = $db->super_query("SELECT parentid FROM " . PREFIX . "_category WHERE id = '$s_id'");
- @unlink( ENGINE_DIR . '/cache/system/category.php' );
- clear_cache();
- if ($p_id['parentid'] == 0)
- msg( "info", $lang['cat_addok'], "Аниме {$cat_name}, успешно добавлен. Но для дальнейшей работы необходимо <a href=\"/shite.php?mod=categories&action=season_list&serial_id={$s_id}\"><b>добавить</b></a> сезоны", "?mod=categories" );
- else
- msg( "info", $lang['cat_addok'], "Сезон успешно добавлен", "?mod=categories&action=season_list&serial_id=" . $p_id['parentid']);
- }
- // ********************************************************************************
- // Удаление категории
- // ********************************************************************************
- elseif( $action == "remove" ) {
- if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
- die( "Hacking attempt! User not found" );
- }
- function DeleteSubcategories($parentid) {
- global $db;
- $subcategories = $db->query( "SELECT id FROM " . PREFIX . "_category WHERE parentid = '$parentid'" );
- while ( $subcategory = $db->get_row( $subcategories ) ) {
- DeleteSubcategories( $subcategory['id'] );
- $db->query( "DELETE FROM " . PREFIX . "_category WHERE id = '" . $subcategory['id'] . "'" );
- }
- }
- if( ! $catid ) {
- msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );
- }
- $row = $db->super_query( "SELECT count(*) as count FROM " . PREFIX . "_post WHERE category regexp '[[:<:]]($catid)[[:>:]]'" );
- if( $row['count'] ) {
- if( is_array( $_REQUEST['new_category'] ) ) {
- if( ! in_array( $catid, $new_category ) ) {
- $category_list = $db->safesql( htmlspecialchars( strip_tags( stripslashes( implode( ',', $_REQUEST['new_category']))), ENT_QUOTES ) );
- $db->query( "UPDATE " . PREFIX . "_post set category='$category_list' WHERE category regexp '[[:<:]]($catid)[[:>:]]'" );
- $db->query( "DELETE FROM " . PREFIX . "_category WHERE id='$catid'" );
- DeleteSubcategories( $catid );
- @unlink( ENGINE_DIR . '/cache/system/category.php' );
- clear_cache();
- msg( "info", $lang['cat_delok'], $lang['cat_delok_1'], "?mod=categories" );
- }
- }
- msg( "info", $lang['all_info'], "<form action=\"\" method=\"post\">{$lang['comm_move']} <select name=\"new_category[]\" class=\"cat_select\" align=\"absmiddle\" multiple>" . CategoryNewsSelection( 0, 0 ) . "</select> <input class=\"edit\" type=\"submit\" value=\"{$lang['b_start']}\"></form>", "$PHP_SELF?mod=categories" );
- } else {
- $db->query( "DELETE FROM " . PREFIX . "_category WHERE id='$catid'" );
- DeleteSubcategories( $catid );
- @unlink( ENGINE_DIR . '/cache/system/category.php' );
- if ($cat_info[$catid]['parentid'] == 0)
- msg( "info", $lang['cat_delok'], "Сериал был успешно удалён", "?mod=categories" );
- else
- msg( "info", $lang['cat_delok'], "Сезон был успешно удалён", "?mod=categories&action=season_list&serial_id=" . $cat_info[$catid]['parentid'] );
- clear_cache();
- msg( "info", $lang['cat_delok'], $lang['cat_delok_1'], "?mod=categories" );
- }
- }
- // ********************************************************************************
- // Редактирование категории
- // ********************************************************************************
- elseif( $action == "edit" ) {
- echoheader( "options", $lang['cat_head'] );
- $catid = intval( $_GET['catid'] );
- if( ! $catid ) {
- msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );
- }
- $row = $db->super_query( "SELECT * FROM " . PREFIX . "_category WHERE id = '$catid'" );
- if( ! $row['id'] ) msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );
- include_once ENGINE_DIR . '/classes/parse.class.php';
- $parse = new ParseFilter( Array (), Array (), 1, 1 );
- $categorylist = cats_main( 0, $row['id'] );
- $skinlist = SelectSkin( $row['skin'] );
- foreach (unserialize($row['janre']) as $key => $value ) {
- $ganre[] = $value;
- }
- $row['janre'] = implode(", ", $ganre);
- foreach (unserialize($row['translate']) as $key => $value ) {
- $translator[] = $value;
- }
- $row['translate'] = implode(", ", $translator);
- foreach (unserialize($row['edit']) as $key => $value ) {
- $edition[] = $value;
- }
- $row['edit'] = implode(", ", $edition);
- foreach (unserialize($row['design']) as $key => $value ) {
- $designer[] = $value;
- }
- $row['design'] = implode(", ", $designer);
- foreach (unserialize($row['lyric']) as $key => $value ) {
- $lyrics[] = $value;
- }
- $row['lyric'] = implode(", ", $lyrics);
- foreach (unserialize($row['dub']) as $key => $value ) {
- $dubber[] = $value;
- }
- $row['dub'] = implode(", ", $dubber);
- foreach (unserialize($row['country']) as $key => $value ) {
- $country[] = $value;
- }
- $row['country'] = implode(", ", $country);
- $row['name'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['name'] ) );
- $row['metatitle'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['metatitle'] ) );
- $row['descr'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['descr'] ) );
- $row['lir'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['lir'] ) );
- $row['titry'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['titry'] ) );
- $row['forum'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['forum'] ) );
- $row['keywords'] = stripslashes( preg_replace( array ("'\"'", "'\''" ), array (""", "'" ), $row['keywords'] ) );
- $row['news_sort'] = makeDropDown( array ("" => $lang['sys_global'], "date" => $lang['opt_sys_sdate'], "rating" => $lang['opt_sys_srate'], "news_read" => $lang['opt_sys_sview'], "title" => $lang['opt_sys_salph'] ), "news_sort", $row['news_sort'] );
- $row['news_msort'] = makeDropDown( array ("" => $lang['sys_global'], "DESC" => $lang['opt_sys_mminus'], "ASC" => $lang['opt_sys_mplus'] ), "news_msort", $row['news_msort'] );
- for ($i = date("Y"); $i >= 1917; $i--)
- $years[$i] = $i;
- $year = MakeDropDown($years, 'year', $row['year']);
- $type = MakeDropDown(array("TV"=>"TV","OVA"=>"OVA","ONA"=>"ONA","Special"=>"Спешл","Movie"=>"Полнометражка","Hentai"=>"Хентай"), 'type', $row['type']);
- $studio = MakeDropDown2(array("8bit"=>"8bit","A-1+Pictures+Inc"=>"A1 Pictures Inc.","Actas+Inc"=>"Actas Inc.","AIC"=>"AIC","AIC+A.S.T.A"=>"AIC A.S.T.A.","AIC+PLUS"=>"AIC PLUS","AIC+Spirits"=>"AIC Spirits","Aniplex"=>"Aniplex","ARMS"=>"ARMS","Artland"=>"Artland","Ashi+Productions"=>"Ashi Productions","asread"=>"asread","Bee+Train"=>"Bee Train","BONES"=>"BONES","Brains+Base"=>"Brains Base","Chaos+Project"=>"Chaos Project","Charaction"=>"Charaction","Cinema+Citrus"=>"Cinema Citrus","CoMix+Wave+Inc"=>"CoMix Wave Inc.","David+Production"=>"David Production","Dogakobo"=>"Dogakobo","Easyfilm"=>"Easyfilm","FEEL"=>"FEEL","Gainax"=>"Gainax","GoHands"=>"GoHands","Gonzo"=>"Gonzo","Group+TAC"=>"Group TAC","Hal+Film+Maker"=>"Hal Film Maker","J.C.+Staff"=>"J.C. Staff","Jinnis+Animation+Studios"=>"Jinnis Animation Studios","Kitty"=>"Kitty","Kyoto+Animation"=>"Kyoto Animation","LMD"=>"LMD","MAD+House"=>"MAD House","Manglobe+Inc"=>"Manglobe Inc.","MAPPA"=>"MAPPA","Milky"=>"Milky","Nippon+Animation"=>"Nippon Animation","Nippon+TV"=>"Nippon TV","Nomad"=>"Nomad","Ordet"=>"Ordet","Oriental+Light+and+Magic"=>"Oriental Light and Magic","P.A.+Works"=>"P.A. Works","Production+I.G"=>"Production I.G","Satelight"=>"Satelight","Seven"=>"Seven","Seven+Arcs"=>"Seven Arcs","Shaft"=>"Shaft","Shochiku"=>"Shochiku","Silver+Link"=>"Silver Link","Studio+4C"=>"Studio 4°C","Studio+Barcelona"=>"Studio Barcelona","Studio+Chizu"=>"Studio Chizu","Studio+Comet"=>"Studio Comet","Studio+DEEN"=>"Studio DEEN","Studio+Gallop"=>"Studio Gallop","Studio+Ghibli"=>"Studio Ghibli","Studio+Pierrot"=>"Studio Pierrot","Sunrise"=>"Sunrise","Synergy+Japan"=>"Synergy Japan","Tatsunoko"=>"Tatsunoko","Telecom+Animation+Film"=>"Telecom Animation Film","The+Answer+Studio"=>"The Answer Studio","TMS"=>"TMS","Toei+Animation"=>"Toei Animation","Triangle+Staff"=>"Triangle Staff","Trigger"=>"Trigger","UFO+Table"=>"UFO Table","Visual+Science+Laboratory"=>"Visual Science Laboratory","WAO+World"=>"WAO! World","White+Fox"=>"White Fox","Xebec"=>"Xebec","ZEXCS"=>"ZEXCS"), 'studio', $row['studio']);
- $season_num = sub_cats_numm(intval($_REQUEST['serial_id'])) + 1;
- $descr_content = $parse->decodeBBCodes( $row['descr_content'], false );
- $lir_content = $parse->decodeBBCodes( $row['lir_content'], false );
- $titry_content = $parse->decodeBBCodes( $row['titry_content'], false );
- $forum_content = $parse->decodeBBCodes( $row['forum_content'], false );
- $treiler_video = $parse->decodeBBCodes( $row['video'], false );
- $i = 0;
- if ($row['gallery'] AND count(unserialize($row['gallery'])) > 0) { unset($i);
- foreach (unserialize($row['gallery']) as $key => $image) { $i++;
- if ($i == 1)
- $gallery = "<div class=\"unterline\"></div>";
- $gallery .= <<<HTML
- <table cellpadding="0" cellspacing="5" border="0" style="width:100%;" id="file_block_{$key}">
- <tr align="left">
- <td width="24%" valign="middle">Фотo {$i}</td>
- <td>
- <input name="gallery[{$key}]" type="file"/> <a href="#" class="hintanchor" onmouseover="showhint('<img src=\'/uploads/stills/mini/{$image}\'>', this, event, '250px')">[?]</a>
- <input name="delete[{$key}]" type="checkbox" value="1"> удалить
- </td>
- </tr>
- </table>
- HTML;
- }
- }
- if ($row['icon']) {
- $poster = <<<HTML
- <tr>
- <td height="29" style="padding-left:5px;">Удалить картинку:</td>
- <td><select name="del_scr"><option value="1">Да</option><option value="0" selected>Нет</option></select></td>
- </tr>
- <tr>
- <td height="29" style="padding-left:5px;">Загруженная картинка:</td>
- <td><a href="{$row['icon']}" target="_blank">Смотреть</a></td>
- </tr>
- <tr>
- <td style="padding:4px;">Постер</td>
- <td><input style="width:400px;" type="file" name="cat_icon" /></td>
- </tr>
- HTML;
- } else {
- $poster = <<<HTML
- <tr>
- <td style="padding:4px;">Постер</td>
- <td><input class="edit bk" type="file" name="cat_icon" /></td>
- </tr>
- HTML;
- }
- $i = intval($i);
- echo <<<HTML
- <script type="text/javascript">
- var foto = {$i};
- var total = foto;
- $(document).ready(function() {
- $("#add_file_jq").click(function () {
- total++;
- foto++;
- $("#add_file_block").before(
- '<table cellpadding="0" cellspacing="5" border="0" style="width:100%;" id="file_block_'+total+'">'
- +'<tr align="left">'
- +'<td width="24%" valign="middle">Фотo '+foto+'</td>'
- +'<td><input name="gallery['+total+']" type="file" /></td>'
- +'</tr>'
- +'</table>');
- return false;
- });
- $("#del_file_jq").click(function () {
- if (total > $i) {
- $("#file_block_"+total).remove();
- total = total - 1;
- foto = foto - 1;
- return false;
- }
- });
- //$("#add_file_jq").click();
- });
- </script>
- <script type="text/javascript">
- function template(temp) {
- $.post("http://shiranaitenshi.tk/engine/modules/news_template.php",
- {edit:temp},
- function(data){
- var obj = $.parseJSON(data);
- $('#lir').val(obj.lir);
- $('#forum').val(obj.forum);
- });
- }
- </script>
- <form ENCTYPE="multipart/form-data" method="post" action="">
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
- <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
- <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
- </tr>
- <tr>
- <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <table width="100%">
- <tr>
- <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_edit']}</div></td>
- </tr>
- </table>
- <div class="unterline"></div>
- <table width="100%">
- {$poster}
- <tr>
- <td width="260" style="padding:4px;">{$lang['cat_name']}</td>
- <td><input style="width:500px;" value="{$row['name']}" type="text" name="cat_name"></td>
- </tr>
- <tr>
- <td width="160" style="padding:4px;">Оригинальное название</td>
- <td><input style="width:300px;" type="text" name="real_name" value="{$row['real_name']}"> или на английском языке</td>
- </tr>
- <td style="padding:4px;">{$lang['cat_url']}</td>
- <td><input style="width:500px;" value="{$row['alt_name']}" type="text" name="alt_cat_name"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Страна</td>
- <td><input type="text" name="country" style="width:500px;" value="{$row['country']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Год</td>
- <td>{$year}</td>
- </tr>
- <tr>
- <td style="padding:4px;">Жанр</td>
- <td><input type="text" name="ganre" style="width:500px;" value="{$row['janre']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Тип</td>
- <td>{$type}</td>
- </tr>
- <tr>
- <td style="padding:4px;">Продолжительность<br>В виде: 25 мин., (13 эп.)</td>
- <td><input type="text" name="prod" style="width:500px;" value="{$row['prod']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Режиссёр</td>
- <td><input type="text" name="director" style="width:500px;" value="{$row['director']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Снято по манге</td>
- <td><input type="text" name="manga" style="width:500px;" value="{$row['manga']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Автор оригинала</td>
- <td><input type="text" name="original" style="width:500px;" value="{$row['original']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Студия</td>
- <td>{$studio}<span id="studio"><img src="http://st.sakuranight.net/8bit.jpg"></span></td>
- </tr>
- <script type="text/javascript">
- //<![CDATA[
- $(function() {
- $("#studio-select").change(function() {
- var graphicFileName = $("#studio-select option:selected").attr("value");
- var newCode = '<img src="http://st.sakuranight.net/' + graphicFileName + '.jpg">';
- $("#studio").html(newCode);
- });
- });
- //]]>
- </script>
- <tr>
- <td style="padding:4px;">Переводчик</td>
- <td><input type="text" name="translator" style="width:500px;" value="{$row['translate']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Редактор</td>
- <td><input type="text" name="edition" style="width:500px;" value="{$row['edit']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Оформление</td>
- <td><input type="text" name="designer" style="width:500px;" value="{$row['design']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Лирика</td>
- <td><input type="text" name="lyrics" style="width:500px;" value="{$row['lyric']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Озвучиватели</td>
- <td><input type="text" name="dubber" style="width:500px;" value="{$row['dub']}"></td>
- </tr>
- </table>
- <div style="padding-left:20px;">
- {$gallery}
- <span id="add_file_block"></span>
- </div>
- <table width="100%">
- HTML;
- if( $config['allow_admin_wysiwyg'] == "yes" ) {
- include (ENGINE_DIR . '/editor/shortnews.php');
- } else {
- $bb_editor = true;
- include (ENGINE_DIR . '/inc/include/inserttag.php');
- echo <<<HTML
- <tr>
- <td width="260" style="padding:4px;">Описание сериала</td>
- <td>{$bb_code}
- <textarea rows="16" style="width:97%; padding:5px;" onclick="setFieldName(this.name)" name="short_story" id="descr" class="bk">{$descr_content}</textarea>
- </td></tr>
- <tr>
- <td width="260" style="padding:4px;">Лирика (Если лирики нет, пишем: )<br><span style="text-align:left;font-size:8px;" ><b>На данный момент лирики нет, её либо не перевели, либо ещё не добавили. Вы можете обратится в стол заказов и заказать лирику к этому релизу или попросить добавить ваш вариант перевода. Спасибо!</b></span></td>
- <td>{$bb_code}
- <textarea rows="16" style="width:97%; padding:5px;" padding:5px;" onclick="setFieldName(this.name)" name="lir" id="lir" class="f_textarea">{$lir_content}</textarea>
- </td></tr>
- <tr>
- <td width="260" style="padding:4px;">Ссылка на субтитры</td>
- <td><input style="width:500px;" onclick="setFieldName(this.name)" name="titry" id="titry" value="{$titry_content}">
- </td></tr>
- <tr>
- <td width="260" style="padding:4px;">Тема на форуме <a href="#" class="hintanchor" onmouseover="showhint('Если нет темы на форуме, то вводим: http://bit.ly/stforum (ссылка ниже)', this, event, '320px')">[?]</a><br><span style="text-align:left;font-size:8px;" ><b>http://bit.ly/stforum</b></span></td>
- <td><input style="width:500px;" onclick="setFieldName(this.name)" name="forum" id="forum" value="{$forum_content}">
- </td></tr>
- HTML;
- }
- echo <<<HTML
- <tr>
- <td style="padding:4px;">Трейлер</td>
- <td><input name="treiler" style="width:500px;" onclick="setFieldName(this.name)" name="short_story2" id="short_story2" value="{$treiler_video}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Идентификатор опроса</td>
- <td><input style="width:500px;" value="{$row['vk_poll']}" type="text" name="vk_poll"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Мета-титл</td>
- <td><input type="text" name="meta_title" style="width:500px;" value="{$row['metatitle']}"></td>
- </tr>
- <tr>
- <tr>
- <td style="padding:4px;">Дескрипшн</td>
- <td><textarea name="descr" style="width:500px;height:50px;" onclick="setFieldName(this.name)" name="short_story2" id="short_story2" class="bk">{$row['descr']}</textarea></td>
- </tr>
- </tr>
- <tr>
- <td style="padding:4px;">{$lang['meta_keys']}</td>
- <td><textarea name="keywords" style="width:500px;height:50px;">{$row['keywords']}</textarea></td>
- </tr>
- <tr>
- <td colspan="2"><div class="hr_line"></div></td>
- </tr>
- <tr>
- <td style="padding:4px;"> </td>
- <td><input type="submit" class="buttons" value=" {$lang['vote_edit']} ">
- <input type=hidden name=action value=doedit>
- <input type="hidden" name="user_hash" value="$dle_login_hash" />
- <input type=hidden name=catid value=$row[id]>
- </tr>
- </table>
- </td>
- <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
- </tr>
- <tr>
- <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
- <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
- <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
- </tr>
- </table>
- </div></form>
- HTML;
- echofooter();
- die();
- }
- // ********************************************************************************
- // Запись отредактированной категории
- // ********************************************************************************
- elseif( $action == "doedit" ) {
- if( $_REQUEST['user_hash'] == "" or $_REQUEST['user_hash'] != $dle_login_hash ) {
- die( "Hacking attempt! User not found" );
- }
- include_once ENGINE_DIR . '/classes/parse.class.php';
- $parse = new ParseFilter( Array (), Array (), 1, 1 );
- $quotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r", '"' );
- $cat_name = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_name'] ) ), ENT_QUOTES) );
- $skin_name = trim( totranslit($_POST['skin_name'], false, false) );
- $cat_icon = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['cat_icon']) ), ENT_QUOTES) );
- $alt_cat_name = totranslit( stripslashes( $_POST['alt_cat_name'] ), true, false );
- $year = intval($_POST['year']);
- $type = intval($_POST['type']);
- $studio = intval($_POST['studio']);
- $actors = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['actors'] ) ), ENT_QUOTES) );
- //$ganre = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['ganre'] ) ), ENT_QUOTES) );
- //$translator = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['translator'] ) ), ENT_QUOTES) );
- //$edition = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['edition'] ) ), ENT_QUOTES) );
- //$designer = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['designer'] ) ), ENT_QUOTES) );
- //$lyrics = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['lyrics'] ) ), ENT_QUOTES) );
- //$dubber = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['dubber'] ) ), ENT_QUOTES) );
- $director = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['director'] ) ), ENT_QUOTES) );
- $manga = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['manga'] ) ), ENT_QUOTES) );
- $original = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['original'] ) ), ENT_QUOTES) );
- $prod = $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['prod'] ) ), ENT_QUOTES) );
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['ganre'] ) ), ENT_QUOTES) )) as $key => $value){
- $ganre[totranslit($value)] = $value; }
- $ganre = serialize($ganre);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['translator'] ) ), ENT_QUOTES) )) as $key => $value){
- $translator[totranslit($value)] = $value; }
- $translator = serialize($translator);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['edition'] ) ), ENT_QUOTES) )) as $key => $value){
- $edition[totranslit($value)] = $value; }
- $edition = serialize($edition);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['designer'] ) ), ENT_QUOTES) )) as $key => $value){
- $designer[totranslit($value)] = $value; }
- $designer = serialize($designer);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['lyrics'] ) ), ENT_QUOTES) )) as $key => $value){
- $lyrics[totranslit($value)] = $value; }
- $lyrics = serialize($lyrics);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['dubber'] ) ), ENT_QUOTES) )) as $key => $value){
- $dubber[totranslit($value)] = $value; }
- $dubber = serialize($dubber);
- foreach (explode(", ", $db->safesql( htmlspecialchars( strip_tags( stripslashes($_POST['country'] ) ), ENT_QUOTES) )) as $key => $value){
- $country[totranslit($value)] = $value; }
- $country = serialize($country);
- $catid = intval( $_REQUEST['catid'] );
- $parentid = intval( $_POST['parentid'] );
- $meta_title = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['meta_title'] ) ) ) );
- $description = $db->safesql( strip_tags( stripslashes( $_POST['descr'] ) ) );
- $lirika = $db->safesql( strip_tags( stripslashes( $_POST['lir'] ) ) );
- $subs = $db->safesql( strip_tags( stripslashes( $_POST['titry'] ) ) );
- $board = $db->safesql( strip_tags( stripslashes( $_POST['forum'] ) ) );
- $keywords = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['keywords'] ) ) ) );
- $short_tpl = totranslit( stripslashes( trim( $_POST['short_tpl'] ) ) );
- $full_tpl = totranslit( stripslashes( trim( $_POST['full_tpl'] ) ) );
- $date_start = $db->safesql( strip_tags( stripslashes( $_POST['date_start'] ) ) );
- if ( in_array($_POST['news_sort'], array("date", "rating", "news_read", "title")) ) {
- $news_sort = $db->safesql( $_POST['news_sort'] );
- } else $news_sort = "";
- if ( in_array($_POST['news_msort'], array("ASC", "DESC")) ) {
- $news_msort = $db->safesql( $_POST['news_msort'] );
- } else $news_msort = "";
- if ( $_POST['news_number'] > 0)
- $news_number = intval( $_POST['news_number'] );
- else $news_number = 0;
- if( ! $catid ) {
- msg( "error", $lang['cat_error'], $lang['cat_noid'], "$PHP_SELF?mod=categories" );
- }
- if( $cat_name == "" ) {
- msg( "error", $lang['cat_error'], $lang['cat_noname'], "javascript:history.go(-1)" );
- }
- $row = $db->super_query( "SELECT id, alt_name, icon, gallery FROM " . PREFIX . "_category WHERE alt_name = '$alt_cat_name'" );
- if( $row['id'] and $row['id'] != $catid ) {
- msg( "error", $lang['cat_error'], $lang['cat_eradd'], "javascript:history.go(-1)" );
- }
- if( in_array( $parentid, get_sub_cats( $catid ) ) ) {
- msg( "error", $lang['cat_error'], $lang['cat_noparentid'], "$PHP_SELF?mod=categories" );
- }
- /*Работа с картинкой блеать*/
- $images_gallery = unserialize($row['gallery']); //Наполняем массив списком загруженных фоток
- if (isset($_POST['delete']) AND count($_POST['delete']) > 0) {
- foreach ($_POST['delete'] as $id => $val) {
- @unlink(ROOT_DIR . "uploads/stills/" . $images_gallery[$id]);
- @unlink(ROOT_DIR . "uploads/stills/mini/" . $images_gallery[$id]);
- unset($images_gallery[$id]);
- }
- }
- if (check_gallery($_FILES['gallery']['tmp_name'])) { //Добавлены ли в форму новые фото или вообще добавлены ли они
- /*Небольшой конфиг*/
- $config_path_image_upload = ROOT_DIR . "/uploads/stills/"; //Место загрузки картинок
- $screenshot_width = 300; // ширина логотипа
- $screenshot_watermark = 1; // наложение водяного знака
- foreach ($_FILES['gallery']['tmp_name'] as $key => $tmp_name) {
- $file_prefix = time () . "_";
- if (! is_dir ( $config_path_image_upload )) {
- @mkdir ( $config_path_image_upload, 0777 );
- @chmod ( $config_path_image_upload, 0777 );
- }
- if (! is_dir ( $config_path_image_upload ))
- $error .= "- Directory Error. " . $config_path_image_upload . " cannot created. <br />";
- $allowed_extensions = array ("gif", "jpg", "png", "jpe", "jpeg" );
- if (! is_dir ( $config_path_image_upload . 'mini/' )) {
- @mkdir ( $config_path_image_upload . 'mini/', 0777 );
- @chmod ( $config_path_image_upload . 'mini/', 0777 );
- }
- if (! is_dir ( $config_path_image_upload . 'mini/' ))
- $error .= "- Directory Error. " . $config_path_image_upload . "mini/ cannot created. <br />";
- $image = $_FILES['gallery']['tmp_name'][$key];
- $image_name = $_FILES['gallery']['name'][$key];
- $image_size = $_FILES['gallery']['size'][$key];
- $img_name_arr = explode ( ".", $image_name );
- $type = totranslit ( end ( $img_name_arr ) );
- if ($image_name != "")
- {
- $curr_key = key ( $img_name_arr );
- unset ( $img_name_arr [$curr_key] );
- $image_name = totranslit ( implode ( ".", $img_name_arr ) ) . "." . $type;
- }
- $i++;
- /*if ($image_name == "")
- $error .= "- Не удалось определить изображение. Фото № {$i}";
- else*/
- if (($image_name != "") AND !(in_array ( $type, $allowed_extensions ) or in_array ( strtolower ( $type ), $allowed_extensions )))
- $error .= "- Данный тип изображения не поддерживается. Фото № {$i}";
- elseif ($image_size > ($config['max_up_size'] * 1024) and ! $config ['max_up_side'] AND $image_name !== "")
- $error .= "- Размер загружаемого изображения превышает максимально допустимые размеры. Фото № {$i}";
- else {
- @move_uploaded_file ( $image, $config_path_image_upload . $file_prefix . $image_name ) or $img_result = "<div><font color=red>$lang[images_uperr_3]</font></div>";
- if (@file_exists ( $config_path_image_upload . $file_prefix . $image_name ))
- {
- @chmod ( $config_path_image_upload . $file_prefix . $image_name, 0666 );
- include_once ENGINE_DIR . '/classes/thumb.class.php';
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- if ($thumb->size_auto ( $screenshot_width, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- /*if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );*/
- $thumb->save ( $config_path_image_upload . "mini/" . $file_prefix . $image_name );
- }
- /*$thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- if ($thumb->size_auto ( $screenshot_width2, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . "main/" . $file_prefix . $image_name );
- }*/
- if (@file_exists ( $config_path_image_upload . "mini/" . $file_prefix . $image_name )) {
- $img_result_th .= "<div><font color=blue>$image_name -> $lang[images_thok]</font></div>";
- $thumb_img = $image_name;
- }
- @chmod ( $config_path_image_upload . "mini/" . $file_prefix . $image_name, 0666 );
- $config ['max_up_side'] = intval ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1" or $config ['max_up_side'])
- {
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($config ['max_up_side'])
- $thumb->size_auto ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . $file_prefix . $image_name );
- }
- }
- }
- /*Собираем массив новых фоток (Свежих)*/
- if ($image_name)
- $gallery_array[$key] = $file_prefix . $image_name;
- }
- if (count($gallery_array)) {
- foreach ($gallery_array as $id => $name) {
- @unlink(ROOT_DIR . "uploads/stills/" . $images_gallery[$id]);
- @unlink(ROOT_DIR . "uploads/stills/mini/" . $images_gallery[$id]);
- $images_gallery[$id] = $name;
- }
- }
- //Формирование массива загруженных картинок
- if ($error)
- msg( "error", $lang['cat_error'], $error, "javascript:history.go(-1)" );
- }
- if (count($images_gallery) > 0)
- $images_gallery = serialize($images_gallery);
- $icon_name = end(explode("/", $row['icon']));
- $cat_icon = $row['icon'];
- $del_scr = intval($_POST['del_scr']);
- if ($del_scr)
- {
- @unlink ( ROOT_DIR . "/uploads/posters/" . $icon_name );
- @unlink ( ROOT_DIR . "/uploads/posters/mini/".$icon_name );
- @unlink ( ROOT_DIR . "/uploads/posters/main/".$icon_name );
- $thumb_img = "";
- }
- else
- {
- $file_name_thumb = $icon_name;
- $thumb_img = $icon_name;
- }
- $screenshot_width = 300; // ширина логотипа
- $screenshot_width2 = 60; // ширина логотипа
- $screenshot_watermark = 1; // наложение водяного знака
- $error = "";
- if (!empty($_FILES['cat_icon']['name']))
- {
- $file_prefix = time () . "_";
- $config_path_image_upload = ROOT_DIR . "/uploads/posters/";
- if (! is_dir ( $config_path_image_upload )) {
- @mkdir ( $config_path_image_upload, 0777 );
- @chmod ( $config_path_image_upload, 0777 );
- }
- if (! is_dir ( $config_path_image_upload ))
- $error .= "- Directory Error. " . $config_path_image_upload . " cannot created. <br />";
- $allowed_extensions = array ("gif", "jpg", "png", "jpe", "jpeg" );
- if (! is_dir ( $config_path_image_upload . 'mini/' )) {
- @mkdir ( $config_path_image_upload . 'mini/', 0777 );
- @chmod ( $config_path_image_upload . 'mini/', 0777 );
- }
- if (! is_dir ( $config_path_image_upload . 'mini/' ))
- $error .= "- Directory Error. " . $config_path_image_upload . "mini/ cannot created. <br />";
- $current_image = "cat_icon";
- $image = $_FILES [$current_image] ['tmp_name'];
- $image_name = $_FILES [$current_image] ['name'];
- $image_size = $_FILES [$current_image] ['size'];
- $img_name_arr = explode ( ".", $image_name );
- $type = totranslit ( end ( $img_name_arr ) );
- if ($image_name != "")
- {
- $curr_key = key ( $img_name_arr );
- unset ( $img_name_arr [$curr_key] );
- $image_name = totranslit ( implode ( ".", $img_name_arr ) ) . "." . $type;
- }
- if ($image_name == "")
- $error .= "- Не удалось определить изображение.";
- elseif (! (in_array ( $type, $allowed_extensions ) or in_array ( strtolower ( $type ), $allowed_extensions )))
- $error .= "- Данный тип изображения не поддерживается.";
- elseif ($image_size > ($config['max_up_size'] * 1024) and ! $config ['max_up_side'])
- $error .= "- Размер загружаемого изображения превышает максимально допустимые размеры.";
- else {
- @move_uploaded_file ( $image, $config_path_image_upload . $file_prefix . $image_name ) or $img_result = "<div><font color=red>$lang[images_uperr_3]</font></div>";
- if (@file_exists ( $config_path_image_upload . $file_prefix . $image_name ))
- {
- @chmod ( $config_path_image_upload . $file_prefix . $image_name, 0666 );
- include_once ENGINE_DIR . '/classes/thumb.class.php';
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- if ($thumb->size_auto ( $screenshot_width, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . "mini/" . $file_prefix . $image_name );
- }
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- if ($thumb->size_auto ( $screenshot_width2, 0 ))
- {
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . "main/" . $file_prefix . $image_name );
- }
- if (@file_exists ( $config_path_image_upload . "mini/" . $file_prefix . $image_name )) {
- $img_result_th .= "<div><font color=blue>$image_name -> $lang[images_thok]</font></div>";
- $thumb_img = $image_name;
- }
- @chmod ( $config_path_image_upload . "mini/" . $file_prefix . $image_name, 0666 );
- $config ['max_up_side'] = intval ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1" or $config ['max_up_side'])
- {
- $thumb = new thumbnail ( $config_path_image_upload . $file_prefix . $image_name );
- $thumb->jpeg_quality ( $config ['jpeg_quality'] );
- if ($config ['max_up_side'])
- $thumb->size_auto ( $config ['max_up_side'] );
- if ($screenshot_watermark == "1")
- $thumb->insert_watermark ( $config ['max_watermark'] );
- $thumb->save ( $config_path_image_upload . $file_prefix . $image_name );
- }
- }
- }
- $file_name_thumb = $image_name;
- if ($file_name_thumb)
- $file_name_thumb = $file_prefix . $file_name_thumb;
- else
- $file_name_thumb = "";
- if ($thumb_img)
- $thumb_img = $file_prefix . $thumb_img;
- else
- $thumb_img = "";
- if ($thumb_img)
- $cat_icon = $config['http_home_url'] . "uploads/posters/mini/" . $thumb_img;
- else
- $cat_icon = $config['http_home_url'] . "uploads/posters/" . $thumb_img;
- }
- ##=============================Сохранение данных в базу данных===================================##
- if ($error)
- msg( "error", $lang['cat_error'], $error, "javascript:history.go(-1)" );
- $vk_poll = $db->safesql( str_replace( $quotes, " ", strip_tags( stripslashes( $_POST['vk_poll'] ) ) ) );
- $descr_content = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['short_story'], false ) ) );
- $lir_content = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['lir'], true ) ) );
- $titry_content = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['titry'], true ) ) );
- $forum_content = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['forum'], true ) ) );
- //$video = $db->safesql( $parse->BB_Parse( $parse->process( $_POST['treiler'], false ) ) );
- $video = $db->safesql( $parse->BB_Parse($_POST['treiler']) );
- $real_name = $db->safesql( htmlspecialchars ( strip_tags( stripslashes( $_POST['real_name'] ) ) ) );
- //echo $video;
- $db->query( "UPDATE " . PREFIX . "_category set parentid='$parentid', real_name = '$real_name', date_start = '$date_start', vk_poll = '$vk_poll', descr_content = '$descr_content', lir_content='$lir_content', titry_content='$titry_content', forum_content='$forum_content', video = '$video', gallery = '$images_gallery', name='$cat_name', year='$year', type='$type', studio='$studio', country='$country', actors='$actors', janre='$ganre', translate='$translator', edit='$edition', design='$designer', lyric='$lyrics', dub='$dubber', director='$director', manga='$manga', original='$original', prod='$prod', id_rating='".intval($_POST['id_rating'])."', alt_name='$alt_cat_name', icon='$cat_icon', skin='$skin_name', descr='$description', lir='$lirika', titry='$subs', forum='$board', keywords='$keywords', news_sort='$news_sort', news_msort='$news_msort', news_number='$news_number', short_tpl='$short_tpl', full_tpl='$full_tpl', metatitle='$meta_title' WHERE id='$catid'" );
- @unlink( ENGINE_DIR . '/cache/system/category.php' );
- clear_cache();
- msg( "info", $lang['cat_editok'], $lang['cat_editok_1'], "$PHP_SELF?mod=categories" );
- } elseif ($action = "season_list" AND intval($_REQUEST['serial_id'])) {
- echoheader( "options", $cat_info[intval($_REQUEST['serial_id'])]['name'] );
- for ($i = date("Y"); $i >= 1917; $i--)
- $years[$i] = $i;
- $year = MakeDropDown($years, 'year', $cat_info[intval($_REQUEST['serial_id'])]['year']);
- $type = MakeDropDown(array("TV"=>"TV","OVA"=>"OVA","ONA"=>"ONA","Special"=>"Спешл","Movie"=>"Полнометражка","Hentai"=>"Хентай"), 'type', $cat_info[intval($_REQUEST['serial_id'])]['type']);
- $studio = MakeDropDown2(array("8bit"=>"8bit","A-1+Pictures+Inc"=>"A1 Pictures Inc.","Actas+Inc"=>"Actas Inc.","AIC"=>"AIC","AIC+A.S.T.A"=>"AIC A.S.T.A.","AIC+PLUS"=>"AIC PLUS","AIC+Spirits"=>"AIC Spirits","Aniplex"=>"Aniplex","ARMS"=>"ARMS","Artland"=>"Artland","Ashi+Productions"=>"Ashi Productions","Bee+Train"=>"Bee Train","BONES"=>"BONES","Brains+Base"=>"Brains Base","Chaos+Project"=>"Chaos Project","Charaction"=>"Charaction","Cinema+Citrus"=>"Cinema Citrus","CoMix+Wave+Inc"=>"CoMix Wave Inc.","David+Production"=>"David Production","Dogakobo"=>"Dogakobo","Easyfilm"=>"Easyfilm","FEEL"=>"FEEL","Gainax"=>"Gainax","GoHands"=>"GoHands","Gonzo"=>"Gonzo","Group+TAC"=>"Group TAC","Hal+Film+Maker"=>"Hal Film Maker","J.C.+Staff"=>"J.C. Staff","Jinnis+Animation+Studios"=>"Jinnis Animation Studios","Kitty"=>"Kitty","Kyoto+Animation"=>"Kyoto Animation","LMD"=>"LMD","MAD+House"=>"MAD House","Manglobe+Inc"=>"Manglobe Inc.","MAPPA"=>"MAPPA","Milky"=>"Milky","Nippon+Animation"=>"Nippon Animation","Nippon+TV"=>"Nippon TV","Nomad"=>"Nomad","Ordet"=>"Ordet","Oriental+Light+and+Magic"=>"Oriental Light and Magic","P.A.+Works"=>"P.A. Works","Production+I.G"=>"Production I.G","Satelight"=>"Satelight","Seven"=>"Seven","Seven+Arcs"=>"Seven Arcs","Shaft"=>"Shaft","Shochiku"=>"Shochiku","Silver+Link"=>"Silver Link","Studio+4C"=>"Studio 4°C","Studio+Barcelona"=>"Studio Barcelona","Studio+Chizu"=>"Studio Chizu","Studio+Comet"=>"Studio Comet","Studio+DEEN"=>"Studio DEEN","Studio+Gallop"=>"Studio Gallop","Studio+Ghibli"=>"Studio Ghibli","Studio+Pierrot"=>"Studio Pierrot","Sunrise"=>"Sunrise","Synergy+Japan"=>"Synergy Japan","Tatsunoko"=>"Tatsunoko","Telecom+Animation+Film"=>"Telecom Animation Film","The+Answer+Studio"=>"The Answer Studio","TMS"=>"TMS","Toei+Animation"=>"Toei Animation","Triangle+Staff"=>"Triangle Staff","Trigger"=>"Trigger","UFO+Table"=>"UFO Table","Visual+Science+Laboratory"=>"Visual Science Laboratory","WAO+World"=>"WAO! World","White+Fox"=>"White Fox","Xebec"=>"Xebec","ZEXCS"=>"ZEXCS"), 'studio', $cat_info[intval($_REQUEST['serial_id'])]['studio']);
- $season_num = sub_cats_numm(intval($_REQUEST['serial_id'])) + 1;
- $parentid = intval($_REQUEST['serial_id']);
- echo <<<HTML
- <script type="text/javascript">
- function auto_keywords ( key )
- {
- //var wysiwyg = '{$config['allow_admin_wysiwyg']}';
- //if (wysiwyg == "1") {
- // submit_all_data();
- //}
- var short_txt = '{$cat_info[intval($_REQUEST['serial_id'])]['name']} ' + '{$cat_info[intval($_REQUEST['serial_id'])]['metatitle']} ' + document.getElementById('s_n').value + ' ';
- var full_txt = document.getElementById('descr').value;
- ShowLoading('');
- $.post("engine/ajax/keywords.php", { short_txt: short_txt, full_txt: full_txt, key: key }, function(data){
- HideLoading('');
- if (key == 1) { $('#autodescr').val(data); }
- else { $('#autokeywords').val(data); }
- });
- return false;
- }
- </script>
- <form ENCTYPE="multipart/form-data" method="post" action="" >
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
- <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
- <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
- </tr>
- <tr>
- <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <table width="100%">
- <tr>
- <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Новый сезон</div></td>
- </tr>
- </table>
- <div class="unterline"></div>
- <table width="100%">
- <tr>
- <td width="160" style="padding:4px;">Название</td>
- <td><input style="width:300px;" type="text" name="cat_name" id="s_n" value="сезон {$season_num}"> или номер сезона</td>
- </tr>
- <tr>
- <td style="padding:4px;">{$lang['cat_url']}</td>
- <td><input style="width:300px;" type="text" name="alt_cat_name" value="{$cat_info[intval($_REQUEST['serial_id'])]['alt_name']}_{$season_num}"></td>
- </tr>
- <tr>
- <td width="160" style="padding:4px;">Доп. название</td>
- <td><input style="width:300px;" type="text" name="real_name" id="real_name" value=""> или на английском</td>
- </tr>
- <tr>
- <td style="padding:4px;">Постер</td>
- <td><input style="width:400px;" type="file" name="cat_icon" /></td>
- </tr>
- <tr>
- <td style="padding:4px;">Год</td>
- <td>{$year}</td>
- </tr>
- <tr>
- <td style="padding:4px;">Дата выхода</td>
- <td><input style="width:100px;" type="text" name="date_start" style="width:500px;" value=""> ГГГГ-ММ-ДД</td>
- </tr>
- <tr>
- <td colspan="2"><div class="hr_line"></div></td>
- </tr>
- HTML;
- if( $config['allow_admin_wysiwyg'] == "yes" ) {
- include (ENGINE_DIR . '/editor/shortnews.php');
- } else {
- $bb_editor = true;
- include (ENGINE_DIR . '/inc/include/inserttag.php');
- echo <<<HTML
- <tr>
- <td style="padding:4px;">Описание сезона</td>
- <td>{$bb_code}<textarea rows="16" style="width:97%; padding:5px;" onclick="setFieldName(this.name)" name="descr" id="short_story" class="bk"></textarea>
- </td></tr>
- HTML;
- }
- echo <<<HTML
- <tr>
- <td colspan="2"><div class="hr_line"></div></td>
- </tr>
- <tr>
- <td style="padding:4px;">Мета-титл</td>
- <td><textarea name="meta_title" style="width:97%;height:20px;" class="bk"></textarea></td>
- </tr>
- <tr>
- <td style="padding:4px;">{$lang['meta_keys']}</td>
- <td><textarea name="keywords" id="autokeywords" style="width:97%;height:20px;" class="bk"></textarea></td>
- </tr>
- <tr>
- <td style="padding:4px;">Дескрипшн</td>
- <td><textarea name="descr" style="width:97%;height:50px;" onclick="setFieldName(this.name)" name="short_story2" id="autodescr" class="bk">{$row['descr']}</textarea><br />
- <input onClick="auto_keywords(1)" type="button" class="btn" value="{$lang['btn_descr']}" style="width:170px;">
- <input onClick="auto_keywords(2)" type="button" class="btn" value="{$lang['btn_keyword']}" style="width:216px;"></td>
- </tr>
- <tr>
- <td colspan="2"><div class="hr_line"></div></td>
- </tr>
- <tr>
- <td style="padding:4px;"> </td>
- </td>
- <td><input type="submit" class="buttons" value=" {$lang['vote_new']} ">
- <input type=hidden name=mod value=categories>
- <input type="hidden" name="category" value="{$parentid}" />
- <input type="hidden" name="user_hash" value="$dle_login_hash" />
- <input type=hidden name=action value=add></td>
- </tr>
- </table>
- </td>
- <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
- </tr>
- <tr>
- <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
- <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
- <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
- </tr>
- </table>
- </div></form>
- HTML;
- if (sub_cats_numm(intval($_REQUEST['serial_id'])) > 0) {
- echo <<<HTML
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
- <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
- <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
- </tr>
- <tr>
- <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <table width="100%">
- <tr>
- <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$cat_info[intval($_REQUEST['serial_id'])]['name']}: Список сезонов</div></td>
- </tr>
- </table>
- <div class="unterline"></div>
- <table width="100%">
- <tr>
- <td style="padding:2px;">ID</td>
- <td>Название</td>
- <td>{$lang['cat_url']}</td>
- <td>Постер</td>
- <td width="120">{$lang['cat_action']}</td>
- </tr>
- <tr>
- <td colspan="5"><div class="hr_line"></div></td>
- </tr>
- HTML;
- foreach ( $cat_info as $id => $value ) {
- if ($value['parentid'] == intval($_REQUEST['serial_id'])) {
- $category_name = $cat[$id];
- if( $config['allow_alt_url'] == "yes" ) $link = "<a class=\"list\" href=\"" . $config['http_home_url'] . get_url( $id ) . "/\" target=\"_blank\">" . stripslashes( $cat_info[$id]['name'] ) . "</a>";
- else $link = "<a class=\"list\" href=\"{$config['http_home_url']}index.php?do=cat&category=" . $cat_info[$id]['alt_name'] . "\" target=\"_blank\">" . stripslashes( $cat_info[$id]['name'] ) . "</a>";
- echo "<tr>
- <td height=\"14\"> <b>" . $cat_info[$id]['id'] . "</b></td>
- <td> $sublevelmarker " . $link . "</td>
- <td>";
- if( $cat_info[$id]['alt_name'] != "" ) {
- echo $cat_info[$id]['alt_name'];
- } else {
- echo "---";
- }
- echo "</td><td>";
- if( $cat_info[$id]['icon'] != "" ) {
- echo "<img border=0 src=\"" . $cat_info[$id]['icon'] . "\" height=40 width=40 alt=\"" . $cat_info[$id]['icon'] . "\">";
- } else {
- echo "---";
- }
- echo "</td>
- <td class=\"list\"><nobr>[<a href=\"?mod=categories&action=season_edit&season_id=" . $cat_info[$id]['id'] . "\">$lang[cat_ed]</a>] [<a class=maintitle href=\"?mod=categories&user_hash=" . $dle_login_hash . "&action=remove&catid=" . $cat_info[$id]['id'] . "\">$lang[cat_del]</a>]</nobr></td>
- </tr>
- <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=5></td></tr>";
- }
- }
- echo <<<HTML
- </table>
- </td>
- <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
- </tr>
- <tr>
- <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
- <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
- <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
- </tr>
- </table>
- </div>
- HTML;
- } else {
- echo <<<HTML
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
- <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
- <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
- </tr>
- <tr>
- <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <table width="100%">
- <tr>
- <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_list']}</div></td>
- </tr>
- </table>
- <div class="unterline"></div>
- <table width="100%">
- <tr>
- <td height="100" align="center">Сезонов нет</td>
- </tr>
- </table>
- </td>
- <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
- </tr>
- <tr>
- <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
- <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
- <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
- </tr>
- </table>
- </div>
- HTML;
- }
- } elseif ($action = "season_edit" AND intval($_REQUEST['season_id'])) {
- $row = $db->super_query("SELECT * FROM ".PREFIX."_category WHERE id = '".intval($_REQUEST['season_id'])."'");
- include_once ENGINE_DIR . '/classes/parse.class.php';
- $parse = new ParseFilter( Array (), Array (), 1, 1 );
- $row['descr_content'] = $parse->decodeBBCodes( $row['descr_content'], false );
- $row['lir_content'] = $parse->decodeBBCodes( $row['lir_content'], true );
- $row['titry_content'] = $parse->decodeBBCodes( $row['titry_content'], true );
- $row['forum_content'] = $parse->decodeBBCodes( $row['forum_content'], true );
- if (!$row['id'])
- msg( "error", $lang['cat_error'], $lang['cat_eradd'], "javascript:history.go(-1)" );
- echoheader( "options", $cat_info[intval($_REQUEST['serial_id'])]['name'] );
- for ($i = date("Y"); $i >= 1917; $i--)
- $years[$i] = $i;
- $year = MakeDropDown($years, 'year', $row['year']);
- $type = MakeDropDown(array("TV"=>"TV","OVA"=>"OVA","ONA"=>"ONA","Special"=>"Спешл","Movie"=>"Полнометражка","Hentai"=>"Хентай"), 'type', $row['type']);
- $studio = MakeDropDown2(array("8bit"=>"8bit","A-1+Pictures+Inc"=>"A1 Pictures Inc.","Actas+Inc"=>"Actas Inc.","AIC"=>"AIC","AIC+A.S.T.A"=>"AIC A.S.T.A.","AIC+PLUS"=>"AIC PLUS","AIC+Spirits"=>"AIC Spirits","Aniplex"=>"Aniplex","ARMS"=>"ARMS","Artland"=>"Artland","Ashi+Productions"=>"Ashi Productions","Bee+Train"=>"Bee Train","BONES"=>"BONES","Brains+Base"=>"Brains Base","Chaos+Project"=>"Chaos Project","Charaction"=>"Charaction","Cinema+Citrus"=>"Cinema Citrus","CoMix+Wave+Inc"=>"CoMix Wave Inc.","David+Production"=>"David Production","Dogakobo"=>"Dogakobo","Easyfilm"=>"Easyfilm","FEEL"=>"FEEL","Gainax"=>"Gainax","GoHands"=>"GoHands","Gonzo"=>"Gonzo","Group+TAC"=>"Group TAC","Hal+Film+Maker"=>"Hal Film Maker","J.C.+Staff"=>"J.C. Staff","Jinnis+Animation+Studios"=>"Jinnis Animation Studios","Kitty"=>"Kitty","Kyoto+Animation"=>"Kyoto Animation","LMD"=>"LMD","MAD+House"=>"MAD House","Manglobe+Inc"=>"Manglobe Inc.","MAPPA"=>"MAPPA","Milky"=>"Milky","Nippon+Animation"=>"Nippon Animation","Nippon+TV"=>"Nippon TV","Nomad"=>"Nomad","Ordet"=>"Ordet","Oriental+Light+and+Magic"=>"Oriental Light and Magic","P.A.+Works"=>"P.A. Works","Production+I.G"=>"Production I.G","Satelight"=>"Satelight","Seven"=>"Seven","Seven+Arcs"=>"Seven Arcs","Shaft"=>"Shaft","Shochiku"=>"Shochiku","Silver+Link"=>"Silver Link","Studio+4C"=>"Studio 4°C","Studio+Barcelona"=>"Studio Barcelona","Studio+Chizu"=>"Studio Chizu","Studio+Comet"=>"Studio Comet","Studio+DEEN"=>"Studio DEEN","Studio+Gallop"=>"Studio Gallop","Studio+Ghibli"=>"Studio Ghibli","Studio+Pierrot"=>"Studio Pierrot","Sunrise"=>"Sunrise","Synergy+Japan"=>"Synergy Japan","Tatsunoko"=>"Tatsunoko","Telecom+Animation+Film"=>"Telecom Animation Film","The+Answer+Studio"=>"The Answer Studio","TMS"=>"TMS","Toei+Animation"=>"Toei Animation","Triangle+Staff"=>"Triangle Staff","Trigger"=>"Trigger","UFO+Table"=>"UFO Table","Visual+Science+Laboratory"=>"Visual Science Laboratory","WAO+World"=>"WAO! World","White+Fox"=>"White Fox","Xebec"=>"Xebec","ZEXCS"=>"ZEXCS"), 'studio', $row['studio']);
- $season_num = sub_cats_numm(intval($_REQUEST['serial_id'])) + 1;
- if ($row['icon']) {
- $season_poster = <<<HTML
- <tr>
- <td height="29" style="padding-left:5px;">Удалить картинку:</td>
- <td><select name="del_scr"><option value="1">Да</option><option value="0" selected>Нет</option></select></td>
- </tr>
- <tr>
- <td height="29" style="padding-left:5px;">Загруженная картинка:</td>
- <td><a href="{$row['icon']}" target="_blank">Смотреть</a></td>
- </tr>
- <tr>
- <td style="padding:4px;">Постер</td>
- <td><input style="width:400px;" type="file" name="cat_icon" /></td>
- </tr>
- HTML;
- } else {
- $season_poster = <<<HTML
- <tr>
- <td style="padding:4px;">Постер</td>
- <td><input class="edit bk" type="file" name="cat_icon" /></td>
- </tr>
- HTML;
- }
- echo <<<HTML
- <script type="text/javascript">
- function auto_keywords ( key )
- {
- //var wysiwyg = '{$config['allow_admin_wysiwyg']}';
- //if (wysiwyg == "1") {
- // submit_all_data();
- //}
- var short_txt = '{$cat_info[intval($_REQUEST['serial_id'])]['name']} ' + '{$cat_info[intval($_REQUEST['serial_id'])]['metatitle']} ' + document.getElementById('s_n').value + ' ';
- var full_txt = document.getElementById('descr').value;
- ShowLoading('');
- $.post("engine/ajax/keywords.php", { short_txt: short_txt, full_txt: full_txt, key: key }, function(data){
- HideLoading('');
- if (key == 1) { $('#autodescr').val(data); }
- else { $('#autokeywords').val(data); }
- });
- return false;
- }
- </script>
- <form ENCTYPE="multipart/form-data" method="post" action="">
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
- <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
- <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
- </tr>
- <tr>
- <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <table width="100%">
- <tr>
- <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Редактирование: <a href="/shite.php?mod=categories&action=season_list&serial_id={$row['parentid']}"><b>{$cat_info[$row['parentid']]['name']}</b></a> {$row['name']}</div></td>
- </tr>
- </table>
- <div class="unterline"></div>
- <table width="100%">
- <tr>
- <td width="160" style="padding:4px;">Название</td>
- <td><input style="width:300px;" type="text" name="cat_name" value="{$row['name']}"> Ну или просто номер сезона</td>
- </tr>
- <tr>
- <td style="padding:4px;">{$lang['cat_url']}</td>
- <td><input style="width:300px;" type="text" name="alt_cat_name" value="{$row['alt_name']}"><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_cataltname]}', this, event, '250px')">[?]</a></td>
- </tr>
- <tr>
- <td width="160" style="padding:4px;">Дополнительное название</td>
- <td><input style="width:300px;" type="text" name="real_name" value="{$row['real_name']}"> или на английском языке</td>
- </tr>
- {$season_poster}
- <tr>
- <td style="padding:4px;">Год</td>
- <td>{$year}</td>
- </tr>
- <tr>
- <td style="padding:4px;">Дата выхода</td>
- <td><input style="width:100px;" type="text" name="date_start" style="width:500px;" value="{$row['date_start']}"> ГГГГ-ММ-ДД</td>
- </tr>
- <tr>
- <td colspan="2"><div class="hr_line"></div></td>
- </tr>
- HTML;
- if( $config['allow_admin_wysiwyg'] == "yes" ) {
- include (ENGINE_DIR . '/editor/shortnews.php');
- } else {
- $bb_editor = true;
- include (ENGINE_DIR . '/inc/include/inserttag.php');
- echo <<<HTML
- <tr>
- <td style="padding:4px;">Описание сезона</td>
- <td>{$bb_code}<textarea rows="16" style="width:97%; padding:5px;" onclick="setFieldName(this.name)" name="descr" id="short_story" class="bk">{$row['descr_content']}</textarea>
- </td></tr>
- HTML;
- }
- echo <<<HTML
- <tr>
- <td colspan="2"><div class="hr_line"></div></td>
- </tr>
- <tr>
- <td style="padding:4px;">Мета-титл</td>
- <td><textarea name="meta_title" style="width:97%;height:20px;" class="bk">{$row['metatitle']}</textarea></td>
- </tr>
- <tr>
- <td style="padding:4px;">{$lang['meta_keys']}</td>
- <td><textarea name="keywords" id="autokeywords" style="width:97%;height:20px;" class="bk">{$row['keywords']}</textarea></td>
- </tr>
- <tr>
- <td style="padding:4px;">Дескрипшн</td>
- <td><textarea name="descr" style="width:97%;height:50px;" onclick="setFieldName(this.name)" name="short_story2" id="autodescr" class="bk">{$row['descr']}</textarea><br />
- <input onClick="auto_keywords(1)" type="button" class="btn" value="{$lang['btn_descr']}" style="width:170px;">
- <input onClick="auto_keywords(2)" type="button" class="btn" value="{$lang['btn_keyword']}" style="width:216px;"></td>
- </tr>
- <tr>
- <td colspan="2"><div class="hr_line"></div></td>
- </tr>
- <tr>
- <td style="padding:4px;"> </td>
- <input type=hidden name="parentid" value="{$season_num}"></td>
- <td><input type="submit" class="buttons" value=" {$lang['vote_new']} ">
- <input type="hidden" name="parentid" value="{$row['parentid']}">
- <input type=hidden name=mod value=categories>
- <input type=hidden name=action value=doedit>
- <input type="hidden" name="user_hash" value="$dle_login_hash" />
- <input type=hidden name=catid value=$row[id]>
- </tr>
- </table>
- </td>
- <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
- </tr>
- <tr>
- <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
- <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
- <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
- </tr>
- </table>
- </div></form>
- HTML;
- } else {
- // ********************************************************************************
- // List all Categories
- // ********************************************************************************
- echoheader( "options", $lang['cat_head'] );
- $categorylist = cats_main( 0, 0 );
- $skinlist = SelectSkin( '' );
- for ($i = date("Y"); $i >= 1917; $i--)
- $years[$i] = $i;
- $year = MakeDropDown($years, 'year" id="year', $cat_info[$row['id']]['year']);
- $type = MakeDropDown(array("TV"=>"TV","OVA"=>"OVA","ONA"=>"ONA","Special"=>"Спешл","Movie"=>"Полнометражка","Hentai"=>"Хентай"), 'type" id="type', $cat_info[$row['id']]['type']);
- $studio = MakeDropDown2(array("8bit"=>"8bit","A-1+Pictures+Inc"=>"A1 Pictures Inc.","Actas+Inc"=>"Actas Inc.","AIC"=>"AIC","AIC+A.S.T.A"=>"AIC A.S.T.A.","AIC+PLUS"=>"AIC PLUS","AIC+Spirits"=>"AIC Spirits","Aniplex"=>"Aniplex","ARMS"=>"ARMS","Artland"=>"Artland","Ashi+Productions"=>"Ashi Productions","asread"=>"asread","Bee+Train"=>"Bee Train","BONES"=>"BONES","Brains+Base"=>"Brains Base","Chaos+Project"=>"Chaos Project","Charaction"=>"Charaction","Cinema+Citrus"=>"Cinema Citrus","CoMix+Wave+Inc"=>"CoMix Wave Inc.","David+Production"=>"David Production","Dogakobo"=>"Dogakobo","Easyfilm"=>"Easyfilm","FEEL"=>"FEEL","Gainax"=>"Gainax","GoHands"=>"GoHands","Gonzo"=>"Gonzo","Group+TAC"=>"Group TAC","Hal+Film+Maker"=>"Hal Film Maker","J.C.+Staff"=>"J.C. Staff","Jinnis+Animation+Studios"=>"Jinnis Animation Studios","Kitty"=>"Kitty","Kyoto+Animation"=>"Kyoto Animation","LMD"=>"LMD","MAD+House"=>"MAD House","Manglobe+Inc"=>"Manglobe Inc.","MAPPA"=>"MAPPA","Milky"=>"Milky","Nippon+Animation"=>"Nippon Animation","Nippon+TV"=>"Nippon TV","Nomad"=>"Nomad","Ordet"=>"Ordet","Oriental+Light+and+Magic"=>"Oriental Light and Magic","P.A.+Works"=>"P.A. Works","Production+I.G"=>"Production I.G","Satelight"=>"Satelight","Seven"=>"Seven","Seven+Arcs"=>"Seven Arcs","Shaft"=>"Shaft","Shochiku"=>"Shochiku","Silver+Link"=>"Silver Link","Studio+4C"=>"Studio 4°C","Studio+Barcelona"=>"Studio Barcelona","Studio+Chizu"=>"Studio Chizu","Studio+Comet"=>"Studio Comet","Studio+DEEN"=>"Studio DEEN","Studio+Gallop"=>"Studio Gallop","Studio+Ghibli"=>"Studio Ghibli","Studio+Pierrot"=>"Studio Pierrot","Sunrise"=>"Sunrise","Synergy+Japan"=>"Synergy Japan","Tatsunoko"=>"Tatsunoko","Telecom+Animation+Film"=>"Telecom Animation Film","The+Answer+Studio"=>"The Answer Studio","TMS"=>"TMS","Toei+Animation"=>"Toei Animation","Triangle+Staff"=>"Triangle Staff","Trigger"=>"Trigger","UFO+Table"=>"UFO Table","Visual+Science+Laboratory"=>"Visual Science Laboratory","WAO+World"=>"WAO! World","White+Fox"=>"White Fox","Xebec"=>"Xebec","ZEXCS"=>"ZEXCS"), 'studio" id="studio', $cat_info[$row['id']]['studio']);
- echo <<<HTML
- <script type="text/javascript">
- var foto = 0;
- var total = 0;
- $(document).ready(function() {
- $("#add_file_jq").click(function () {
- total++;
- foto++;
- if (foto == 1) {
- $("#add_file_block").before(
- '<div class="hr_line"></div>'
- +'<table cellpadding="0" cellspacing="5" border="0" style="width:100%;" id="file_block_'+total+'">'
- +'<tr align="left">'
- +'<td width="24%" valign="middle">Фотo '+foto+'</td>'
- +'<td><input name="gallery['+total+']" type="file" /></td>'
- +'</tr>'
- +'</table>');
- } else {
- $("#add_file_block").before(
- '<table cellpadding="0" cellspacing="5" border="0" style="width:100%;" id="file_block_'+total+'">'
- +'<tr align="left">'
- +'<td width="24%" valign="middle">Фотo '+foto+'</td>'
- +'<td><input name="gallery['+total+']" type="file" /></td>'
- +'</tr>'
- +'</table>');
- }
- return false;
- });
- $("#del_file_jq").click(function () {
- $("#file_block_"+total).remove();
- total = total - 1;
- foto = foto - 1;
- return false;
- });
- //$("#add_file_jq").click();
- });
- function kp_info ( )
- {
- var url = document.getElementById("kp_url").value;
- ShowLoading("");
- $.ajax({
- type: "POST",
- url: "engine/ajax/kp_parser.php",
- data: "url="+url,
- dataType: "xml",
- success: function(xml) {
- jQuery(xml).find("site").each(
- function() {
- year = jQuery(this).find("year").text(),
- country = jQuery(this).find("country").text(),
- actors = jQuery(this).find("actors").text();
- ganre = jQuery(this).find("ganre").text();
- translator = jQuery(this).find("translator").text();
- edition = jQuery(this).find("edition").text();
- designer = jQuery(this).find("designer").text();
- lyrics = jQuery(this).find("lyrics").text();
- dubber = jQuery(this).find("dubber").text();
- descr = jQuery(this).find("descr").text();
- lir = jQuery(this).find("lir").text();
- titry = jQuery(this).find("titry").text();
- forum = jQuery(this).find("forum").text();
- director = jQuery(this).find("director").text();
- name = jQuery(this).find("name").text();
- or_name = jQuery(this).find("or_name").text();
- $('#name').val(name);
- $('#year').val(year);
- $('#country').val(country);
- $('#or_name').val(or_name);
- $('#ganre').val(ganre);
- $('#translator').val(translator);
- $('#edition').val(edition);
- $('#designer').val(designer);
- $('#lyrics').val(lyrics);
- $('#dubber').val(dubber);
- $('#director').val(director);
- $('#actors').append(actors);
- $('#descr').append(descr);
- $('#lir').append(lir);
- $('#titry').append(titry);
- $('#forum').append(forum);
- $('#poster').html('<td width="260" style="padding:4px;">Постер в КП</td>');
- $('#poster').append('<td><img src="http://st.kinopoisk.ru/images/film/'+ url +'.jpg" heght="80"><br /><input type="checkbox" name="down_poster" value="1"/> Постер с КП</td>');
- }
- );
- }
- });
- HideLoading("");
- return false;
- }
- </script>
- <form ENCTYPE="multipart/form-data" method="post" name=\"serials\" id=\"serials\" action="">
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
- <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
- <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
- </tr>
- <tr>
- <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <table width="100%">
- <tr>
- <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Добавление сериала</div></td>
- </tr>
- </table>
- <div class="unterline"></div>
- <table width="100%">
- <tr id="poster"></tr>
- <tr>
- <td style="padding:4px;">Постер</td>
- <td><input style="width:500px;" type="file" name="cat_icon" /></td>
- </tr>
- <tr>
- <td width="260" style="padding:4px;">{$lang['cat_name']}</td>
- <td><input style="width:500px;" type="text" id="name" name="cat_name"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Оригинальное название:</td>
- <td><input type="text" name="real_name" id="or_name" style="width:500px;"></td>
- </tr>
- <tr>
- <td style="padding:4px;">{$lang['cat_url']}</td>
- <td><input style="width:500px;" type="text" name="alt_cat_name"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Страна</td>
- <td><input type="text" name="country" style="width:500px;" value="{$row['country']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Год</td>
- <td>{$year}</td>
- </tr>
- <tr>
- <td style="padding:4px;">Жанр</td>
- <td><input type="text" name="ganre" style="width:500px;" value="{$row['janre']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Тип</td>
- <td>{$type}</td>
- </tr>
- <tr>
- <td style="padding:4px;">Продолжительность<br>В виде: 25 мин., (13 эп.)</td>
- <td><input type="text" name="prod" style="width:500px;" value="{$row['prod']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Режиссёр</td>
- <td><input type="text" name="director" style="width:500px;" value="{$row['director']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Снято по манге</td>
- <td><input type="text" name="manga" style="width:500px;" value="{$row['manga']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Автор оригинала</td>
- <td><input type="text" name="original" style="width:500px;" value="{$row['original']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Студия</td>
- <td>{$studio}<span id="studio"><img src="http://st.sakuranight.net/8bit.jpg"></span></td>
- </tr>
- <script type="text/javascript">
- //<![CDATA[
- $(function() {
- $("#studio-select").change(function() {
- var graphicFileName = $("#studio-select option:selected").attr("value");
- var newCode = '<img src="http://st.sakuranight.net/' + graphicFileName + '.jpg">';
- $("#studio").html(newCode);
- });
- });
- //]]>
- </script>
- <tr>
- <td style="padding:4px;">Переводчик</td>
- <td><input type="text" name="translator" style="width:500px;" value="{$row['translate']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Редактор</td>
- <td><input type="text" name="edition" style="width:500px;" value="{$row['edit']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Оформление</td>
- <td><input type="text" name="designer" style="width:500px;" value="{$row['design']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Лирика</td>
- <td><input type="text" name="lyrics" style="width:500px;" value="{$row['lyric']}"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Озвучиватели</td>
- <td><input type="text" name="dubber" style="width:500px;" value="{$row['dub']}"></td>
- </tr>
- </table>
- <span id="add_file_block"></span>
- <div class="hr_line"></div>
- <table width="100%">
- HTML;
- if( $config['allow_admin_wysiwyg'] == "yes" ) {
- include (ENGINE_DIR . '/editor/shortnews.php');
- } else {
- $bb_editor = true;
- include (ENGINE_DIR . '/inc/include/inserttag.php');
- echo <<<HTML
- <tr>
- <td width="260" style="padding:4px;">Описание сериала</td>
- <td><textarea rows="16" style="width:490px; padding:5px;" onclick="setFieldName(this.name)" name="short_story" id="descr" class="bk"></textarea>
- </td></tr>
- HTML;
- }
- echo <<<HTML
- <tr>
- <td style="padding:4px;">Трейлер</td>
- <td><input name="treiler" onclick="setFieldName(this.name)" name="short_story2" id="short_story2" style="width:500px;" value="[media=]"></td>
- </tr>
- <tr style="display:none;">
- <td style="padding:4px;">Идентификатор опроса</td>
- <td><input style="width:500px;" value="{$row['vk_poll']}" type="text" name="vk_poll"></td>
- </tr>
- <tr>
- <td style="padding:4px;">Метатитл</td>
- <td><input type="text" name="meta_title" style="width:500px;"></td>
- </tr>
- <tr>
- <td style="padding:4px;">{$lang['meta_keys']}</td>
- <td><textarea name="keywords" style="width:500px;height:50px;" class="bk"></textarea></td>
- </tr>
- <tr>
- <td style="padding:4px;">Дескрипшн</td>
- <td><textarea name="descr" style="width:500px;height:50px;" onclick="setFieldName(this.name)" name="short_story2" id="short_story2" class="bk">{$row['descr']}</textarea></td>
- </tr>
- <tr>
- <td colspan="2"><div class="hr_line"></div></td>
- </tr>
- <tr>
- <td style="padding:4px;"> </td>
- <td><input type="submit" class="buttons" value=" {$lang['vote_new']} ">
- <input type=hidden name=mod value=categories>
- <input type="hidden" name="user_hash" value="$dle_login_hash" />
- <input type=hidden name=action value=add></td>
- </tr>
- </table>
- </td>
- <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
- </tr>
- <tr>
- <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
- <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
- <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
- </tr>
- </table>
- </div></form>
- HTML;
- if( ! count( $cat_info ) ) {
- echo <<<HTML
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
- <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
- <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
- </tr>
- <tr>
- <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <table width="100%">
- <tr>
- <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">{$lang['cat_list']}</div></td>
- </tr>
- </table>
- <div class="unterline"></div>
- <table width="100%">
- <tr>
- <td height="100" align="center">{$lang['cat_nocat']}</td>
- </tr>
- </table>
- </td>
- <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
- </tr>
- <tr>
- <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
- <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
- <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
- </tr>
- </table>
- </div>
- HTML;
- } else {
- function DisplayCategories($parentid = 0, $sublevelmarker = '') {
- global $lang, $cat_info, $config, $dle_login_hash;
- // start table
- if( $parentid == 0 ) {
- echo <<<HTML
- <form method="post" action="">
- <div style="padding-top:5px;padding-bottom:2px;">
- <table width="100%">
- <tr>
- <td width="4"><img src="engine/skins/images/tl_lo.gif" width="4" height="4" border="0"></td>
- <td background="engine/skins/images/tl_oo.gif"><img src="engine/skins/images/tl_oo.gif" width="1" height="4" border="0"></td>
- <td width="6"><img src="engine/skins/images/tl_ro.gif" width="6" height="4" border="0"></td>
- </tr>
- <tr>
- <td background="engine/skins/images/tl_lb.gif"><img src="engine/skins/images/tl_lb.gif" width="4" height="1" border="0"></td>
- <td style="padding:5px;" bgcolor="#FFFFFF">
- <table width="100%">
- <tr>
- <td bgcolor="#EFEFEF" height="29" style="padding-left:10px;"><div class="navigation">Список сериалов</div></td>
- </tr>
- </table>
- <div class="unterline"></div>
- <table width="100%">
- <tr>
- <td style="padding:2px;">ID</td>
- <td style="padding:2px;">Position</td>
- <td>{$lang['cat_cat']}</td>
- <td>{$lang['cat_url']}</td>
- <td>Постер</td>
- <td>Сезонов</td>
- <td width="120">{$lang['cat_action']}</td>
- </tr>
- <tr>
- <td colspan="7"><div class="hr_line"></div></td>
- </tr>
- HTML;
- } else {
- $sublevelmarker .= '--';
- }
- if( count( $cat_info ) ) {
- foreach ( $cat_info as $cats ) {
- if( $cats['parentid'] == $parentid ) $root_category[] = $cats['id'];
- }
- if( count( $root_category ) ) {
- foreach ( $root_category as $id ) {
- $category_name = $cat[$id];
- if( $config['allow_alt_url'] == "yes" ) $link = "<a class=\"list\" href=\"" . $config['http_home_url'] . get_url( $id ) . "/\" target=\"_blank\">" . stripslashes( $cat_info[$id]['name'] ) . "</a>";
- else $link = "<a class=\"list\" href=\"{$config['http_home_url']}index.php?do=cat&category=" . $cat_info[$id]['alt_name'] . "\" target=\"_blank\">" . stripslashes( $cat_info[$id]['name'] ) . "</a>";
- echo "<tr>
- <td height=\"14\"> <b>" . $cat_info[$id]['id'] . "</b></td>
- <td height=\"20\"><input class=\"edit\" type=\"text\" size=\"5\" name=\"posi[{$cat_info[$id]['id']}]\" maxlength=\"5\" value=\"{$cat_info[$id]['posi']}\"></td>
- <td> $sublevelmarker " . $link . "</td>
- <td>";
- if( $cat_info[$id]['alt_name'] != "" ) {
- echo $cat_info[$id]['alt_name'];
- } else {
- echo "---";
- }
- echo "</td><td>";
- if( $cat_info[$id]['icon'] != "" ) {
- echo "<img border=0 src=\"" . $cat_info[$id]['icon'] . "\" height=40 width=40 alt=\"" . $cat_info[$id]['icon'] . "\">";
- } else {
- echo "---";
- }
- $sub_cats_num = sub_cats_numm($id);
- echo "</td><td>";
- echo "<a href=\"?mod=categories&action=season_list&serial_id={$id}\" title=\"Управление сезонами сериала {$cat_info[$id]['name']}\">{$sub_cats_num}</a>";
- echo "</td>
- <td class=\"list\"><nobr>[<a href=\"?mod=categories&action=edit&catid=" . $cat_info[$id]['id'] . "\">$lang[cat_ed]</a>] [<a class=maintitle href=\"?mod=categories&user_hash=" . $dle_login_hash . "&action=remove&catid=" . $cat_info[$id]['id'] . "\">$lang[cat_del]</a>]</nobr></td>
- </tr>
- <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>";
- //DisplayCategories( $id, $sublevelmarker );
- }
- }
- }
- // end table
- if( $parentid == 0 ) {
- echo <<<HTML
- <tr>
- <td colspan="7" style="padding:5px;"><input type=hidden name=action value=sort><input type="submit" id="posi" class="edit" value="$lang[cat_posi]" /></td>
- </tr>
- </table>
- </td>
- <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td>
- </tr>
- <tr>
- <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td>
- <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td>
- <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td>
- </tr>
- </table>
- </div></form>
- HTML;
- }
- }
- DisplayCategories();
- }
- }
- function sub_cats_numm($id) {
- global $cat_info;
- foreach ($cat_info as $key => $value) {
- if ($id == $value['parentid'])
- $i++;
- }
- return intval($i);
- }
- echofooter();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement