Example #1
0
                $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('Редактирование страницы');
            echo <<<HTML
<form method="POST" action="">

<style type="text/css" media="all">
.inpu{width:458px;}
textarea{width:300px;height:300px;}
</style>

<div class="fllogall" style="width:130px">Заголовок:</div><input class="inpu" type="text" name="title" value="{$row['title']}" /><div class="mgcler"></div>

<div class="fllogall" style="width:130px">Адрес: (например <b>test</b>):</div><input class="inpu" type="text" name="alt_name" value="{$row['alt_name']}" /><div class="mgcler"></div>

<div class="fllogall" style="width:130px">Текст:</div><textarea class="inpu" name="text">{$row['text']}</textarea><div class="mgcler"></div>
Example #2
0
    if ($row) {
        //Подключаем парсер
        include ENGINE_DIR . '/classes/parse.php';
        $parse = new parse();
        if (isset($_POST['save'])) {
            $title = textFilter($_POST['title'], false, true);
            $text = $parse->BBparse(textFilter($_POST['full_text']));
            if (isset($title) and !empty($title) and isset($text) and !empty($text)) {
                $db->query("UPDATE `" . PREFIX . "_notes` SET title = '" . $title . "', full_text = '" . $text . "' WHERE id = '" . $note_id . "'");
                msgbox('Информация', 'Заметка успешно сохранена', '?mod=notes');
            } else {
                msgbox('Ошибка', 'Заполните все поля', '?mod=notes&act=edit&id=' . $note_id);
            }
        } else {
            $row['title'] = stripslashes($row['title']);
            $row['full_text'] = $parse->BBdecode(stripslashes(myBrRn($row['full_text'])));
            echoheader();
            echohtmlstart('Редактирование заметки');
            echo <<<HTML
<style type="text/css" media="all">
.inpu{width:487px;}
textarea{width:450px;height:400px;}
</style>

<form action="" method="POST">

<input type="hidden" name="mod" value="notes" />

<div class="fllogall" style="width:100px">Заголовок:</div>
 <input type="text" name="title" class="inpu" value="{$row['title']}" />
<div class="mgcler"></div>
Example #3
0
 //################### Страница редактирования ###################//
 case "edit":
     if ($user_group[$user_info['user_group']]['addnews']) {
         $id = intval($_GET['id']);
         $row = $db->super_query("SELECT title, story FROM `" . PREFIX . "_blog` WHERE id = '{$id}'");
         if ($row) {
             //Подключаем парсер
             include ENGINE_DIR . '/classes/parse.php';
             $parse = new parse();
             function BBdecodeImg($source)
             {
                 return '[img]' . $source . '[/img]';
             }
             $row['story'] = preg_replace("#\\<img src=\"(.*?)\\\" alt=\"\" />#ies", "\\BBdecodeImg('\\1')", $row['story']);
             $tpl->load_template('blog/edit.tpl');
             $tpl->set('{story}', $parse->BBdecode(stripslashes(myBrRn($row['story']))));
             $tpl->set('{title}', stripslashes($row['title']));
             $tpl->set('{id}', $id);
             $tpl->compile('content');
         } else {
             Hacking();
         }
     } else {
         Hacking();
     }
     break;
     //################### Сохранение отредактированых ###################//
 //################### Сохранение отредактированых ###################//
 case "save":
     NoAjaxQuery();
     if ($user_group[$user_info['user_group']]['addnews']) {
Example #4
0
         include ENGINE_DIR . '/classes/parse.php';
         $parse = new parse();
         //Загруажем head заметок
         $tpl->load_template('notes/head.tpl');
         $tpl->set('{note-id}', $note_id);
         $tpl->set('[edit]', '');
         $tpl->set('[/edit]', '');
         $tpl->set_block("'\\[all\\](.*?)\\[/all\\]'si", "");
         $tpl->set_block("'\\[add\\](.*?)\\[/add\\]'si", "");
         $tpl->set_block("'\\[view\\](.*?)\\[/view\\]'si", "");
         $tpl->compile('info');
         //Загружаем шаблон редактирования
         $tpl->load_template('notes/edit.tpl');
         $tpl->set('{note-id}', $note_id);
         $tpl->set('{title}', stripslashes($row['title']));
         $tpl->set('{text}', $parse->BBdecode(stripslashes(myBrRn($row['full_text']))));
         $tpl->compile('content');
     } else {
         $user_speedbar = $lang['error'];
         msgbox('', $lang['no_notes'], 'info');
     }
     break;
     //################### Сохранение изменений ###################//
 //################### Сохранение изменений ###################//
 case "editsave":
     NoAjaxQuery();
     //Подключаем парсер
     include ENGINE_DIR . '/classes/parse.php';
     $parse = new parse();
     $note_id = intval($_POST['note_id']);
     $title = textFilter(ajax_utf8($_POST['title']), false, true);