示例#1
0
$sidx = $_GET['sidx'];
// get index row - i.e. user click to sort
$sord = $_GET['sord'];
// get the direction
if (isset($_POST["oper"])) {
    $oper = $_POST['oper'];
} else {
    $oper = "";
}
if (isset($_POST["id"])) {
    $id = $_POST['id'];
} else {
    $id = "";
}
if (isset($_POST["title"])) {
    $title = ClearMySqlString($sqlcn->idsqlconnection, $_POST['title']);
} else {
    $title = "";
}
if (isset($_POST["stiker"])) {
    $stiker = $_POST['stiker'];
} else {
    $stiker = "";
}
if ($oper == '') {
    if (!$sidx) {
        $sidx = 1;
    }
    $result = $sqlcn->ExecuteSQL("SELECT COUNT(*) AS count FROM news");
    $row = mysqli_fetch_array($result);
    $count = $row['count'];
示例#2
0
<?php

// Данный код создан и распространяется по лицензии GPL v3
// Разработчики:
//   Грибов Павел,
//   Сергей Солодягин (solodyagin@gmail.com)
//   (добавляйте себя если что-то делали)
// http://грибовы.рф
defined('WUO_ROOT') or die('Доступ запрещён');
// Запрещаем прямой вызов скрипта.
if (isset($_GET['config']) == 'save') {
    $cfg->sitename = ClearMySqlString($sqlcn->idsqlconnection, $_POST['form_sitename']);
    $cfg->ad = isset($_POST['form_cfg_ad']) ? $_POST['form_cfg_ad'] : 0;
    $cfg->ldap = $_POST['form_cfg_ldap'];
    $cfg->domain1 = $_POST['form_cfg_domain1'];
    $cfg->domain2 = $_POST['form_cfg_domain2'];
    $cfg->theme = $_POST['form_cfg_theme_sl'];
    $cfg->emailadmin = $_POST['form_emailadmin'];
    $cfg->smtphost = $_POST['form_smtphost'];
    // Сервер SMTP
    $cfg->smtpauth = isset($_POST['form_smtpauth']) ? $_POST['form_smtpauth'] : 0;
    // Требуется утенфикация?
    $cfg->smtpport = $_POST['form_smtpport'];
    // SMTP порт
    $cfg->smtpusername = $_POST['form_smtpusername'];
    // SMTP имя пользователя для входа
    $cfg->smtppass = $_POST['form_smtppass'];
    // SMTP пароль пользователя для входа
    $cfg->emailreplyto = $_POST['form_emailreplyto'];
    // Куда слать ответы
    $cfg->urlsite = $_POST['urlsite'];
示例#3
0
// http://грибовы.рф
if (isset($_GET["step"])) {
    $step = $_GET["step"];
} else {
    $step = "";
}
if ($user->mode == 1 and $step != '') {
    $dtpost = DateToMySQLDateTime2($_POST["dtpost"]);
    if ($dtpost == "") {
        $err[] = "Не введена дата!";
    }
    $title = $_POST["title"];
    if ($title == "") {
        $title = "Не задан заголовок!";
    }
    $txt = ClearMySqlString($sqlcn->idsqlconnection, $_POST["txt"]);
    if ($txt == "") {
        $txt = "Нету тела новости!";
    }
    $newsid = $_GET["newsid"];
    if ($step == "add") {
        if (count($err) == 0) {
            $sql = "INSERT INTO news (id,dt,title,body) VALUES (NULL,'{$dtpost}','{$title}','{$txt}')";
            $result = $sqlcn->ExecuteSQL($sql);
            //echo "$sql";
            if ($result == '') {
                die('Не смог добавить новость!: ' . mysqli_error($sqlcn->idsqlconnection));
            }
        }
    }
    if ($step == "edit" and $newsid != "") {
示例#4
0
 *   Грибов Павел,
 *   Сергей Солодягин (solodyagin@gmail.com)
 *   (добавляйте себя если что-то делали)
 * http://грибовы.рф
 */
// Запрещаем прямой вызов скрипта.
defined('WUO_ROOT') or die('Доступ запрещён');
$page = GetDef('page', '1');
$limit = GetDef('rows');
$sidx = GetDef('sidx', '1');
$sord = GetDef('sord');
$oper = PostDef('oper');
$id = PostDef('id');
$title = PostDef('title');
if (!empty($title)) {
    $title = ClearMySqlString($sqlcn->idsqlconnection, $title);
}
$stiker = PostDef('stiker');
if ($oper == '') {
    // Проверяем может ли пользователь просматривать?
    $user->TestRoles('1,3,4,5,6') or die('Недостаточно прав');
    $result = $sqlcn->ExecuteSQL("SELECT COUNT(*) AS cnt FROM news");
    $row = mysqli_fetch_array($result);
    $count = $row['cnt'];
    $total_pages = $count > 0 ? ceil($count / $limit) : 0;
    if ($page > $total_pages) {
        $page = $total_pages;
    }
    $start = $limit * $page - $limit;
    $sql = "SELECT * FROM news ORDER BY {$sidx} {$sord} LIMIT {$start}, {$limit}";
    $result = $sqlcn->ExecuteSQL($sql) or die('Не могу выбрать список новостей! ' . mysqli_error($sqlcn->idsqlconnection));