예제 #1
0
파일: add.php 프로젝트: porese/kandidat-cms
<?php

$path = substr(str_replace('\\', '/', dirname(__FILE__)), 0, -6);
include $path . '/admin/adminses.php';
if (2 > getpermision()) {
    header('LOCATION:' . $prefflp . 'index.php');
}
$date = date("d.m.Y");
$cat = isset($_GET['cat']) ? trim($_GET['cat']) : '';
$subcat = isset($_GET['subcat']) ? trim($_GET['subcat']) : '';
$title = filtermessage($_POST['title']);
$name_link = trim($_POST['name_link']);
$content = filterquotes($_POST['editor']);
$myinclude = isset($_POST['myinclude']) ? trim($_POST['myinclude']) : 'main';
$description = trim($_POST['description']);
$keywords = trim($_POST['keywords']);
$for_menu = (int) $_POST['formenu'];
$for_cat = (int) $_POST['forcat'];
$templatepage = trim($_POST['templatepage']);
$commentpage = trim($_POST['commentpage']);
$pubdate = trim($_POST['pubdate']);
$tags = trim($_POST['tags']);
if ($cat == '') {
    $folder = ARTICLES;
    $addpage = '';
    $linkinfo = '/';
    $golink = '';
} else {
    if ($subcat == '') {
        $folder = ARTICLES . $cat . '/';
        $addpage = '?cat=' . $cat;
예제 #2
0
@($contentcenter .= '<h3>Настройка раздела</h3>');
$myFile = PICTURES . $cat . '/info.dat';
if (file_exists($myFile)) {
    $title_cat = loadsimple($myFile);
    if ($title_cat === false) {
        $title_cat = 'Без имени';
    }
} else {
    $title_cat = 'Без имени';
}
$contentcenter .= <<<EOT
<form action="{$url}" method="post" name="razdel_form">
<label title="Название раздела :: Постарайтесь кратко обозначить тематику раздела для фото, размещенных в этом разделе.">Название раздела фото-альбома*<br />
<input class="settings" type="text" name="titlecat" id="title" value="{$title_cat}"></label>
<input type="hidden" name="cat" value="{$cat}">
<br /><br />
<div class="submit"><input type="submit" class="submit-button" id="Submit" name="title" value="Сохранить изменения" /></div><br />
</form>
<br><br><a href="../admin/photo.php"><b>Вернуться в фото-альбом</b></a>
EOT;
if (isset($_REQUEST['title'])) {
    $ntitle = filtermessage($_REQUEST['titlecat']);
    $ncat = trim($_REQUEST['cat']);
    if ($ntitle == '') {
        $contentcenter = '<font size="2"><b>Вы не заполнили одно из обязательных полей!<br />Поля, отмеченные звездочкой (*), должны быть заполнены!</b></font><br><br><a href=\'javascript:history.back(1)\'><B>Вернуться назад</B></a>';
    } else {
        save(PICTURES . $ncat . '/info.dat', $ntitle, 'w');
        $contentcenter = '<font size="2"><b>Раздел успешно изменён!</b></font><br><br><a href="../admin/photo.php"><b>Вернуться в фото-альбом</b>';
    }
}
include $localpath . 'admin/admintemplate.php';
예제 #3
0
$path = substr(str_replace('\\', '/', dirname(__FILE__)), 0, -6);
include $path . '/admin/adminses.php';
if (2 > getpermision()) {
    header('LOCATION:index.php');
}
$sitetitle = 'Добавить новость';
$url = $_SERVER['PHP_SELF'];
include CONF . 'newsconf.php';
if (!empty($_SESSION['name'])) {
    $adminname = $_SESSION['name'];
}
$date = date("d.m.Y");
$time = date("H:i:s");
if (isset($_REQUEST['action'])) {
    $head = filtermessage($_REQUEST['header']);
    $new = filterquotes($_REQUEST['editorh']);
    $extranew = filterquotes($_REQUEST['editor']);
    $adminname = filterquotes($_REQUEST['adminname']);
    $pubdate = trim($_REQUEST['pubdate']);
    $comments = (int) $_REQUEST['comments'];
    $idmess = time();
    $description = $new['description'];
    $keywords = $new['keywords'];
    $tags = $new['tags'];
    if (trim($_REQUEST['header']) == '' || $new == '') {
        $contentcenter = '<font size="2" color="' . $warnalertcolor . '"><b>Вы не заполнили одно из обязательных полей!<br>Поля, отмеченные звездочкой (*), должны быть заполнены!</b></font>';
    } else {
        $data = array('head' => $head, 'mess' => $new, 'aname' => $adminname, 'admmail' => $admmail, 'pubdate' => $pubdate, 'pubtime' => $time, 'extra' => $extranew, 'id' => $idmess, 'comments' => $comments, 'description' => $description, 'keywords' => $keywords, 'tags' => $tags);
        savedata($newsdbfilename, $data, 'a+');
        $contentcenter = '<font size="2" color="' . $warnalertcolor . '"><b>Новость успешно добавлена!</b></font><br /><br />';
예제 #4
0
	    <th colspan="1" width="3%">' . __('Нов.') . '</td>
	    <th colspan="1" width="3%">' . __('Суб.') . '</td>
	    <th colspan="1" width="3%">' . __('Ред.') . '</td>
	    <th colspan="1" width="3%">' . __('Удал.') . '</td>
	    <th colspan="3" width="10%">' . __('Перем.') . '</td>
	    </tr>
	    </thead><tbody>';
if (file_exists($myFile)) {
    //Запись
    if (isset($_POST['go'])) {
        if (trim($_REQUEST['page']) != "" & trim($_REQUEST['head']) != "") {
            $menu = file($myFile);
            if ($edit > 0 & count($menu) >= $edit) {
                $page = trim($_REQUEST['page']);
                $head = filtermessage($_REQUEST['head']);
                $title = filtermessage($_REQUEST['title']);
                $submenu = trim($_REQUEST['submenu']);
                $blank = trim($_REQUEST['blank']);
                $viewup = trim($_REQUEST['viewup']);
                $data = array('page' => $page, 'head' => $head, 'title' => $title, 'blank' => $blank, 'submenu' => $submenu, 'viewup' => $viewup);
                $menu[$edit - 1] = serialize($data) . "\n";
                savearray($myFile, $menu, 'w', '');
            }
            header('LOCATION:menueditor.php');
        }
    }
    $menu = file($myFile);
    //Удаление
    if ($what > 0) {
        if (count($menu) >= $what) {
            array_splice($menu, $what - 1, 1);