本文整理匯總了PHP中is_privilegied函數的典型用法代碼示例。如果您正苦於以下問題:PHP is_privilegied函數的具體用法?PHP is_privilegied怎麽用?PHP is_privilegied使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了is_privilegied函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: viewPhoto
function viewPhoto($userid, $imgid)
{
global $hp_url;
$query = 'SELECT title, uppladdat, status FROM photoalbums ';
$query .= 'WHERE userid = "' . $userid . '" AND imgid = "' . $imgid . '" LIMIT 1';
$result = mysql_query($query) or die(mysql_error());
$data = mysql_fetch_assoc($result) or die(mysql_error());
echo '<p class="title" style="margin: 5px;">' . $data['title'];
if ($userid == $_SESSION['login']['id']) {
echo ' (<a href="' . $_SERVER['PHP_SELF'] . '?action=delete&imgid=' . $imgid . '">Ta bort</a>)';
}
echo '</p>';
echo '<table style="width:100%"><tr><td>';
if ($imgid != '0') {
echo '<a href="' . $_SERVER['PHP_SELF'] . '?action=view&userid=' . $userid . '&imgid=' . ($imgid - 1) . '">';
echo '« Föregående';
echo '</a>';
}
echo '</td><td align="right">';
if ($imgid != '9') {
echo '<a href="' . $_SERVER['PHP_SELF'] . '?action=view&userid=' . $userid . '&imgid=' . ($imgid + 1) . '">';
echo 'Nästa »';
echo '</a>';
}
echo '</td></tr></table>';
if (is_privilegied('remove_photo')) {
if ($data['uppladdat'] == '0000-00-00 00:00:00') {
$uppladdat = '<i>Innan den 26:e juni 2005</i>';
} else {
$uppladdat = $data['uppladdat'];
}
echo '(admininfo) Denna bild laddades upp: ' . $uppladdat . '<br /><br />';
}
echo '<a href="javascript: window.close();">';
if ($data['status'] == '1') {
echo '<img src="' . IMAGE_URL . 'images/photoalbum/full/' . $userid . '_' . $imgid . '.jpg" style="border: 1px solid #737373;" />';
} else {
echo 'Ingen bild<br />';
}
echo '</a>';
}
示例2: userblock_checkblock
function userblock_checkblock($object_id)
{
// PREVENT SQL QUERY ERROR DUE TO MISSING OBJECT ID
if (strlen($object_id) == 0) {
return false;
} elseif (!is_numeric($object_id)) {
return false;
} elseif (!login_checklogin()) {
return false;
}
$sql = 'SELECT * FROM userblocks WHERE ownerid = ' . $object_id . ' AND blockedid = ' . $_SESSION['login']['id'] . ' LIMIT 1';
$result = mysql_query($sql) or report_sql_error($sql, __FILE__, __LINE__);
$data = mysql_fetch_assoc($result);
if ($data['blockedid'] === $_SESSION['login']['id'] && !is_privilegied('igotgodmode') && !is_privilegied('ip_ban_admin')) {
return true;
} elseif ($data['blockedid'] === $_SESSION['login']['id'] && is_privilegied('igotgodmode') && !is_privilegied('ip_ban_admin')) {
echo '<p class="error"><strong>Den här användaren har blockerat dig!</strong><br />' . "\n";
echo 'Men eftersom du är 1337 h4xx0r så kan du se personens presentation i alla fall :)</p>' . "\n";
} else {
return false;
}
}
示例3: url
<link rel="icon" href="http://images.hamsterpaj.net/favicon.png" type="image/x-icon" />
<link rel="shortcut icon" href="http://images.hamsterpaj.net/favicon.png" type="image/x-icon" />
<style type="text/css">
@import url('/stylesheets/avatar.css');
@import url('/stylesheets/shared.css');
</style>
<script type="text/javascript" language="javascript" src="/javascripts/avatar.js"></script>
</head>
<body>
<?php
$query = 'SELECT user_status FROM userinfo WHERE userid = "' . $_GET['id'] . '" LIMIT 1';
$result = mysql_query($query);
$data = mysql_fetch_assoc($result);
echo '<div id="user_status"><p>' . $data['user_status'] . '</p></div>' . "\n";
$img_path = IMAGE_PATH . 'images/users/full/' . $_GET['id'] . '.jpg';
echo '<div id="passepartout"><img src="' . IMAGE_URL . 'images/users/full/' . $_GET['id'] . '.jpg?cache_prevention=' . filemtime($img_path) . '" id="user_avatar" /></div>';
echo '<div id="controls">' . "\n";
echo '<input type="hidden" id="user_id" value="' . $_GET['id'] . '" />' . "\n";
echo '<button class="button_100" id="presentation">Presentation</button>' . "\n";
echo '<button class="button_80" id="guestbook">Gästbok</button>' . "\n";
if (is_privilegied('avatar_admin')) {
echo '<button class="button_100" id="remove_avatar">Ta bort bild</button>' . "\n";
}
echo '</div>' . "\n";
echo $string_to_remove;
?>
</body>
</html>
示例4: christmas_avatar_admin_menu_list
<?php
require '../include/core/common.php';
require PATHS_INCLUDE . 'libraries/christmas_avatars_polls.lib.php';
if (!is_privilegied('christmas_avatar_poll')) {
header('Location: /index.php');
exit;
}
// UI-options
$ui_options['title'] = 'Julavataromröstning - Administration - Hamsterpaj.net';
$ui_options['stylesheets'][] = 'rounded_corners_tabs.css';
$ui_options['stylesheets'][] = 'rounded_corners.css';
$ui_options['javascripts'][] = 'christmas_avatar_admin.js';
ui_top($ui_options);
$action = isset($_GET['action']) ? $_GET['action'] : 'home';
echo christmas_avatar_admin_menu_list($action == 'remove_poll' ? 'edit' : $action);
switch ($action) {
case 'home':
default:
//show the current polls
echo christmas_avatar_current_polls_list(array('admin-links' => true));
break;
case 'add':
echo christmas_avatar_admin_add();
break;
case 'edit':
if (isset($_GET['poll_id'])) {
if (is_numeric($_GET['poll_id'])) {
echo christmas_avatar_edit_poll(array('poll_id' => intval($_GET['poll_id'])));
}
} else {
示例5: html_entity_decode
echo '<img src="' . IMAGE_URL . 'downloads/icons/' . $data['handle'] . '.png" class="image" />' . "\n";
}
echo '<h3>' . $data['title'] . '</h3>' . "\n";
echo '<p>' . html_entity_decode($data['description']) . '</p>' . "\n";
echo '<div class="download_foot">' . "\n";
echo '<span class="locense">Licens: ' . $DOWNLOAD_LICENSE[$data['license']] . '</span>' . "\n";
if (strlen($data['website']) > 0) {
echo '<span class="website"><a href="' . $data['website'] . '">Webbsajt</a></span>' . "\n";
}
if (strlen($data['direct_link']) > 0) {
echo '<span class="direct_link"><a href="' . $data['direct_link'] . '">Direktlänk</a></span>' . "\n";
}
echo '</div>' . "\n";
echo '</div>' . "\n";
}
if (is_privilegied('programlist_admin')) {
echo '<form class="downloads_form" enctype="multipart/form-data" method="post">' . "\n";
echo '<h5>Rubrik</h5>' . "\n";
echo '<input type="text" name="title" class="textbox" />' . "\n";
echo '<h5>Beskrivning</h5>' . "\n";
echo '<textarea name="description"></textarea>' . "\n";
echo '<h5>Kategori</h5>' . "\n";
echo '<input type="text" name="category" class="textbox" />' . "\n";
foreach ($download_categories as $category) {
echo '<input type="radio" name="category" value="' . $category . '" />' . $category . '<br />';
}
echo '<h5>Bild</h5>' . "\n";
echo '<input type="file" name="image" />' . "\n";
echo '<h5>Webbsajt</h5>' . "\n";
echo '<input type="text" name="website" class="textbox" />' . "\n";
echo '<h5>Direktlänk</h5>' . "\n";
示例6: hpads_form
<?php
require '../include/core/common.php';
$ui_options['stylesheets'][] = 'hpads_admin.css';
$ui_options['javascripts'][] = 'hpads_admin.js';
$ui_options['title'] = 'Startsidan på Hamsterpaj';
if (!is_privilegied('hp_ad_admin')) {
jscript_alert('En skyddad sida, du är inte välkommen');
jscript_location('/');
die('Du måste ha privilegie för att nå den här sidan');
}
ui_top($ui_options);
$_POST['html'] = html_entity_decode($_POST['html']);
if ($_POST['action'] == 'create') {
$uniqid = md5(rand() . uniqid() . microtime());
$query = 'INSERT INTO hp_ads (name, area, credits, expire, html, probability, uniqid) VALUES("';
$query .= $_POST['name'] . '", "' . $_POST['area'] . '", "' . $_POST['credits'] . '", "' . strtotime($_POST['expire']) . '", "' . $_POST['html'];
$query .= '", "' . $_POST['probability'] . '", "' . $uniqid . '")';
mysql_query($query);
}
if ($_POST['action'] == 'update') {
$query = 'UPDATE hp_ads SET name = "' . $_POST['name'] . '", area = "' . $_POST['area'] . '", credits = "' . $_POST['credits'] . '"';
$query .= ', expire = "' . strtotime($_POST['expire']) . '", html = "' . $_POST['html'] . '", probability = "' . $_POST['probability'] . '"';
$query .= ' WHERE id = "' . $_POST['id'] . '" LIMIT 1';
mysql_query($query);
}
echo hpads_form();
ui_bottom();
示例7: die
<?php
try {
require '../include/core/common.php';
if (!is_privilegied('gb_autoreport')) {
jscript_alert('Denna sida kräver privilegiet: gb_autoreport');
jscript_location('/');
die('inte för dig...');
}
if (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
throw new Exception('No action in get data recieved');
}
switch ($action) {
case 'post_validate':
if (!is_numeric($_GET['id'])) {
throw new Exception('ID not numeric');
}
$query = 'UPDATE gb_autoreport_posts SET checked = 1 WHERE id = ' . $_GET['id'];
mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
if ($_GET['return'] == true) {
header('Location: /admin/gb_autoreport.php');
}
break;
default:
throw new Exception('Action not found');
break;
}
} catch (Exception $error) {
echo '<div class="form_notice_error">';
示例8: isset
<?php
require '../include/core/common.php';
/*$action = isset($_GET['action']) ? $_GET['action'] : '';
$value = isset($_GET['value']) ? $_GET['value'] : '';*/
$value_isset = isset($_GET['value']) ? true : false;
$value = $_GET['value'];
$action = $_GET['action'];
if (!is_privilegied('use_handy_tools')) {
//die('Det där är att gå över gränsen.');
} elseif ($type == 'ip2host' && $value_isset) {
if (ereg('^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2}){0,1}$', $value)) {
$out .= gethostbyaddr($value);
} else {
$out .= 'Det där var tydligen ingen IP-adress.';
}
} elseif ($action == 'ip2long' && $value_isset) {
if (ereg('^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2}){0,1}$', $value)) {
$out .= ip2long($value);
} else {
$out .= 'Det där var tydligen ingen IP-adress.';
}
} elseif ($action == 'long2ip' && $value_isset) {
if (is_numeric($value)) {
$out .= long2ip($value);
} else {
$out .= 'En \'long\' måste bestå av nummer.';
}
} elseif ($action == 'serialize2preint_r' && $value_isset) {
$out .= preint_r(unserialize(stripslashes($value)));
} elseif ($action == 'md5' && $value_isset) {
示例9: array
<?php
require '../include/core/common.php';
require PATHS_LIBRARIES . 'photos.lib.php';
$ui_options['javascripts'][] = 'fp_module_rearrange.js';
$ui_options['stylesheets'][] = 'fp_module_rearrange.css';
$ui_options['title'] = 'Sortera förstasidesmoduler';
$ui_options['menu_path'] = array('hamsterpaj');
$ui_options['adtoma_category'] = 'start';
if (!is_privilegied('fp_module_rearrange')) {
ui_top($ui_options);
echo '<div class="error">';
echo '<strong>Nu äter hamstern upp dig! :)</strong>';
echo '</div>';
ui_bottom();
exit;
}
ui_top($ui_options);
$filenames = cache_load('fp_module_order');
$dir = opendir(PATHS_DYNAMIC_CONTENT . 'fp_modules/');
while ($filename = readdir($dir)) {
if ($filename != '.' && $filename != '..' && !in_array($filename, $filenames)) {
$filenames[] = $filename;
}
}
$output .= '<ul id="fp_module_rearrange_list">';
foreach ($filenames as $filename) {
$output .= '<li id="' . $filename . '">' . "\n";
$output .= '<h3>' . $filename . '</h3>' . "\n";
$output .= '<a href="/admin/fp_module_customize.php?filename=' . $filename . '">Redigera</a>' . "\n";
$output .= '</li>' . "\n";
示例10: digga_view
function digga_view($artist_id)
{
$artist_info = digga_fetch_info($artist_id);
echo '<h1>Digga ger dig info om ' . $artist_info['name'] . '</h1>' . "\n";
echo '<h3>' . cute_number($artist_info['popularity']) . ' Hamsterpajare diggar ' . $artist_info['name'] . '!</h3>' . "\n";
if (strlen($artist_info['description']) > 0) {
echo '<p class="digga_description">' . "\n";
echo nl2br($artist_info['description']);
echo '</p>' . "\n";
} else {
echo '<p class="digga_no_description">' . "\n";
echo 'Vi har tyvärr ingen beskrivning om ' . $artist_info['name'] . ' än. Om du känner att du kan mycket om det ';
echo 'här bandet eller den här artisten så får du hemskt gärna skriva en egen beskrivning och skicka den som ett ';
echo 'privat meddelande till <a href="/traffa/profile.php?id=774586">Joar</a>. Glöm inte att tala om vilken artist ';
echo 'det gäller!' . "\n";
echo '</p>' . "\n";
}
if (is_privilegied('digga_admin')) {
echo 'Du kan <a href="?action=edit&artist_id=' . $artist_id . '">';
echo 'ändra beskrivningen och namnet</a>';
}
$diggers = digga_fetch_diggers($artist_id);
if (count($diggers) > 0) {
echo '<div id="digga_diggers">' . "\n";
echo '<h2>Hamsterpajare som diggar ' . $artist_info['name'] . '</h2>' . "\n";
echo '<table>' . "\n";
foreach ($diggers as $digger) {
echo '<tr>' . "\n";
echo '<td><a href="/traffa/profile.php?id=' . $digger['id'] . '">' . $digger['username'] . '</a></td>' . "\n";
echo '<td>' . $digger['gender'] . date_get_age($digger['birthday']) . '</td>' . "\n";
echo '<td>';
echo $digger['lastaction'] > time() - 900 ? 'online' : 'offline';
echo '</td>' . "\n";
echo '</tr>' . "\n";
}
echo '</table>' . "\n";
echo '</div>' . "\n";
}
echo '<div id="digga_songs">' . "\n";
echo '<h2>Låtar av ' . $artist_info['name'] . '</h2>' . "\n";
$query = 'SELECT title FROM songs WHERE artist = "' . $artist_id . '" ORDER BY popularity DESC';
$result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
echo '<ul style="list-style-type: none;">' . "\n";
while ($data = mysql_fetch_assoc($result)) {
echo '<li>' . $data['title'] . '</li>' . "\n";
}
echo '</ul>' . "\n";
echo '</div>' . "\n";
}
示例11: foreach
$out .= '<table>' . "\n";
foreach ($radio_day_events as $radio_event) {
$out .= '<tr id="' . $radio_event['id'] . '">' . "\n";
$out .= '<td class="radio_schedule_program_name">' . $radio_event['name'] . '</td>' . "\n";
$out .= '<td>' . date('H:i', strtotime($radio_event['starttime'])) . '</td>' . "\n";
// Snygga till datumet så det står: Imorgon 22:00 Eller ngt sådant snyggt
if (is_privilegied('radio_sender')) {
$out .= '<td><a href="#" class="schedule_remove" title="Ta bort sändning">(x)</a></td>' . "\n";
// Ajax
}
$out .= '</tr>' . "\n";
}
$out .= '</table>' . "\n";
$out .= '</div>' . "\n";
}
if (is_privilegied('radio_sender')) {
$options['order-by'] = 'name';
$options['order-direction'] = 'DESC';
$radio_programs = radio_programs_fetch($options);
// For Select list
unset($options);
$out .= '<br style="clear: both;" /><div id="form_notice"></div>' . "\n";
$out .= '<fieldset>' . "\n";
$out .= '<legend>Lägg till sändning</legend>' . "\n";
$out .= '<form action="/ajax_gateways/radio.php?action=schedule_add" method="post">';
$out .= '<table class="form">' . "\n";
$out .= '<tr>' . "\n";
$out .= '<th><label for="program">Program <strong>*</strong></label></th>' . "\n";
$out .= '<td><select name="program" id="radio_schedule_add_program">' . "\n";
foreach ($radio_programs as $radio_program) {
$out .= '<option value="' . $radio_program['id'] . '">' . $radio_program['name'] . '</option>' . "\n";
示例12: forum_security
function forum_security($options)
{
switch ($options['action']) {
case 'move_thread':
if (login_checklogin()) {
if (is_privilegied('discussion_forum_move_thread')) {
return true;
}
}
break;
case 'thread_sticky':
return is_privilegied('discussion_forum_sticky_threads');
break;
case 'thread_lock':
return is_privilegied('discussion_forum_lock_threads');
break;
case 'thread_rename':
return is_privilegied('discussion_forum_rename_threads');
break;
case 'remove_post':
case 'unremove_post':
return is_privilegied('discussion_forum_remove_posts');
break;
case 'user_ro':
return is_privilegied('user_management_admin');
break;
case 'report':
return login_checklogin();
break;
case 'edit_post':
if (is_privilegied('discussion_forum_edit_posts')) {
return true;
}
if ($options['post']['timestamp'] > time() - 600 && $options['post']['author'] == $_SESSION['login']['id']) {
return true;
}
break;
case 'post_addition':
if (is_privilegied('discussion_forum_post_addition') || $options['post']['author'] == $_SESSION['login']['id']) {
return true;
}
break;
case 'reply':
if (login_checklogin()) {
if (isset($options['post']) && !empty($options['post']) && $options['post']['locked'] == 1) {
$return .= '<h2>Diskussionen är låst!</h2>' . "\n";
$return .= '<p>Av en eller annan anledning har någon utav våra ordningsvakter låst diskussionen. Att diskussioner blir låsta beror oftast på att de har spårat ur, eller om de går för mycket ifrån ämnet.</p>' . "\n";
return $return;
}
return true;
} else {
$return .= '<h2>Inte inloggad</h2>' . "\n";
$return .= '<p>Du kan inte skriva i forumet om du inte är inloggad. Att <a href="/register.php">bli medlem</a> är både gratis och vi frågar inte några jobbiga frågor om varken din epost eller ditt personnummer.</p>' . "\n";
return $return;
}
break;
case 'discussion_create':
$category_tree = discussion_forum_categories_fetch(array('id' => $options['forum_id']));
if (count($category_tree) < 1) {
$return .= '<h2>Hittade inte forumet</h2>' . "\n";
$return .= '<p>Vi kunde inte starta en diskussion i det forumet, för det finns inget forum med id #' . $options['forum_id'] . '.</p>' . "\n";
$return .= '<pre>' . $options['content'] . '</pre>' . "\n";
return $return;
break;
}
$category = array_pop($category_tree);
if ($category['userlevel_create'] > $options['userlevel'] && !is_privilegied('ov_forum')) {
$return .= '<h2>Aja baja, så får man inte göra!</h2>' . "\n";
$return .= '<p>Nu försökte du starta en diskussion i en kategori du inte får posta i. Kanske var det någon som lekte hacker?</p>' . "\n";
$return .= '<pre>' . $options['content'] . '</pre>' . "\n";
return $return;
break;
}
if ($category['quality_level'] > $_SESSION['login']['quality_level'] && $_SESSION['login']['quality_level_expire'] > time()) {
$return .= '<h2>Här får du inte skriva</h2>' . "\n";
$return .= '<p>Tjockis, du är ju QL:ad! Sluta hacka, fetknåpp.</p>' . "\n";
return $return;
break;
}
return true;
break;
case 'new_post':
$first_post = array_shift(discussion_forum_post_fetch(array('post_id' => $options['parent_post'], 'limit' => 1, 'disable_forum_lookup' => true)));
if ($first_post == NULL) {
$return .= '<h2>Hittade inte diskussionen</h2>' . "\n";
$return .= '<p>Vi hittade inte diskussionen i vårat system, kanske är den borttagen? Här är ditt inlägg:</p>' . "\n";
$return .= '<pre>' . $options['content'] . '</pre>' . "\n";
return $return;
break;
}
if ($first_post['locked'] == 1) {
$return .= '<h2>Diskussionen är låst!</h2>' . "\n";
$return .= '<p>Av en eller annan anledning har någon utav våra ordningsvakter låst diskussionen. Att diskussioner blir låsta beror oftast på att de har spårat ur, eller om de går för mycket ifrån ämnet. Här är ditt inlägg:</p>' . "\n";
$return .= '<pre>' . $options['content'] . '</pre>' . "\n";
return $return;
break;
}
$category_tree = discussion_forum_categories_fetch(array('id' => $options['forum_id']));
if (count($category_tree) < 1) {
$return .= '<h2>Hittade inte forumet</h2>' . "\n";
//.........這裏部分代碼省略.........
示例13: sex_sense_render_posts
function sex_sense_render_posts($posts, $options = array())
{
foreach ($posts as $post) {
$out .= sex_sense_bright_container_top();
$out .= sex_sense_dark_container_top();
$out .= '<h3 class="sex_sense_post_header" id="header_' . $post['id'] . '">' . $post['title'] . '</h3>' . "\n";
$out .= sex_sense_dark_container_bottom();
$out .= '<div class="' . (isset($options['unhide_content']) && $options['unhide_content'] == true ? 'content' : 'hidden_content') . '" id="content_' . $post['id'] . '">';
$out .= '<p>' . nl2br($post['question']) . '</p>' . "\n";
foreach ($post['answers'] as $answer) {
$out .= ui_avatar($answer['user_id']);
$out .= sex_sense_bubble_top();
$out .= '<h4>' . $answer['username'] . ' svarar:</h4>' . "\n";
$out .= '<p>' . nl2br($answer['answer']);
$out .= is_privilegied('sex_sense_admin') ? '<br /><a href="/sex_och_sinne/aendra_svar.php?id=' . $answer['id'] . '">Ändra svar.</a>' : '';
$out .= '</p>' . "\n";
$out .= sex_sense_bubble_bottom();
}
$direct_link = '/sex_och_sinne/';
$categories = sex_sense_fetch_categories(array('category_id' => $post['category_id']));
foreach ($categories as $category_tree) {
$category = array_pop($category_tree);
$direct_link .= $category['category_handle'] . '/';
}
$direct_link .= $post['handle'] . '.html';
$out .= '<button class="button_80" onclick="window.location=\'' . $direct_link . '\';">Direktlänk</button>' . "\n";
if ($post['forum_post_id'] != 0) {
$thread_url = forum_get_url_by_post($post['forum_post_id']);
$out .= '<button class="button_140" onclick="window.location=\'' . $thread_url . '\';">Diskutera i forumet</button>' . "\n";
}
$out .= is_privilegied('sex_sense_admin') ? '<br /><a href="/sex_och_sinne/admin.php?id=' . $post['id'] . '">Ändra fråga/lägg till svar »</a>' : '';
$out .= '<div style="clear: both; height: 5px;"></div>' . "\n";
$out .= '</div>';
$out .= sex_sense_bright_container_bottom();
$closed_content++;
}
return $out;
}
示例14: ui_menu_subcategories_fetch
function ui_menu_subcategories_fetch($menu, $ui_options)
{
$class = '';
$return = '';
foreach ($menu as $handle => $menu_item) {
// Note: $menu_item['is_privilegied'] might be an array!
if (isset($menu_item['is_privilegied'])) {
$menu_item['is_privilegied'] = is_array($menu_item['is_privilegied']) ? $menu_item['is_privilegied'] : array($menu_item['is_privilegied']);
$is_privilegied = false;
foreach ($menu_item['is_privilegied'] as $privilegie) {
if (is_privilegied($privilegie)) {
$is_privilegied = true;
}
}
if (!$is_privilegied) {
continue;
}
}
$return .= '<li' . $class . '><a href="' . $menu_item['url'] . '">' . $menu_item['label'] . '</a>' . "\n";
if (isset($menu_item['children']) && count($menu_item['children']) > 0) {
$return .= '<ul>' . "\n";
$return .= ui_menu_subcategories_fetch($menu_item['children'], $ui_options);
$return .= '</ul>' . "\n";
}
$return .= '</li>' . "\n";
}
return $return;
}
示例15: discussion_forum_reload_category_subscriptions
discussion_forum_reload_category_subscriptions();
}
if ($_GET['action'] == 'remove_category_subscription') {
$query = 'UPDATE forum_category_visits SET subscribing = 0 WHERE user_id = "' . $_SESSION['login']['id'] . '" AND category_id = "' . $_GET['category_id'] . '" LIMIT 1';
mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
$_SESSION['forum']['categories'][$_GET['category_id']]['subscribing'] = 0;
discussion_forum_reload_category_subscriptions();
}
/* Sticky or unsticky */
if ($_GET['action'] == 'setsticky' && is_privilegied('discussion_forum_sticky_threads') && is_numeric($_GET['post_id'])) {
$query = 'UPDATE forum_posts SET sticky = 1 WHERE id = "' . $_GET['post_id'] . '" LIMIT 1';
mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
}
if ($_GET['action'] == 'unsticky' && is_privilegied('discussion_forum_sticky_threads') && is_numeric($_GET['post_id'])) {
$query = 'UPDATE forum_posts SET sticky = 0 WHERE id = "' . $_GET['post_id'] . '" LIMIT 1';
mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
}
/* Locking or unlocking threads... */
if ($_GET['action'] == 'lock_thread' && is_privilegied('discussion_forum_lock_threads') && is_numeric($_GET['post_id'])) {
$query = 'UPDATE forum_posts SET locked = 1 WHERE id = "' . $_GET['post_id'] . '" LIMIT 1';
mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
}
if ($_GET['action'] == 'unlock_thread' && is_privilegied('discussion_forum_lock_threads') && is_numeric($_GET['post_id'])) {
$query = 'UPDATE forum_posts SET locked = 0 WHERE id = "' . $_GET['post_id'] . '" LIMIT 1';
mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
}
/* Renaming posts (threads). Fix a function for this later on... */
if ($_GET['action'] == 'rename_post' && is_privilegied('discussion_forum_rename_threads') && is_numeric($_GET['post_id'])) {
$query = 'UPDATE forum_posts SET title = "' . $_GET['new_title'] . '" WHERE id = "' . $_GET['post_id'] . '" LIMIT 1';
mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
}