예제 #1
1
             Hacking();
         }
     } else {
         Hacking();
     }
     break;
     //################### Сохранение отредактированых ###################//
 //################### Сохранение отредактированых ###################//
 case "save":
     NoAjaxQuery();
     if ($user_group[$user_info['user_group']]['addnews']) {
         //Подключаем парсер
         include ENGINE_DIR . '/classes/parse.php';
         $parse = new parse();
         $title = ajax_utf8(textFilter($_POST['title'], false, true));
         $text = $parse->BBparse(ajax_utf8(textFilter($_POST['text'])));
         $id = intval($_POST['id']);
         function BBimg($source)
         {
             return "<img src=\"{$source}\" alt=\"\" />";
         }
         $text = preg_replace("#\\[img\\](.*?)\\[/img\\]#ies", "\\BBimg('\\1')", $text);
         if (isset($title) and !empty($title) and isset($text) and !empty($text)) {
             $db->query("UPDATE `" . PREFIX . "_blog` SET title = '{$title}', story = '{$text}' WHERE id = '{$id}'");
         }
     }
     die;
     break;
     //################### Загрузка фотографии ###################//
 //################### Загрузка фотографии ###################//
 case "upload":
예제 #2
0
     $db->query("DELETE FROM `" . PREFIX . "_static` WHERE id = '" . $id . "'");
     header("Location: ?mod=static");
 }
 //Редактирование
 if ($_GET['act'] == 'edit') {
     $id = intval($_GET['id']);
     $row = $db->super_query("SELECT title, alt_name, text FROM `" . PREFIX . "_static` WHERE id = '" . $id . "'");
     if ($row) {
         //Сохраняем
         if (isset($_POST['save_edit'])) {
             //Подключаем парсер
             include_once ENGINE_DIR . '/classes/parse.php';
             $parse = new parse();
             $title = textFilter($_POST['title'], false, true);
             $alt_name = totranslit($_POST['alt_name']);
             $text = $parse->BBparse(textFilter($_POST['text']));
             if (isset($title) and !empty($title) and isset($text) and !empty($text) and isset($alt_name) and !empty($alt_name)) {
                 $db->query("UPDATE`" . PREFIX . "_static` SET alt_name = '" . $alt_name . "', title = '" . $title . "', text = '" . $text . "' WHERE id = '" . $id . "'");
                 header("Location: ?mod=static");
             } else {
                 msgbox('Ошибка', 'Все поля обязательны к заполнению', 'javascript:history.go(-1)');
             }
             die;
         }
         echoheader();
         $row['title'] = stripslashes($row['title']);
         //Подключаем парсер
         include_once ENGINE_DIR . '/classes/parse.php';
         $parse = new parse();
         $row['text'] = $parse->BBdecode(myBrRn(stripslashes($row['text'])));
         echohtmlstart('Редактирование страницы');