当前位置: 首页>>代码示例>>PHP>>正文


PHP functions::display_error方法代码示例

本文整理汇总了PHP中functions::display_error方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::display_error方法的具体用法?PHP functions::display_error怎么用?PHP functions::display_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在functions的用法示例。


在下文中一共展示了functions::display_error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mysql_query

        }
        if (!$error) {
            // Записываем в базу
            mysql_query("UPDATE `users` SET `password` = '" . mysql_real_escape_string(md5(md5($newpass))) . "' WHERE `id` = '" . $user['id'] . "'");
            // Проверяем и записываем COOKIES
            if (isset($_COOKIE['cuid']) && isset($_COOKIE['cups'])) {
                setcookie('cups', md5($newpass), time() + 3600 * 24 * 365);
            }
            echo '<div class="gmenu"><p><b>' . $lng_pass['password_changed'] . '</b><br />' . '<a href="' . ($user_id == $user['id'] ? '../login.php' : 'profile.php?user=' . $user['id']) . '">' . $lng['continue'] . '</a></p>';
            if ($autologin) {
                // Показываем ссылку на Автологин
                echo '<p>' . $lng_pass['autologin_link'] . ':<br />' . '<input type="text" value="' . $set['homeurl'] . '/login.php?id=' . $user['id'] . '&amp;p=' . $newpass . '" /></p>' . '<p>' . $lng_pass['autologin_warning'] . '</p>';
            }
            echo '</div>';
        } else {
            echo functions::display_error($error, '<a href="profile.php?act=password&amp;user=' . $user['id'] . '">' . $lng['repeat'] . '</a>');
        }
        break;
    default:
        /*
        -----------------------------------------------------------------
        Форма смены пароля
        -----------------------------------------------------------------
        */
        echo '<div class="phdr"><b>' . $lng_pass['change_password'] . ':</b> ' . $user['name'] . '</div>';
        echo '<form action="profile.php?act=password&amp;mod=change&amp;user=' . $user['id'] . '" method="post">';
        if ($user['id'] == $user_id) {
            echo '<div class="menu"><p>' . $lng_pass['input_old_password'] . ':<br /><input type="password" name="oldpass" /></p></div>';
        }
        echo '<div class="gmenu"><p>' . $lng_pass['input_new_password'] . ':<br />' . '<input type="password" name="newpass" /><br />' . $lng_pass['repeat_password'] . ':<br />' . '<input type="password" name="newconf" /></p>' . '<p><input type="checkbox" value="1" name="autologin" />&#160;' . $lng_pass['show_autologin'] . '</p><p><input type="submit" value="' . $lng['save'] . '" name="submit" />' . '</p></div></form>' . '<div class="phdr"><small>' . $lng_pass['password_change_help'] . '</small></div>' . '<p><a href="profile.php?user=' . $user['id'] . '">' . $lng['profile'] . '</a></p>';
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:password.php

示例2: mysql_query

 echo '<div class="phdr"><a href="index.php?act=ipban"><b>' . $lng['ip_ban'] . '</b></a> | ' . $lng['ban_details'] . '</div>';
 if ($id) {
     // Поиск адреса по ссылке (ID)
     $req = mysql_query("SELECT * FROM `cms_ban_ip` WHERE `id` = '{$id}'");
     $get_ip = '';
 } elseif (isset($_POST['ip'])) {
     // Поиск адреса по запросу из формы
     $get_ip = ip2long($_POST['ip']);
     if (!$get_ip) {
         echo functions::display_error($lng['error_address'], '<a href="index.php?act=ipban&amp;mod=new">' . $lng['back'] . '</a>');
         require_once '../incfiles/end.php';
         exit;
     }
     $req = mysql_query("SELECT * FROM `cms_ban_ip` WHERE '{$get_ip}' BETWEEN `ip1` AND `ip2` LIMIT 1");
 } else {
     echo functions::display_error($lng['error_address'], '<a href="index.php?act=ipban&amp;mod=new">' . $lng['back'] . '</a>');
     require_once '../incfiles/end.php';
     exit;
 }
 if (!mysql_num_rows($req)) {
     echo '<div class="menu"><p>' . $lng['ip_search_notfound'] . '</p></div>';
     echo '<div class="phdr"><a href="index.php?act=ipban">' . $lng['back'] . '</a></div>';
     require_once '../incfiles/end.php';
     exit;
 } else {
     $res = mysql_fetch_array($req);
     $get_ip = $res['ip1'] == $res['ip2'] ? '<b>' . long2ip($res['ip1']) . '</b>' : '[<b>' . long2ip($res['ip1']) . '</b>] - [<b>' . long2ip($res['ip2']) . '</b>]';
     echo '<div class="rmenu"><p>' . $get_ip . '</p></div>';
     echo '<div class="menu"><p><h3>' . $lng['ban_type'] . '</h3>&nbsp;';
     switch ($res['ban_type']) {
         case 2:
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:ipban.php

示例3: array

    -----------------------------------------------------------------
    Параметры комментариев
    -----------------------------------------------------------------
    */
    $arg = array('comments_table' => 'cms_album_comments', 'object_table' => 'cms_album_files', 'script' => 'album.php?act=comments', 'sub_id_name' => 'img', 'sub_id' => $img, 'owner' => $owner['id'], 'owner_delete' => true, 'owner_reply' => true, 'owner_edit' => false, 'title' => $lng['comments'], 'context_top' => $context_top, 'context_bottom' => '');
    /*
    -----------------------------------------------------------------
    Ставим метку прочтения
    -----------------------------------------------------------------
    */
    if (core::$user_id == $user['id'] && $res_obj['unread_comments']) {
        mysql_query("UPDATE `cms_album_files` SET `unread_comments` = '0' WHERE `id` = '{$img}' LIMIT 1");
    }
    /*
    -----------------------------------------------------------------
    Показываем комментарии
    -----------------------------------------------------------------
    */
    require '../incfiles/head.php';
    $comm = new comments($arg);
    /*
    -----------------------------------------------------------------
    Обрабатываем метки непрочитанных комментариев
    -----------------------------------------------------------------
    */
    if ($comm->added && core::$user_id != $owner['id']) {
        mysql_query("UPDATE `cms_album_files` SET `unread_comments` = '1' WHERE `id` = '{$img}' LIMIT 1");
    }
} else {
    echo functions::display_error($lng['error_wrong_data']);
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:comments.php

示例4: mysql_fetch_assoc

    $topic = mysql_fetch_assoc($req);
    $req = mysql_query("SELECT `forum`.*, `users`.`id`\n        FROM `forum` LEFT JOIN `users` ON `forum`.`user_id` = `users`.`id`\n        WHERE `forum`.`refid`='{$id}' AND `users`.`rights` < 6 AND `users`.`rights` != 3 GROUP BY `forum`.`from` ORDER BY `forum`.`from`");
    $total = mysql_num_rows($req);
    echo '<div class="phdr"><a href="index.php?id=' . $id . '&amp;start=' . $start . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['curators'] . '</div>' . '<div class="bmenu">' . $res['text'] . '</div>';
    $curators = array();
    $users = !empty($topic['curators']) ? unserialize($topic['curators']) : array();
    if (isset($_POST['submit'])) {
        $users = isset($_POST['users']) ? $_POST['users'] : array();
        if (!is_array($users)) {
            $users = array();
        }
    }
    if ($total > 0) {
        echo '<form action="index.php?act=curators&amp;id=' . $id . '&amp;start=' . $start . '" method="post">';
        $i = 0;
        while ($res = mysql_fetch_array($req)) {
            $checked = array_key_exists($res['user_id'], $users) ? true : false;
            if ($checked) {
                $curators[$res['user_id']] = $res['from'];
            }
            echo ($i++ % 2 ? '<div class="list2">' : '<div class="list1">') . '<input type="checkbox" name="users[' . $res['user_id'] . ']" value="' . $res['from'] . '"' . ($checked ? ' checked="checked"' : '') . '/>&#160;' . '<a href="../users/profile.php?user=' . $res['user_id'] . '">' . $res['from'] . '</a></div>';
        }
        echo '<div class="gmenu"><input type="submit" value="' . $lng_forum['assign'] . '" name="submit" /></div></form>';
        if (isset($_POST['submit'])) {
            mysql_query("UPDATE `forum` SET `curators`='" . mysql_real_escape_string(serialize($curators)) . "' WHERE `id` = '{$id}'");
        }
    } else {
        echo functions::display_error($lng['list_empty']);
    }
    echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>' . '<p><a href="index.php?id=' . $id . '&amp;start=' . $start . '">' . $lng['back'] . '</a></p>';
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:curators.php

示例5: elseif

    // Доступ через пароль
    if (isset($_POST['password'])) {
        if ($album['password'] == trim($_POST['password'])) {
            $_SESSION['ap'] = $album['password'];
        } else {
            echo functions::display_error($lng['error_wrong_password']);
        }
    }
    if (!isset($_SESSION['ap']) || $_SESSION['ap'] != $album['password']) {
        echo '<form action="album.php?act=show&amp;al=' . $al . '&amp;user=' . $user['id'] . '" method="post"><div class="menu"><p>' . $lng_profile['album_password'] . '<br />' . '<input type="text" name="password"/></p>' . '<p><input type="submit" name="submit" value="' . $lng['login'] . '"/></p>' . '</div></form>' . '<div class="phdr"><a href="album.php?act=list&amp;user=' . $user['id'] . '">' . $lng_profile['album_list'] . '</a></div>';
        require '../incfiles/end.php';
        exit;
    }
} elseif ($album['access'] == 3 && $user['id'] != $user_id && $rights < 6 && !functions::is_friend($user['id'])) {
    // Доступ только для друзей
    echo functions::display_error($lng_profile['friends_only'], '<a href="album.php?act=list&amp;user=' . $user['id'] . '">' . $lng_profile['album_list'] . '</a>');
    require '../incfiles/end.php';
    exit;
}
/*
-----------------------------------------------------------------
Просмотр альбома и фотографий
-----------------------------------------------------------------
*/
if ($view) {
    $kmess = 1;
    $start = isset($_REQUEST['page']) ? $page - 1 : mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_files` WHERE `album_id` = '{$al}' AND `id` > '{$img}'"), 0);
    // Обрабатываем ссылку для возврата
    if (empty($_SESSION['ref'])) {
        $_SESSION['ref'] = htmlspecialchars($_SERVER['HTTP_REFERER']);
    }
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:show.php

示例6: mysql_query

    $input = '<input type="hidden" name="t" value="' . $t . '"/>';
} else {
    $id = false;
    $sql = '';
    $lnk = '';
    $caption = '<b>' . $lng_forum['files_forum'] . '</b>';
    $input = '';
}
if ($c || $s || $t) {
    // Получаем имя нужной категории форума
    $req = mysql_query("SELECT `text` FROM `forum` WHERE `id` = '{$id}'");
    if (mysql_num_rows($req) > 0) {
        $res = mysql_fetch_array($req);
        $caption .= $res['text'];
    } else {
        echo functions::display_error($lng['error_wrong_data'], '<a href="index.php">' . $lng['to_forum'] . '</a>');
        require '../incfiles/end.php';
        exit;
    }
}
if ($do || isset($_GET['new'])) {
    /*
    -----------------------------------------------------------------
    Выводим список файлов нужного раздела
    -----------------------------------------------------------------
    */
    $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_files` WHERE " . (isset($_GET['new']) ? " `time` > '{$new}'" : " `filetype` = '{$do}'") . $sql), 0);
    if ($total > 0) {
        // Заголовок раздела
        echo '<div class="phdr">' . $caption . (isset($_GET['new']) ? '<br />' . $lng['new_files'] : '') . '</div>' . ($do ? '<div class="bmenu">' . $types[$do] . '</div>' : '');
        $req = mysql_query("SELECT `cms_forum_files`.*, `forum`.`user_id`, `forum`.`text`, `topicname`.`text` AS `topicname`\n            FROM `cms_forum_files`\n            LEFT JOIN `forum` ON `cms_forum_files`.`post` = `forum`.`id`\n            LEFT JOIN `forum` AS `topicname` ON `cms_forum_files`.`topic` = `topicname`.`id`\n            WHERE " . (isset($_GET['new']) ? " `cms_forum_files`.`time` > '{$new}'" : " `filetype` = '{$do}'") . ($rights >= 7 ? '' : " AND `del` != '1'") . $sql . "ORDER BY `time` DESC LIMIT {$start},{$kmess}");
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:files.php

示例7: array

    }
    return $size;
}
// Массив подключаемых функций
$mods = array('ignor', 'write', 'systems', 'deluser', 'load', 'files', 'input', 'output', 'delete', 'new');
//Проверка выбора функции
if ($act && ($key = array_search($act, $mods)) !== FALSE && file_exists('includes/' . $mods[$key] . '.php')) {
    require 'includes/' . $mods[$key] . '.php';
} else {
    $textl = $lng['mail'];
    require_once '../incfiles/head.php';
    echo '<div class="phdr"><b>' . $lng_mail['contacts'] . '</b></div>';
    if ($id) {
        $req = mysql_query("SELECT * FROM `users` WHERE `id` = '{$id}' LIMIT 1;");
        if (mysql_num_rows($req) == 0) {
            echo functions::display_error($lng['error_user_not_exist']);
            require_once "../incfiles/end.php";
            exit;
        }
        $res = mysql_fetch_assoc($req);
        if ($id == $user_id) {
            echo '<div class="rmenu">' . $lng_mail['impossible_add_contact'] . '</div>';
        } else {
            //Добавляем в заблокированные
            if (isset($_POST['submit'])) {
                $q = mysql_query("SELECT * FROM `cms_contact`\n\t\t\t\tWHERE `user_id`='" . $user_id . "' AND `from_id`='" . $id . "';");
                if (mysql_num_rows($q) == 0) {
                    mysql_query("INSERT INTO `cms_contact` SET\n\t\t\t\t\t`user_id` = '" . $user_id . "',\n\t\t\t\t\t`from_id` = '" . $id . "',\n\t\t\t\t\t`time` = '" . time() . "';");
                }
                echo '<div class="rmenu">' . $lng_mail['add_contact'] . '</div>';
            } else {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:index.php

示例8: mysql_query

     echo "";
     require_once '../incfiles/end.php';
     exit;
 }
 $req = mysql_query("SELECT `name` FROM `lib` WHERE `type` = 'bk' AND `id` = '" . $id . "' LIMIT 1");
 if (mysql_num_rows($req) != 1) {
     // если статья не существует, останавливаем скрипт
     echo '<p>ERROR<br/><a href="../index.php">Back</a></p>';
     require_once '../incfiles/end.php';
     exit;
 }
 // Проверка на флуд
 $flood = functions::antiflood();
 if ($flood) {
     require_once '../incfiles/head.php';
     echo functions::display_error($lng['error_flood'] . ' ' . $flood . ' ' . $lng['sec'], '<a href="?act=komm&amp;id=' . $id . '">' . $lng['back'] . '</a>');
     require_once '../incfiles/end.php';
     exit;
 }
 if (isset($_POST['submit'])) {
     if ($_POST['msg'] == "") {
         echo $lng['error_empty_message'] . "<br/><a href='index.php?act=komm&amp;id=" . $id . "'>" . $lng['back'] . "</a><br/>";
         require_once '../incfiles/end.php';
         exit;
     }
     $msg = functions::check($_POST['msg']);
     if ($_POST['msgtrans'] == 1) {
         $msg = functions::trans($msg);
     }
     $msg = mb_substr($msg, 0, 500);
     $agn = strtok($agn, ' ');
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:addkomm.php

示例9: defined

*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
$error = false;
if ($id) {
    /*
    -----------------------------------------------------------------
    Скачивание прикрепленного файла Форума
    -----------------------------------------------------------------
    */
    $req = mysql_query("SELECT * FROM `cms_forum_files` WHERE `id` = '{$id}'");
    if (mysql_num_rows($req)) {
        $res = mysql_fetch_array($req);
        if (file_exists('../files/forum/attach/' . $res['filename'])) {
            $dlcount = $res['dlcount'] + 1;
            mysql_query("UPDATE `cms_forum_files` SET  `dlcount` = '{$dlcount}' WHERE `id` = '{$id}'");
            header('location: ../files/forum/attach/' . $res['filename']);
        } else {
            $error = true;
        }
    } else {
        $error = true;
    }
    if ($error) {
        require '../incfiles/head.php';
        echo functions::display_error($lng['error_file_not_exist'], '<a href="index.php">' . $lng['to_forum'] . '</a>');
        require '../incfiles/end.php';
        exit;
    }
} else {
    header('location: index.php');
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:file.php

示例10: mysql_query

 }
 $req = mysql_query("SELECT * FROM `lib` WHERE `id` = '" . $id . "'");
 $ms = mysql_fetch_array($req);
 if (isset($_POST['submit'])) {
     switch ($ms['type']) {
         case "bk":
             ////////////////////////////////////////////////////////////
             // Сохраняем отредактированную статью                     //
             ////////////////////////////////////////////////////////////
             if (empty($_POST['name'])) {
                 echo functions::display_error($lng['error_empty_title'], '<a href="index.php?act=edit&amp;id=' . $id . '">' . $lng['repeat'] . '</a>');
                 require_once '../incfiles/end.php';
                 exit;
             }
             if (empty($_POST['text'])) {
                 echo functions::display_error($lng['error_empty_text'], '<a href="index.php?act=edit&amp;id=' . $id . '">' . $lng['repeat'] . '</a>');
                 require_once '../incfiles/end.php';
                 exit;
             }
             $text = trim($_POST['text']);
             $autor = isset($_POST['autor']) ? functions::check($_POST['autor']) : '';
             $count = isset($_POST['count']) ? abs(intval($_POST['count'])) : '0';
             if (!empty($_POST['anons'])) {
                 $anons = mb_substr(trim($_POST['anons']), 0, 100);
             } else {
                 $anons = mb_substr($text, 0, 100);
             }
             mysql_query("UPDATE `lib` SET\n                    `name` = '" . mysql_real_escape_string(mb_substr(trim($_POST['name']), 0, 100)) . "',\n                    `announce` = '" . mysql_real_escape_string($anons) . "',\n                    `text` = '" . mysql_real_escape_string($text) . "',\n                    `avtor` = '{$autor}',\n                    `count` = '{$count}'\n                    WHERE `id` = '{$id}'\n                ");
             header('location: index.php?id=' . $id);
             break;
         case "cat":
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:edit.php

示例11: vote_photo

*/
if (!$user_id) {
    require '../incfiles/head.php';
    echo functions::display_error($lng['access_guest_forbidden']);
    require '../incfiles/end.php';
    exit;
}
/*
-----------------------------------------------------------------
Получаем данные пользователя
-----------------------------------------------------------------
*/
$user = functions::get_user($user);
if (!$user) {
    require '../incfiles/head.php';
    echo functions::display_error($lng['user_does_not_exist']);
    require '../incfiles/end.php';
    exit;
}
/*
-----------------------------------------------------------------
Функция голосований за фотографии
-----------------------------------------------------------------
*/
function vote_photo($arg = null)
{
    global $lng, $datauser, $user_id, $ban;
    if ($arg) {
        $rating = $arg['vote_plus'] - $arg['vote_minus'];
        if ($rating > 0) {
            $color = 'C0FFC0';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:album.php

示例12: defined

////////////////////////////////////////////////////////////////////////////////
// JohnCMS core team:                                                         //
// Евгений Рябинин aka john77          john77@gazenwagen.com                  //
// Олег Касьянов aka AlkatraZ          alkatraz@gazenwagen.com                //
//                                                                            //
// Информацию о версиях смотрите в прилагаемом файле version.txt              //
////////////////////////////////////////////////////////////////////////////////
*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
require_once '../incfiles/head.php';
echo '<div class="phdr"><a href="index.php"><b>' . $lng['downloads'] . '</b></a> | ' . $lng['search'] . '</div>';
if (!empty($_GET['srh'])) {
    $srh = functions::check($_GET['srh']);
} else {
    if ($_POST['srh'] == "") {
        echo functions::display_error($lng_dl['search_string_empty'], '<a href="index.php">' . $lng['back'] . '</a>');
        require_once '../incfiles/end.php';
        exit;
    }
    $srh = functions::check($_POST['srh']);
}
if (!empty($_GET['srh'])) {
    $srh = functions::check($_GET['srh']);
}
$psk = mysql_query("select * from `download` where  type='file' ;");
if (empty($_GET['start'])) {
    $start = 0;
} else {
    $start = $_GET['start'];
}
while ($array = mysql_fetch_array($psk)) {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:search.php

示例13: mysql_query

        $us = mysql_query("SELECT `id`, `name` FROM `users` WHERE `id` = '{$res1['user_id']}'");
        if (mysql_num_rows($us)) {
            $rowuse = mysql_fetch_assoc($us);
            $name_use = $user_id ? '<a href="../users/profile.php?id=' . $rowuse['id'] . '">' . $rowuse['name'] . '</a>' : $rowuse['name'];
        } else {
            $name_use = $lng['guest'];
        }
        //
        mysql_query("UPDATE `animes` SET  `count` = (`count`+1) WHERE `id` = '{$id}'");
        echo '<div class="gmenu">
      Ditulis oleh: ' . $name_use . '<br />
      Dilihat: ' . $res1['count'] . ' kali <br />
      Pada: ' . date('d.m.o / H:i', $res1['time'] + $sdvigclock * 3600) . '<br />
      ' . ($res1['time'] > time() ? '<div class="func">Waktu tersisa untuk diperlihatkan: ' . timer($res1['time'] - time()) . '</div>' : '') . '
      <a href="index.php?act=comments&amp;id=' . $id . '">' . $lng['comments'] . '</a> (' . mysql_result(mysql_query("SELECT COUNT(*) FROM `animes_comments` WHERE `refid`='{$id}'"), 0) . ')
      </div>
      ' . ($rights >= 7 ? '<div class="menu"><div class="func">
      <a href="manage.php?act=newsedit&amp;id=' . $id . '">' . $lng['edit'] . '</a><br />
      <a href="manage.php?act=delnews&amp;id=' . $id . '">' . $lng['delete'] . '</a><br />
      </div></div>' : '') . '
      <div class="bmenu">Kategori: <a href="index.php?id=' . $res1['catid'] . '">' . htmlentities($res1['catname'], ENT_QUOTES, 'UTF-8') . '</a></div>';
    } else {
        $textl = 'Blogs';
        require_once '../incfiles/head.php';
        echo functions::display_error('Blogs tidak ada');
    }
} else {
    $textl = 'Blogs';
    require_once '../incfiles/head.php';
    echo functions::display_error('Blogs tidak dipilih');
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:komen.php

示例14: mysql_result

 if (!$mesto) {
     $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_ads` WHERE `mesto` = '" . $mesto . "' AND `type` = '" . $type . "'"), 0);
     if ($total != 0) {
         $error[] = $lng['links_place_occupied'];
     }
 }
 if ($color) {
     if (preg_match("/[^\\da-fA-F_]+/", $color)) {
         $error[] = $lng['error_wrong_symbols'];
     }
     if (strlen($color) < 6) {
         $error[] = $lng['error_color'];
     }
 }
 if ($error) {
     echo functions::display_error($error, '<a href="index.php?act=ads&amp;from=addlink">' . $lng['back'] . '</a>');
     require '../incfiles/end.php';
     exit;
 }
 if ($id) {
     // Обновляем ссылку после редактирования
     mysql_query("UPDATE `cms_ads` SET\n                    `type` = '{$type}',\n                    `view` = '{$view}',\n                    `link` = '{$link}',\n                    `name` = '{$name}',\n                    `color` = '{$color}',\n                    `count_link` = '{$count}',\n                    `day` = '{$day}',\n                    `layout` = '{$layout}',\n                    `bold` = '{$bold}',\n                    `show` = '{$show}',\n                    `italic` = '{$italic}',\n                    `underline` = '{$underline}'\n                    WHERE `id` = '{$id}'\n                ");
 } else {
     // Добавляем новую ссылку
     $req = mysql_query("SELECT `mesto` FROM `cms_ads` ORDER BY `mesto` DESC LIMIT 1");
     if (mysql_num_rows($req) > 0) {
         $res = mysql_fetch_array($req);
         $mesto = $res['mesto'] + 1;
     } else {
         $mesto = 1;
     }
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:ads.php

示例15: defined

 * @author      http://johncms.com/about
 */
defined('_IN_JOHNCMS') or die('Error: restricted access');
if ($user_id && !$ban['1'] && !$ban['10'] && ($set['mod_down_comm'] || $rights < 7)) {
    if ($_GET['id'] == "") {
        require_once "../incfiles/head.php";
        echo "Не выбран файл<br/><a href='?'>К категориям</a><br/>";
        require_once '../incfiles/end.php';
        exit;
    }
    if (isset($_POST['submit'])) {
        // Проверка на флуд
        $flood = functions::antiflood();
        if ($flood) {
            require_once '../incfiles/head.php';
            echo functions::display_error('Вы не можете так часто добавлять сообщения<br />Пожалуйста, подождите ' . $flood . ' сек.', '<a href="index.php?act=komm&amp;id=' . $id . '">Назад</a>');
            require_once '../incfiles/end.php';
            exit;
        }
        if ($_POST['msg'] == "") {
            require_once "../incfiles/head.php";
            echo "Вы не ввели сообщение!<br/><a href='?act=komm&amp;id=" . $id . "'>К комментариям</a><br/>";
            require_once '../incfiles/end.php';
            exit;
        }
        $msg = functions::check($_POST['msg']);
        if ($_POST[msgtrans] == 1) {
            $msg = functions::trans($msg);
        }
        $msg = mb_substr($msg, 0, 500);
        $agn = strtok($agn, ' ');
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:addkomm.php


注:本文中的functions::display_error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。