本文整理匯總了PHP中is_mod函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_mod函數的具體用法?PHP is_mod怎麽用?PHP is_mod使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_mod函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
function __construct($text, $title, $image = NULL, $handler = NULL)
{
$this->text = $text;
$this->title = $title;
if ($image == NULL) {
$image = Config::DIR_PATH . '/img/errors/default_error.png';
}
$this->image = $image;
if ($handler == NULL) {
$handler = function ($smarty) use($text, $title, $image) {
$smarty->assign('show_control', is_admin() || is_mod());
$smarty->assign('ib_name', Config::IB_NAME);
$smarty->assign('text', $text);
$smarty->assign('title', $title);
$smarty->assign('image', $image);
die($smarty->fetch('error.tpl'));
};
}
$this->handler = $handler;
}
示例2: foreach
}
// Delete relation.
foreach ($user_groups as $user_group) {
if (isset($_POST["delete_{$user_group['user']}_{$user_group['group']}"])) {
user_groups_delete($user_group['user'], $user_group['group']);
$reload_user_groups = true;
}
}
if ($reload_user_groups) {
$groups = groups_get_all();
$users = users_get_all();
$user_groups = user_groups_get_all();
}
// Generate html code of edit user groups page and display it.
$smarty->assign('show_control', is_admin() || is_mod());
$smarty->assign('boards', boards_get_all());
$smarty->assign('groups', $groups);
$smarty->assign('users', $users);
$smarty->assign('user_groups', $user_groups);
$smarty->display('edit_user_groups.tpl');
// Cleanup.
DataExchange::releaseResources();
Logging::close_log();
exit(0);
} catch (KotobaException $e) {
// Cleanup.
DataExchange::releaseResources();
Logging::close_log();
display_exception_page($smarty, $e, is_admin() || is_mod());
exit(1);
}
示例3: addslashes
<?php
/**
*
*
* @package AVE.cms
* @subpackage module_Forums
* @filesource
*/
if (!defined("BASE_DIR") || !is_numeric(UGROUP)) {
exit;
}
global $AVE_DB;
$extra = !is_mod($_REQUEST['toid']) && UGROUP != 1 ? " AND opened='1'" : "";
$sql = $AVE_DB->Query("SELECT * FROM " . PREFIX . "_modul_forum_post WHERE topic_id = '" . addslashes($_REQUEST['toid']) . "' {$extra} order by id DESC limit 5");
while ($row = $sql->FetchRow()) {
$row->user = $this->fetchusername($row->uid);
$row->message = $row->use_bbcode == 1 ? $this->kcodes($row->message) : nl2br($row->message);
if ($row->use_smilies == 1 && SMILIES == 1) {
$row->message = $this->replaceWithSmileys($row->message);
}
$row->message = $this->badwordreplace($row->message);
array_push($items, $row);
}
示例4: is_admin
$smarty->assign('show_control', is_admin() || is_mod());
$smarty->assign('ib_name', Config::IB_NAME);
$smarty->assign('text', sprintf($text, $board_id));
$smarty->assign('title', $title);
$smarty->assign('image', $image);
die($smarty->fetch('error.tpl'));
});
$ERRORS['ACL_NO_RULES'] = new Error('В списке контроля доступа нет ни одного правила.', 'Нет правил.');
$ERRORS['KOTOBA_INTVAL'] = new Error('Объект не может быть преобразован к целому числу. См. ' . 'описание фукнции intval() в документации PHP.', 'Преобразование к целому числу.');
$ERRORS['MAX_PAGE'] = new Error('Номер страницы %s слишком большой. Такой страницы не ' . 'существует.', 'Номер страницы.', Config::DIR_PATH . '/img/errors/default_error.png', function ($smarty, $page, $text, $title, $image) {
$smarty->assign('show_control', is_admin() || is_mod());
$smarty->assign('ib_name', Config::IB_NAME);
$smarty->assign('text', sprintf($text, $page));
$smarty->assign('title', $title);
$smarty->assign('image', $image);
die($smarty->fetch('error.tpl'));
});
$ERRORS['ACL_RULE_EXCESS'] = new Error('Доска, нить и сообщение определяются однозначно своими ' . 'идентификаторами.', 'Получена избыточная информация.');
$ERRORS['ACL_RULE_CONFLICT'] = new Error('Разрешение редактирования не может быть установлено, если нет ' . 'разрешения просмотра. Разрешение модерирования не может ' . 'быть установлено, если не установлены другие разрешения.', 'Ошибка разрешений в правиле.');
$ERRORS['CAPTCHA'] = new Error('Введённый вами код подтверждения "%s" не совпадает с "%s".', 'Код подтвержения не верен.', Config::DIR_PATH . '/img/errors/default_error.png', function ($smarty, $ccode, $exp_ccode, $text, $title, $image) {
$smarty->assign('show_control', is_admin() || is_mod());
$smarty->assign('ib_name', Config::IB_NAME);
$smarty->assign('text', sprintf($text, $ccode, $exp_ccode));
$smarty->assign('title', $title);
$smarty->assign('image', $image);
die($smarty->fetch('error.tpl'));
});
$ERRORS['REMOTE_ADDR'] = new Error('Адрес клиента не является IP адресом.', 'Неверный адрес клиента.');
$ERRORS['SPAM_DETECTED'] = new Error('Ваше сообщение не прошло спам фильтр.', 'Обнаруже спам.');
$ERRORS['THREAD_ARCHIVED'] = new Error('Ответ в заархивированную нить невозможен.', 'Нить заархивирована.');
$ERRORS['THREAD_CLOSED'] = new Error('Ответ в закрытую нить невозможен.', 'Нить закрыта.');
示例5: addModerator
function addModerator($id, $db = "")
{
if ($db == "") {
$db = $GLOBALS['db'];
}
$i = 0;
$sql = "SELECT * FROM `mods`";
if (!($result = $db->query($sql))) {
die("Database error! (addModerator)");
}
while ($row = $result->fetch_assoc()) {
$i = 1;
}
if (is_mod(mod_id()) == false) {
if ($i == 0) {
$sql = "INSERT INTO `admins` (`mod_id`, `disabled`) VALUES ('" . $id . "', '0')";
$GLOBALS['db']->query($sql);
}
$sql = "INSERT INTO `mods` (`mod_id`, `regdate`) VALUES ('" . $id . "', '" . time() . "')";
$GLOBALS['db']->query($sql);
}
}
示例6: strip_tags
$sname = strip_tags($navigation) . " - " . stripslashes(htmlspecialchars($topic->title));
// navigation erzeugen
$navigation = $this->getNavigation((int) $_GET['toid'], "topic");
$tmp_navi = $navigation . $mod['config_vars']['FORUMS_FORUM_SEP'] . $topic->title;
$AVE_Template->assign("navigation", $tmp_navi);
$AVE_Template->assign("treeview", @explode($mod['config_vars']['FORUMS_FORUM_SEP'], $tmp_navi));
// ende navigation
if ($limit < $num) {
$page_nav = " <a class=\"page_navigation\" href=\"index.php?module=forums&show=showtopic&toid=" . $_GET["toid"] . "&high=" . @$_GET['high'] . "&pp=" . $limit . "&page={s}&fid=" . $ForumId . "\">{t}</a> ";
$page_nav = get_pagination($num_pages, 'page', $page_nav);
$AVE_Template->assign('pages', $page_nav);
}
if (UID == 1) {
array_fill(0, sizeof($permissions), 1);
}
if (is_mod(@$_GET['fid'])) {
$AVE_Template->assign('ismod', 1);
}
$categories = array();
$this->getCategories(0, $categories, "");
$this->Cpengine_Board_SetTopicRead(addslashes($_GET['toid']));
$AVE_Template->assign("permissions", $permissions);
$AVE_Template->assign("categories_dropdown", $categories);
$AVE_Template->assign("navigation", $navigation);
$AVE_Template->assign("next_site", $num_pages);
$AVE_Template->assign("currUser", $current_user);
$AVE_Template->assign("printlink", $printlink);
$AVE_Template->assign("topic", $topic);
$AVE_Template->assign("postings", $all_posts);
$AVE_Template->assign("referer", @$_SERVER['HTTP_REFERER']);
$AVE_Template->register_function('getonlinestatus', 'getonlinestatus');
示例7: define
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head>
<title>Storybot Mod</title>
<link rel="stylesheet" type="text/css" href="media/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
</head>
<body onload="document.getElementById('refresh').style.display = 'block'; document.getElementById('loading').style.display = 'none';">
<center>
<a href='index.php'><img src="media/logo.png" /></a>
<br />
<?php
define("IN_STORYBOT", 1);
require_once "config/config.php";
if (!is_mod(mod_id())) {
die("Registration is required! Please visit <a href='index.php'>this link</a>.");
}
$admin = is_admin(mod_id());
$sid = oldestImage();
if ($sid != "") {
echo displayImage($sid);
echo "<br />";
echo "<a href='action.php?type=0&sid=" . $sid . "' class='accept'>ACCEPT</a>";
echo "<a href='action.php?type=1&sid=" . $sid . "' class='reject'>REJECT</a>";
echo "<a href='action.php?type=2&sid=" . $sid . "' class='report'>REPORT</a>";
} else {
echo "<br /><div id='loading'>Looking for new snaps...</div><div id='refresh' style='display: none;'>Refresh this page now and there may be more images. Thanks for your hard work!</div>";
}
if ($admin) {
echo "<br /><br /><br /><table><tr><td><a href='admin.php' class='settings'>Admin panel</a></td>";
if ($sid != "") {
示例8: array
}
$search_in_forums = "(f.id = " . @implode(' OR f.id = ', $allowed_forums) . ")";
}
// suche nach dem datum
$search_by_date = "(1)";
$date_comparator = @$_GET['b4after'] == 0 ? ' <= ' : ' >= ';
// Tage
$divisor = 60 * 60 * 24;
//$search_by_date = (@$_GET['date'] == 0) ? "(1)" : "((UNIX_TIMESTAMP(NOW()) / $divisor - (UNIX_TIMESTAMP(t.datum) / $divisor)) $date_comparator " . $_GET['date'] . ")";
$search_by_date = @$_GET['date'] == 0 ? "(1)" : "(NOW() - INTERVAL " . $_GET['date'] . " DAY {$date_comparator} t.datum)";
$query = "SELECT DISTINCT\r\n\t\tt.id,\r\n\t\tt.forum_id,\r\n\t\tt.title,\r\n\t\tt.replies,\r\n\t\tt.views,\r\n\t\tt.type,\r\n\t\tt.datum,\r\n\t\tt.status,\r\n\t\tt.posticon,\r\n\t\tt.uid,\r\n\t\tr.rating,\r\n\t\tf.status AS f_status,\r\n\t\tf.title AS f_title,\r\n\t\tu.uname AS autor,\r\n\t\tf.title AS forum,\r\n\t\tt.opened,\r\n\t\tp.opened\r\n\tFROM\r\n\t\t" . PREFIX . "_modul_forum_topic AS t,\r\n\t\t" . PREFIX . "_modul_forum_post AS p,\r\n\t\t" . PREFIX . "_modul_forum_forum AS f,\r\n\t\t" . PREFIX . "_modul_forum_userprofile AS u,\r\n\t\t" . PREFIX . "_modul_forum_rating AS r\r\n\tWHERE\r\n\t\t(" . $pattern . ") AND\r\n\t\t(" . $type . ") AND\r\n\t\t(t.id = p.topic_id AND t.forum_id = f.id AND u.uid = t.uid AND r.topic_id = t.id) AND\r\n\t\tf.active = 1 AND\r\n\t\t{$search_by_user} AND\r\n\t\t{$search_in_forums} AND\r\n\t\t{$search_by_date}\r\n\tORDER BY\r\n\t\tt.type DESC,\r\n\t\t" . $order_by . " " . $order;
$result = $AVE_DB->Query($query);
$matches = array();
while ($hit = $result->FetchAssocArray()) {
// freizuschaltende beitrage nicht beruecksichtigen!
if (is_mod($hit['forum_id']) || $hit['opened'] == 1) {
$q_forum = "SELECT id, status FROM " . PREFIX . "_modul_forum_forum WHERE id = '" . $hit['forum_id'] . "'";
$r_forum = $AVE_DB->Query($q_forum);
$forum = $r_forum->FetchRow();
$rating_array = @explode(",", $hit['rating']);
$hit['rating'] = (int) (array_sum($rating_array) / count($rating_array));
$hit['link'] = "index.php?module=forums&show=showtopic&toid=" . $hit['id'];
if ($hit['status'] == FORUM_STATUS_MOVED) {
$hit['statusicon'] = $this->getIcon("thread_moved.gif", "moved");
} else {
if (UGROUP == 2 || $hit['f_status'] == FORUM_STATUS_CLOSED) {
// nicht eingeloggt oder forum geschlossen
$hit['statusicon'] = $this->getIcon("thread_lock.gif", "lock");
} else {
$this->setTopicIcon($hit, $forum);
}
示例9: date
$AVE_DB->Query("\r\n\t\t\tUPDATE " . PREFIX . "_modul_forum_post\r\n\t\t\tSET\r\n\t\t\t\t" . $attachments . "\r\n\t\t\t\ttitle = '" . $title . "',\r\n\t\t\t\tmessage = '" . $message . " \n[size=2]Отредактировано: " . date("d.m.Y, H:i:s") . "[/size]',\r\n\t\t\t\tuse_bbcode = '" . $disable_bbcode . "',\r\n\t\t\t\tuse_smilies = '" . $disable_smilies . "',\r\n\t\t\t\tuse_sig = '" . $use_sig . "'\r\n\t\t\tWHERE\r\n\t\t\t\tid = '" . $_POST['p_id'] . "'\r\n\t\t");
// u.U. das Thema aendern
$topic = $AVE_DB->Query("\r\n\t\t\tSELECT\r\n\t\t\t\tt.uid,\r\n\t\t\t\tt.id\r\n\t\t\tFROM\r\n\t\t\t\t" . PREFIX . "_modul_forum_topic AS t,\r\n\t\t\t\t" . PREFIX . "_modul_forum_post AS p\r\n\t\t\tWHERE\r\n\t\t\t\tp.id = " . $_POST['p_id'] . " AND\r\n\t\t\t\tt.id = p.topic_id\r\n\t\t")->FetchRow();
// nur der themenstarter (admin und moderator auch) darf das thema aendern
if ($topic->uid == UID || UGROUP == 1 || $is_moderator) {
if ($_POST['topic'] != '') {
$title = !empty($_POST['topic']) ? addslashes($_POST['topic']) : "";
$result = $AVE_DB->Query("\r\n\t\t\t\t\tUPDATE\r\n\t\t\t\t\t\t" . PREFIX . "_modul_forum_topic\r\n\t\t\t\t\tSET\r\n\t\t\t\t\t\ttitle = '" . $title . "',\r\n\t\t\t\t\t\tposticon = '" . $_POST['posticon'] . "'\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tid = '" . $topic->id . "'\r\n\t\t\t\t");
}
}
// neu einfuegen
} else {
// muessen beitraege moderiert werden?
$row = $AVE_DB->Query("\r\n\t\t\tSELECT\r\n\t\t\t\tmoderated_posts,\r\n\t\t\t\tpost_emails\r\n\t\t\tFROM " . PREFIX . "_modul_forum_forum\r\n\t\t\tWHERE id = '" . $forum_id . "'\r\n\t\t")->FetchRow();
$opened = $row->moderated_posts == 1 ? 2 : 1;
if (is_mod($forum_id)) {
$opened = 1;
}
// aktionen
if (@$permissions[FORUM_PERMISSIONS_CAN_CLOSE_TOPIC] == 1) {
if ($_REQUEST['subaction'] == "close") {
$AVE_DB->Query("\r\n\t\t\t\t\tUPDATE " . PREFIX . "_modul_forum_topic\r\n\t\t\t\t\tSET status = '1'\r\n\t\t\t\t\tWHERE id = '" . $topic_id . "'\r\n\t\t\t\t");
}
}
if (@$permissions[FORUM_PERMISSIONS_CAN_CHANGE_TOPICTYPE] == 1) {
if ($_REQUEST['subaction'] == "announce") {
$announce = "type='100'";
$AVE_DB->Query("\r\n\t\t\t\t\tUPDATE " . PREFIX . "_modul_forum_topic\r\n\t\t\t\t\tSET type = '100'\r\n\t\t\t\t\tWHERE id = '" . $topic_id . "'\r\n\t\t\t\t");
}
if ($_REQUEST['subaction'] == "attention") {
$AVE_DB->Query("\r\n\t\t\t\t\tUPDATE " . PREFIX . "_modul_forum_topic\r\n\t\t\t\t\tSET type = '1'\r\n\t\t\t\t\tWHERE id = '" . $topic_id . "'\r\n\t\t\t\t");
示例10: isset
$q_topic_count = "\r\n\t\tSELECT DISTINCT\r\n\t\t\tt.id,\r\n\t\t\tt.title,\r\n\t\t\tt.status,\r\n\t\t\tt.datum,\r\n\t\t\tt.type,\r\n\t\t\tt.views,\r\n\t\t\tt.posticon,\r\n\t\t\tt.uid,\r\n\t\t\tu.uid,\r\n\t\t\tu.uname,\r\n\t\t\tt.replies,\r\n\t\t\tt.last_post\r\n\t\tFROM\r\n\t\t\t" . PREFIX . "_modul_forum_topic AS t,\r\n\t\t\t" . PREFIX . "_modul_forum_userprofile AS u,\r\n\t\t\t" . PREFIX . "_modul_forum_post AS p\r\n\t\tWHERE\r\n\t\t\t(t.forum_id = '" . $fid . "' AND u.uid = t.uid)\r\n\t\tAND\r\n\t\t\tp.topic_id = t.id\r\n\t\t" . $q_topic_count_extra . "\r\n\t\t" . $where_time_stat . "\r\n\t";
// der user darf nur eigene topics sehen
if ($forum_obj->permissions[FORUM_PERMISSION_CAN_SEE_TOPIC] == 0) {
$only_own_topics = " AND t.uid = '" . UID . "'";
}
$q_topic_count .= $only_own_topics;
$q_topic_count .= " AND t.opened = '1'";
$r_topic_count = $AVE_DB->Query($q_topic_count);
$num = $r_topic_count->NumRows();
$limit = isset($_REQUEST['pp']) && is_numeric($_REQUEST['pp']) && $_REQUEST['pp'] > 0 ? $_REQUEST['pp'] : 15;
if (!isset($page)) {
$page = 1;
}
$num_pages = ceil($num / $limit);
$a = get_current_page() * $limit - $limit;
if (!is_mod($fid)) {
$topic_query_extra .= " AND t.opened = 1 ";
}
$order_by = str_replace('last_post_int', 'last_post', $order_by);
$topic_query = "\r\n\t\tSELECT DISTINCT\r\n\t\t\tt.id,\r\n\t\t\tt.title,\r\n\t\t\tt.status,\r\n\t\t\tt.datum,\r\n\t\t\tt.type,\r\n\t\t\tt.views,\r\n\t\t\tt.posticon,\r\n\t\t\tt.uid,\r\n\t\t\tu.uid,\r\n\t\t\tu.uname,\r\n\t\t\tu.reg_time,\r\n\t\t\tt.last_post,\r\n\t\t\tt.opened,\r\n\t\t\tr.rating\r\n\t\tFROM\r\n\t\t\t" . PREFIX . "_modul_forum_topic AS t,\r\n\t\t\t" . PREFIX . "_modul_forum_userprofile AS u,\r\n\t\t\t" . PREFIX . "_modul_forum_rating AS r,\r\n\t\t\t" . PREFIX . "_modul_forum_post AS p\r\n\t\tWHERE\r\n\t\t\t(t.forum_id = '" . $fid . "' AND u.uid = t.uid AND r.topic_id = t.id)\r\n\t\tAND\r\n\t\t\tp.topic_id = t.id\r\n\t\t" . $topic_query_extra . "\r\n\t\t" . $where_time_stat . "\r\n\t\t" . $only_own_topics . "\r\n\t\tORDER BY\r\n\t\t\ttype DESC, {$order_by} {$order}\r\n\t\tLIMIT " . $a . "," . $limit . "\r\n\t";
$order = $order == "DESC" ? "ASC" : "DESC";
$topic_result = $AVE_DB->Query($topic_query);
$topic_array = array();
// topic liste durchgehen.
// fuer jeden topic einen link zusammenstellen, damit im template der user
// keine fehler machen kann.
// fuer jeden topic den autor ermitteln und als einen link
// zum userprofil im topic ablegen.
while ($topic = $topic_result->FetchAssocArray()) {
$topic['link'] = "index.php?module=forums&show=showtopic&toid=" . $topic['id'] . "&fid=" . $_REQUEST['fid'] . "";
$topic['closelink'] = "index.php?module=forums&show=closetopic&fid=" . $fid . "&toid=" . $topic['id'];
示例11: implode
//=======================================================
// Anzahl der Themen und Beitrдge ermitteln
//=======================================================
$pcount = 0;
//=======================================================
// kann die topics anderer sehen?
//=======================================================
$show_only_own_topics = "";
if ($permissions[FORUM_PERMISSION_CAN_SEE_TOPIC] == 0) {
$show_only_own_topics = " AND uid = " . UID;
}
//=======================================================
// wenn user nicht mod dieses forum ist und kein admin ist,
// nicht freigeschaltete themen verbergen
//=======================================================
if (!is_mod($forum['id'])) {
$q_tcount_extra .= " AND opened = 1 ";
}
// $r_tcount = $this->getNumberOfThreadsQuery($forum["id"]);
// $forumIds = $this->getForumIds($forumId);
$r_tcount = $AVE_DB->Query("\r\n\t\t\t\t\t\t\tSELECT id\r\n\t\t\t\t\t\t\tFROM " . PREFIX . "_modul_forum_topic\r\n\t\t\t\t\t\t\tWHERE (forum_id = '" . implode("' OR forum_id = '", $this->getForumIds($forum["id"])) . "')\r\n\t\t\t\t\t\t\t" . $q_tcount_extra . "\r\n\t\t\t\t\t\t\t" . $show_only_own_topics . "\r\n\t\t\t\t\t\t");
$forum['tcount'] = $r_tcount->NumRows();
$forum['tcount'] = $this->num_format($forum['tcount']);
// $ids = "";
$Topic_IDs = array();
while ($tid = $r_tcount->FetchRow()) {
$Topic_IDs[] = $tid->id;
// if ($ids == "") {
// $ids .= $tid->id;
// } else {
// $ids .= " OR topic_id = " . $tid->id;
示例12: define
<?php
define("IN_STORYBOT", 1);
require_once "config/config.php";
if (is_mod(mod_id())) {
header("Location: mod.php");
} else {
echo '<html>
<head>
<title>Storybot - ' . $config['username'] . '</title>
</head>
<body>
<img src="http://b.thumbs.redditmedia.com/in0eLkjDwflTCR6bw5NxYtLb2OhCtzNhZJrkgA-g30M.png" /><hr />
<form action="register.php" method="GET">
Click to register and be a mod! By registering, you agree that a md5 hash of your IP will be logged for identification purposes. You cannot "unregister" (accounts are permanent).<br /><br />If you abuse this moderation privilege, you can and will be banned.<br /><br /><input type="submit" value="Register">
</form>
</body>
</html>';
}