Example #1
0
<?php

if (PROTECT != 1) {
    die;
}
$hq = new hq_framework();
if (!$hq->exists_table('menu')) {
    $hq->new_table('menu', 'name,link');
}
$count = $hq->get_info('menu', 'name');
$name = $hq->get_col('menu', 'name');
$link = $hq->get_col('menu', 'link');
for ($x = 1; $x <= $count; $x++) {
    if ($name[$x]) {
        $menu .= '<li><a href="' . href($link[$x]) . '">' . $name[$x] . '</a></li>';
    }
}
Example #2
0
<?php

if (PROTECT != 1) {
    die;
}
$hq = new hq_framework();
$title = $local['title'];
if (!$hq->exists_table('qb')) {
    $hq->new_table('qb', 'user,text');
}
if ($local['enable']) {
    html('<h2>' . $local['title'] . '</h2>');
    form("open");
    form("label", '<b>Имя должно состоять из латинских букв и цифр, содержать от 3 до 15 символов. Cообщение не должно привышать 300 символов.</b>');
    form("label", 'Имя:');
    form("input", array("type" => 'text', "name" => 'name', "value" => $_POST['name']));
    form("label", 'Сообщение:');
    form("textarea", array("name" => 'text', "rows" => 10, "cols" => 70, "value" => $_POST['text']));
    html("<br>");
    get_addon("capcha");
    form("label", 'Введите код с картинки:');
    form("input", array("type" => 'text', "name" => 'capcha'));
    form("label");
    form("input", array("type" => 'submit', "name" => 'qq', "value" => 'Добавить запись'));
    form("close");
    if ($_POST['qq']) {
        if ($_SESSION['capcha'] == $_POST['capcha']) {
            if (preg_match("/^[a-zA-Z0-9]{3,15}\$/", $_POST['name']) && mb_strlen($_POST['text'], 'UTF-8') <= 300 && $_POST['text']) {
                $hq->new_record('qb', 'user', $_POST['name']);
                $hq->new_record('qb', 'text', $_POST['text']);
                header('location:' . href($GET[0]));
Example #3
0
<?php

$hq = new hq_framework();
if (!$hq->exists_table('qb')) {
    $hq->new_table('qb', 'user,text');
}
if (PROTECT != 1) {
    die;
}
if ($_SESSION['admin']) {
    $k = $hq->get_info('qb', 'user');
    if ($GET[2] == 'del') {
        if ($GET[3] != 'all') {
            $GET[3] = abs(intval($GET[3]));
            if ($GET[3] && $GET[3] <= $k) {
                $hq->set_record('qb', 'text', $GET[3], 'Сообщение удалено администратором!');
                header('location:' . href(THIS, 2));
            } else {
                header('location:' . href(THIS, 2));
            }
        } else {
            $hq->del_table('qb');
            header('location:' . href(THIS, 2));
        }
    }
    html('<h3>Управление модулем "' . $local['title'] . '"</h3>');
    $GET[2] = abs(intval($GET[2]));
    if (!$GET[2]) {
        $GET[2] = 1;
    }
    $on_page = 25;
Example #4
0
    die;
}
$title = 'Настройка главного меню';
function appendix_scan_dir($link = ' ')
{
    $dir = scan_dir(str_replace('kernel/', '', GLISS_DIR) . 'appendix', DIR);
    foreach ($dir as $key => $value) {
        if ($link == $value) {
            $sel = '" selected >';
        } else {
            $sel = '" >';
        }
        echo '<option value="' . $value . $sel . $value . '</option>' . "\n";
    }
}
$hq = new hq_framework();
if (!$hq->exists_table('menu')) {
    $hq->new_table('menu', 'name,link');
}
if ($_SESSION['admin']) {
    $count = $hq->get_info('menu', 'name');
    switch ($GET[1]) {
        case 'delete':
            if (intval($GET[2]) && $GET[2] <= $count) {
                if (!$_POST) {
                    ?>
          <form action="" method="post">
          <b>Удалить пунк "<?php 
                    echo htmlspecialchars($hq->get_record('menu', 'name', $GET[2]));
                    ?>
"?</b>