Esempio n. 1
0
            $arr = loaddata($myFile);
        }
        $present = false;
        if (is_array($arr)) {
            foreach ($arr as $key => $ta) {
                if ($cat . '/' . $edit == $ta['fname']) {
                    $arr[$key]['opisanie'] = $opisanie;
                    $present = true;
                    break;
                }
            }
        }
        if (!$present) {
            $arr[] = $data;
        }
        savedataarray($myFile, $arr, 'w');
        header("LOCATION: {$prefflp}/admin/photo.php?edit={$edit}&cat={$cat}");
        exit;
    }
    $contentcenter .= '<br /><br /><a href=\'javascript:history.back(1)\'><b>Вернуться назад</b></a><tr></table>';
    include LOCALPATH . '/admin/admintemplate.php';
    exit;
}
if ($addpic) {
    include LOCALPATH . '/admin/uploadFile.php';
}
if ($delcat) {
    $photoFile = PICTURES . $delcat;
    if (file_exists($photoFile)) {
        if ($del_ok > 0) {
            !full_del_dir($photoFile);
Esempio n. 2
0
function inc_newsread_count($news_id)
{
    global $newslogfilename;
    $news = loaddata($newslogfilename);
    $notread = true;
    $newsout = array();
    foreach ($news as $data) {
        if ($data['id'] == $news_id) {
            $data['count']++;
            $notread = false;
        }
        $newsout[] = $data;
    }
    if ($notread) {
        $newsout[] = array('id' => $news_id, 'count' => 1);
    }
    savedataarray($newslogfilename, $newsout, 'w');
}
Esempio n. 3
0
if (isset($_REQUEST['mess'])) {
    if ($edit > 0) {
        $gbs = loaddata($myFile);
        $data = $gbs[$edit - 1];
        $msg = $_REQUEST['mess'];
        $msg = nl2br($msg);
        $msg = filterquotes($msg);
        $data['mess'] = $msg;
        $answer = trim($_REQUEST['answer']);
        if (strip_tags($answer) == '') {
            unset($data['answer']);
        } else {
            $data['answer'] = filterquotes(nl2br($answer));
        }
        $gbs[$edit - 1] = $data;
        savedataarray($myFile, $gbs, 'w');
    }
    header('Location: /admin/guestbook.php');
}
@($contentcenter .= '<h3>Список записей гостевой книги</h3>');
if (file_exists($myFile)) {
    $gbs = file($myFile);
    //Удаление
    if ($del > 0) {
        @chmod($myFile, 0777);
        $open = fopen("{$myFile}", "w");
        for ($i = 0; $i < count($gbs); $i++) {
            if ($i + 1 !== $del) {
                fwrite($open, $gbs[$i]);
            }
        }
Esempio n. 4
0
     if ($down < count($menu)) {
         array_splice($menu, $down + 1, 0, $menu[$down - 1]);
         array_splice($menu, $down - 1, 1);
         savearray($myFile, $menu, 'w', '');
     }
     header('LOCATION:menueditor.php');
     //Новый
 } elseif ($new > 0) {
     $data = array('page' => '/', 'head' => __('Новый пункт'), 'title' => __('Подсказка'));
     savedata($myFile, $data, 'a');
     header('LOCATION:menueditor.php?edit=' . (count($menu) + 1));
     //Сформировать меню
 } elseif ($makemenudb > 0) {
     $data[] = array('page' => '/', 'head' => __('Главная'), 'title' => '');
     $data = menudirlist($data, ARTICLES);
     savedataarray($myFile, $data, 'w');
     header('LOCATION:menueditor.php');
     //Редактирование
 } elseif ($edit > 0) {
     $countmenu = count($menu);
     for ($i = 1; $i <= $countmenu; $i++) {
         $menu_item = unserialize($menu[$i - 1]);
         if ($menu_item == "") {
             continue;
         }
         @($page = $menu_item['page']);
         @($head = $menu_item['head']);
         @($title = $menu_item['title']);
         @($blank = $menu_item['blank']);
         @($submenu = $menu_item['submenu']);
         @($viewup = $menu_item['viewup']);