本文整理汇总了PHP中is_member_of函数的典型用法代码示例。如果您正苦于以下问题:PHP is_member_of函数的具体用法?PHP is_member_of怎么用?PHP is_member_of使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_member_of函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_ranks
function &fetch_rank(&$userinfo)
{
global $vbulletin;
if (!is_array($vbulletin->ranks)) {
// grab ranks since we didn't include 'ranks' in $specialtemplates
$vbulletin->ranks =& build_ranks();
}
$doneusergroup = array();
$userrank = '';
foreach ($vbulletin->ranks as $rank) {
$displaygroupid = empty($userinfo['displaygroupid']) ? $userinfo['usergroupid'] : $userinfo['displaygroupid'];
if ($userinfo['posts'] >= $rank['m'] and (!isset($doneusergroup["{$rank['u']}"]) or $doneusergroup["{$rank['u']}"] === $rank['m']) and ($rank['u'] > 0 and is_member_of($userinfo, $rank['u'], false) and (empty($rank['d']) or $rank['u'] == $displaygroupid) or $rank['u'] == 0 and (empty($rank['d']) or empty($userrank)))) {
if (!empty($userrank) and $rank['s']) {
$userrank .= '<br />';
}
$doneusergroup["{$rank['u']}"] = $rank['m'];
for ($x = $rank['l']; $x--; $x > 0) {
if (empty($rank['t'])) {
$userrank .= "<img src=\"{$rank['i']}\" alt=\"\" border=\"\" />";
} else {
$userrank .= $rank['i'];
}
}
}
}
return $userrank;
}
示例2: post_thanks_off
function post_thanks_off($forumid = 0, $postinfo = array(), $threadfirstpostid = 0, $this_script = '')
{
global $vbulletin;
($hook = vBulletinHook::fetch_hook('post_thanks_function_post_thanks_off_start')) ? eval($hook) : false;
if (!$vbulletin->options['post_thanks_on_off'] || $forumid == 0 || post_thanks_in_array($forumid, $vbulletin->options['post_thanks_forum_off'])) {
return true;
}
if ($vbulletin->options['post_thanks_forum_first_all'] && !($postinfo['postid'] == $threadfirstpostid) || post_thanks_in_array($forumid, $vbulletin->options['post_thanks_forum_first']) && !($postinfo['postid'] == $threadfirstpostid)) {
return true;
}
if (!($this_script == 'showthread' || $this_script == 'showpost' || $this_script == '')) {
return true;
}
if ($vbulletin->options['post_thanks_usergroup_getting']) {
if (is_member_of($postinfo, explode("|", $vbulletin->options['post_thanks_usergroup_getting']))) {
return true;
}
}
if ($vbulletin->options['post_thanks_user_getting']) {
if (in_array($postinfo['userid'], explode("|", $vbulletin->options['post_thanks_user_getting']))) {
return true;
}
}
($hook = vBulletinHook::fetch_hook('post_thanks_function_post_thanks_off_end')) ? eval($hook) : false;
return false;
}
示例3: getSkimClass
function getSkimClass($userinfo)
{
global $vbulletin;
static $skimLinksDisableUsergroups = null;
static $skimWordsDisableUserGroups = null;
if ($skimLinksDisableUsergroups === null) {
$skimLinksDisableUsergroups = json_decode($vbulletin->options['skimlinks_disable_groups_parse']);
}
if ($skimWordsDisableUserGroups === null) {
$skimWordsDisableUserGroups = json_decode($vbulletin->options['skimwords_disable_groups_parse']);
}
$skimLinks = false;
$skimWords = false;
if (empty($skimLinksDisableUsergroups) || !is_member_of($userinfo, $skimLinksDisableUsergroups)) {
$skimLinks = true;
}
if (empty($skimWordsDisableUserGroups) || !is_member_of($userinfo, $skimWordsDisableUserGroups)) {
$skimWords = true;
}
if ($skimLinks and $skimWords) {
return '';
} else {
if ($skimLinks) {
return 'noskimwords';
} else {
if ($skimWords) {
return 'noskimlinks';
} else {
return 'noskim';
}
}
}
}
示例4: kBankHide
function kBankHide(&$registry)
{
//create new object
if (is_object($registry)) {
$this->registry =& $registry;
} else {
trigger_error("vB_Database::Registry object is not an object", E_USER_ERROR);
}
//Check if user is banned
$is_banned = !($this->registry->usergroupcache[$this->registry->userinfo['usergroupid']]['genericoptions'] & $this->registry->bf_ugp_genericoptions['isnotbannedgroup']) ? true : false;
if (is_member_of($this->registry->userinfo, 3, 4) or $is_banned or THIS_SCRIPT == 'misc') {
$this->settings['banned'] = true;
}
//Check if we need to use html version
if (in_array(THIS_SCRIPT, array('ajax', 'editpost', 'misc', 'newthread', 'newreply', 'printthread', 'showpost', 'showthread'))) {
$this->settings['dohtml'] = true;
//Let's use html!
} else {
$this->settings['dohtml'] = false;
//Plain text only
}
if (isset($this->registry->kbank['hide']['shortcut'])) {
foreach ($this->tags as $key => $tag) {
if (strtolower($tag['name']) == strtolower($this->registry->kbank['hide']['shortcut'])) {
$this->tags[$key]['name'] .= '|HIDE';
}
}
}
//Prepair regex
foreach ($this->tags as $key => $tag) {
$this->tags[$key]['regex'] = "\\[({$tag['name']})(=("|\"|'|)?([0-9]+)\\3)?\\]((.|\r|\n)*)\\[\\/\\1\\]";
//$this->tags[$key]['regex_close'] = "\[\/($tag[name])\]"; - not needed
$this->tags[$key]['regex_open'] = "\\[({$tag['name']})(=("|\"|'|)?([0-9]+)\\3)?\\]";
}
}
示例5: fu_user_can_be_frozen
/**
* Check main user group and plugin settings
* Note: Also used as condition for showing "Freeze account" button
*
*/
function fu_user_can_be_frozen($user_info)
{
global $vbulletin;
if (is_member_of($user_info, unserialize($vbulletin->options['fu_source_groups'])) and 0 < $vbulletin->options['fu_frozen_group']) {
return true;
}
return false;
}
示例6: has_vote_permission
/**
* Check if user is able to vote/remove votes
*
* @return bool
*/
public function has_vote_permission()
{
$banned_group = unserialize($this->registry->options['vbv_grp_banned']);
$disabled_group = unserialize($this->registry->options['vbv_grp_disable']);
$readonly_group = unserialize($this->registry->options['vbv_grp_read_only']);
if (is_member_of($this->registry->userinfo, $banned_group) or is_member_of($this->registry->userinfo, $disabled_group) or is_member_of($this->registry->userinfo, $readonly_group)) {
return false;
}
return true;
}
示例7: CheckMrgDPEnabled
/**
*
* Check if module should be ON
*
*/
function CheckMrgDPEnabled()
{
global $vbulletin, $foruminfo, $mrgdp_enable, $mrgdp_timespan;
if (!$vbulletin->userinfo) {
return false;
}
// Module is enabled by default
$mrgdp_enable = true;
// set timespan
$mrgdp_timespan = $vbulletin->options['mrgdp_timespan'];
// check ignore groups
$mrgdp_ignore_groups = unserialize($vbulletin->options['mrgdp_ignore_groups']);
if (is_member_of($vbulletin->userinfo, $mrgdp_ignore_groups)) {
$mrgdp_enable = false;
}
if ($mrgdp_enable and is_array($foruminfo)) {
$mrgdp_this_forum = explode(',', $foruminfo['parentlist']);
// check enabled forums if it is not empty
$mrgdp_enable_forums = trim($vbulletin->options['mrgdp_enable_forums']);
if (!empty($mrgdp_enable_forums)) {
// default value
$mrgdp_enable = false;
$mrgdp_forums = explode(',', $mrgdp_enable_forums);
foreach ($mrgdp_forums as &$mrgdp_forumid) {
if (in_array(intval($mrgdp_forumid), $mrgdp_this_forum)) {
$mrgdp_enable = true;
break;
}
}
unset($mrgdp_forums);
}
unset($mrgdp_enable_forums);
if ($mrgdp_enable) {
// check ignore forums
$mrgdp_ignore_forums = trim($vbulletin->options['mrgdp_ignore_forums']);
if (!empty($mrgdp_ignore_forums)) {
$mrgdp_forums = explode(',', $mrgdp_ignore_forums);
foreach ($mrgdp_forums as &$mrgdp_forumid) {
if (in_array(intval($mrgdp_forumid), $mrgdp_this_forum)) {
$mrgdp_enable = false;
break;
}
}
unset($mrgdp_forums);
}
unset($mrgdp_ignore_forums);
}
unset($mrgdp_this_forum);
}
return $mrgdp_enable;
}
示例8: get_system_list
function get_system_list($access = "", $current = 0, $maxwidth = 50)
{
global $dbconn;
global $session, $roles;
$system_id_list = "";
function int_val(&$item)
{
$item = strval(intval($item));
}
if (is_array($current)) {
array_walk($current, 'int_val');
} else {
$current = intval("{$current}");
}
$query = "SELECT work_system.system_id, system_desc ";
$query .= "FROM work_system WHERE active ";
if ($access != "" && !is_member_of('Admin', 'Support')) {
$query .= " AND EXISTS (SELECT system_usr.system_id FROM system_usr WHERE system_usr.system_id=work_system.system_id";
$query .= " AND user_no={$session->user_no} ";
$query .= " AND role~*'[{$access}]') ";
}
if (is_array($current)) {
$query .= " OR work_system.system_id IN (" . implode(",", $current) . ") ";
} else {
if ($current != "") {
$query .= " OR work_system.system_id={$current}";
}
}
$query .= " ORDER BY LOWER(system_desc);";
$rid = awm_pgexec($dbconn, $query);
if (!$rid) {
return;
}
if (pg_NumRows($rid) > 0) {
// Build table of systems found
$rows = pg_NumRows($rid);
for ($i = 0; $i < $rows; $i++) {
$system_id = pg_Fetch_Object($rid, $i);
$system_id_list .= "<option value=\"" . urlencode($system_id->system_id) . "\"";
if (is_array($current) && in_array($system_id->system_id, $current, true) || "{$system_id->system_id}" == "{$current}") {
$system_id_list .= " SELECTED";
}
$system_id->system_desc = substr($system_id->system_desc, 0, $maxwidth);
$system_id_list .= ">{$system_id->system_desc}</option>\n";
}
}
return $system_id_list;
}
示例9: disableSkimProduct
/**
* Skimlinks vBulletin Plugin
*
* @author Skimlinks
* @version 2.0.7
* @copyright © 2011 Skimbit Ltd.
*/
function disableSkimProduct($product, $threadinfo)
{
global $vbulletin;
if ($threadinfo['lastpost'] > TIMENOW - 86400 * $vbulletin->options["{$product}_thread_age_limit"]) {
return 'true';
}
$disableForum = json_decode($vbulletin->options["{$product}_disable_forums"]);
if (is_array($disableForum) and in_array($threadinfo['forumid'], $disableForum)) {
return 'true';
}
$disabledGroups = json_decode($vbulletin->options["{$product}_disable_groups"]);
if (is_array($disabledGroups) and is_member_of($vbulletin->userinfo, $disabledGroups)) {
return 'true';
}
return 'false';
}
示例10: fetch_relevant_notice_ids
/**
* Fetches the IDs of the notices to display on a particular page.
*
* @return array Array of IDs to display
*/
function fetch_relevant_notice_ids()
{
global $vbulletin, $vbphrase, $foruminfo, $threadinfo, $postinfo;
$forum_pages = array('poll', 'editpost', 'threadrate', 'postings', 'showthread', 'newthread', 'forumdisplay', 'newreply', 'threadtag', 'inlinemod', 'announcement', 'showpost');
$ignore_np_notices = isset($_COOKIE[COOKIE_PREFIX . 'np_notices_displayed']) ? explode(',', $_COOKIE[COOKIE_PREFIX . 'np_notices_displayed']) : array();
$display_notices = array();
$vbulletin->np_notices_displayed = array();
($hook = vBulletinHook::fetch_hook('notices_check_start')) ? eval($hook) : false;
foreach ($vbulletin->noticecache AS $noticeid => $notice)
{
foreach ($notice AS $criteriaid => $conditions)
{
switch ($criteriaid)
{
case 'persistent':
{
if ($conditions == 0 AND in_array($noticeid, $ignore_np_notices)) // session cookie set in print_output()
{
continue 3;
}
break;
}
case 'dismissible':
{
if (in_array($noticeid, fetch_dismissed_notices()))
{
continue 3;
}
break;
}
/*case 'notice_x_not_displayed': // this is now handled differently - see $remove_display_notices below
{
if (in_array(intval($conditions[0]), $display_notices))
{
continue 3;
}
break;
}*/
case 'in_usergroup_x':
{
if (!is_member_of($vbulletin->userinfo, intval($conditions[0])))
{
continue 3;
}
break;
}
case 'not_in_usergroup_x':
{
if (is_member_of($vbulletin->userinfo, intval($conditions[0])))
{
continue 3;
}
break;
}
case 'browsing_forum_x':
{
if ($foruminfo['forumid'] != intval($conditions[0]) OR !in_array(THIS_SCRIPT, $forum_pages))
{
continue 3;
}
break;
}
case 'browsing_forum_x_and_children':
{
if (!in_array(THIS_SCRIPT, $forum_pages) OR !in_array(intval($conditions[0]), explode(',', $foruminfo['parentlist'])))
{
continue 3;
}
break;
}
case 'no_visit_in_x_days':
{
if ($vbulletin->userinfo['lastvisit'] > TIMENOW - $conditions[0] * 86400)
{
continue 3;
}
break;
}
case 'has_never_posted':
{
if ($vbulletin->userinfo['lastpost'] > 0)
{
continue 3;
}
break;
}
case 'no_posts_in_x_days':
{
if ($vbulletin->userinfo['lastpost'] == 0 OR $vbulletin->userinfo['lastpost'] > TIMENOW - $conditions[0] * 86400)
{
//.........这里部分代码省略.........
示例11: define
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
// ################## Begin 'do' Branching ###################
// set default branch action
if (empty($_REQUEST['do'])) {
$_REQUEST['do'] = 'manage';
}
// ###################### Start Manage #######################
if ($_REQUEST['do'] == 'manage') {
$vbulletin->input->clean_gpc('r', 'u', TYPE_UINT);
// get bounced user info
$buser = $db->query_first("\n\t\t\tSELECT * FROM " . TABLE_PREFIX . "user\n\t\t\tWHERE userid = " . $vbulletin->GPC['u'] . "\n\t");
// Do a safety check to make sure managed member is not an Admin, supermoderator, or Moderator
if (is_member_of($buser['usergroupid'], 5, 6, 7)) {
// Exit script
define('CP_REDIRECT', 'user.php?do=modify');
print_stop_message('anti_member_x_is_in_a_protected_usergroup', $buser['username']);
exit;
}
// if buser's ezb_oldugid is == 0 then this is first time buser has bounced
if ($buser['ezb_oldugid'] == 0) {
if ($vbulletin->options['ezb_updateusergroup'] == true) {
// Save Member's Original UsergroupID
$vbulletin->db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "user\n\t\t\t\tSET ezb_oldugid = " . $buser['usergroupid'] . "\n\t\t\t\tWHERE userid = " . $buser['userid'] . "\n\t\t\t");
// Update usergroupid
$vbulletin->db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "user \n\t\t\t\tSET usergroupid\t= '" . $vbulletin->options['ezb_newusergroupid'] . "'\n\t\t\t\tWHERE userid\t= " . $buser['userid'] . "\t\n\t\t\t");
}
// Update Receive Email from Administrators to NO ( UPDATE user SET options = options + 16 WHERE NOT (options & 16) )
$vbulletin->db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "user \n\t\t\tSET options = options - 16 \n\t\t\tWHERE options & 16 AND userid = " . $buser['userid'] . "\n\t\t");
示例12: eval
if (!is_member_of($vbulletin->userinfo, $vbulletin->kbank['MemberGroupIDs']) and !is_member_of($vbulletin->userinfo, $vbulletin->kbank['BankRuptGroupID']) or calcMonthlyTaxPayTime($vbulletin->userinfo, 'next', 1) > TIMENOW) {
eval(standard_error(fetch_error('kbank_tax_not_require')));
}
if (!$autodirected) {
$vbulletin->input->clean_array_gpc('p', array('referer' => TYPE_STR, 'choice' => TYPE_STR));
$tax = calcMonthlyTax($vbulletin->userinfo);
} else {
//Autodirect from 'tax'
$vbulletin->GPC['choice'] = 'pay';
}
$vbulletin->url = $vbulletin->GPC['referer'];
switch ($vbulletin->GPC['choice']) {
case 'pay':
transferMoney($vbulletin->userinfo['userid'], 0, $tax['tax_total'], 'tax_' . TIMENOW, null, true, false, KBANK_NO_TAX, true, 0, array('banklogs_itemname' => 'tax'));
$user_new = array();
if (is_member_of($vbulletin->userinfo, $vbulletin->kbank['BankRuptGroupID'])) {
if ($ban_record = $vbulletin->db->query_first("\n\t\t\t\t\tSELECT * FROM `" . TABLE_PREFIX . "userban`\n\t\t\t\t\tWHERE userid = adminid\n\t\t\t\t\t\tAND userid = {$vbulletin->userinfo['userid']}\n\t\t\t\t\t\t#AND reason = 'kbank_bankrupt_tax'")) {
$user_new = array_merge($user_new, array('usergroupid' => $ban_record['usergroupid'], 'displaygroupid' => $ban_record['displaygroupid'], 'usertitle' => $ban_record['usertitle'], 'customtitle' => $ban_record['customtitle']));
$vbulletin->db->query_write("\n\t\t\t\t\t\tDELETE FROM `" . TABLE_PREFIX . "userban`\n\t\t\t\t\t\tWHERE userid = {$vbulletin->userinfo['userid']}\n\t\t\t\t\t");
} else {
$user_new['usergroupid'] = $vbulletin->kbank['NormalGroupID'];
$usergroup = $vbulletin->usergroupcache["{$user_new['usergroupid']}"];
if (!$usergroup['usertitle']) {
$gettitle = $db->query_first("\n\t\t\t\t\t\t\tSELECT title\n\t\t\t\t\t\t\tFROM " . TABLE_PREFIX . "usertitle\n\t\t\t\t\t\t\tWHERE minposts <= {$vbulletin->userinfo['posts']}\n\t\t\t\t\t\t\tORDER BY minposts DESC\n\t\t\t\t\t\t");
$user_new['usertitle'] = $gettitle['title'];
} else {
$user_new['usertitle'] = $usergroup['usertitle'];
}
}
}
$user_new['kbank_nextpay'] = calcMonthlyTaxPayTime($vbulletin->userinfo, 'next');
示例13: foreach
foreach ($vbulletin->forumcache as $forumid => $forum) {
if (!$forum['link']) {
$showinstant = 0;
//get full forum info
$forum = fetch_foruminfo($forum["forumid"], false);
//if the user has permission to view the given forum, and if forum is postable...
if ($perms = fetch_permissions($forum["forumid"]) and $perms & $vbulletin->bf_ugp_forumpermissions["canview"] and $forum["cancontainthreads"] and $forum["displayorder"] > 0 and $forum["options"] & $vbulletin->bf_misc_forumoptions['active']) {
//get the level of the subscription for the given forum
$sub_level = $db->query_first("\r\n\t\t\t\t\tSELECT emailupdate\r\n\t\t\t\t\tFROM " . TABLE_PREFIX . "subscribeforum\r\n\t\t\t\t\tWHERE forumid = '" . $forum["forumid"] . "' AND userid = " . $vbulletin->userinfo['userid'] . " LIMIT 1\r\n\t\t\t\t");
$usergroupids = explode(",", $forum["ei_usergroups"]);
//if the user hits the set all none or set all instant buttons...
if ($_REQUEST["setall"] == "none") {
$sub_level["emailupdate"] = 0;
}
//write out a row with the info - title, description, and selected subscription
if ($forum["ei_active"] and is_member_of($vbulletin->userinfo, $usergroupids)) {
$showinstant = 1;
$showallinstant = 1;
if ($_REQUEST["setall"] == "instant") {
$sub_level["emailupdate"] = 1;
}
} else {
if ($_REQUEST["setall"] == "instant") {
$sub_level["emailupdate"] = 0;
}
}
eval('$forumbits .= "' . fetch_template('usercp_sub_mgr_forumbits') . '";');
}
}
}
// draw cp nav bar
示例14: lower
echo "morning.";
} else {
if ($hour < 18) {
echo "afternoon.";
} else {
echo "evening.";
}
}
}
?>
Since you're on the support side of things you now get to see a list of systems
and the numbers of requests active for each one. Click on the name of a system to
see those currently active requests. Create a search called 'Home' to replace this default list.
<?php
// Should already be tested, but we might as well check again.
if (!is_member_of('Admin', 'Support', 'Contractor')) {
return;
}
$query = "SELECT s.system_id, lower(s.system_desc) AS lcname, s.system_desc, ";
$query .= "to_char( max(r.request_on), 'D Mon YYYY') AS last_request_date, ";
$query .= "count(r.request_id) AS active_sys_requests ";
$query .= "FROM work_system s ";
$query .= "JOIN system_usr su ON s.system_id = su.system_id ";
$query .= "JOIN request r ON r.system_id = su.system_id ";
$query .= "WHERE su.user_no = {$session->user_no} AND s.active AND r.active ";
$query .= "AND su.role IN ( 'A', 'S', 'C', 'E', 'O', 'V' ) ";
$query .= "AND (r.last_activity > (current_timestamp - '30 days'::interval) ";
$query .= " OR r.last_status NOT IN ( 'F', 'C' ) ) ";
$query .= "GROUP BY lower(s.system_desc), s.system_id, s.system_desc ";
$query .= "HAVING COUNT(r.request_id) > 0 ";
$query .= "ORDER BY lower(s.system_desc) ";
示例15: intval
<?php
$because = "";
if (!$logged_on) {
$because .= "You must log on with a valid password and maintainer ID\n";
}
$fsystem_id = intval("{$fsystem_id}");
if ($fsystem_id == 0) {
if ($session->system_id == 0) {
$because .= "You must select a valid system\n";
} else {
$fsystem_id == $session->system_id;
}
}
// Validate that they are only maintaining a request for a system_id they
if (is_member_of('Admin')) {
// OK, they can do anything :-)
} else {
if ($system_id_roles["{$fsystem_id}"] == "V") {
$because = "You may only view records for that system";
} else {
if ($system_id_roles["{$fsystem_id}"] == "H" || $system_id_roles["{$fsystem_id}"] == "M") {
// That's OK - this is their home system_id, or maintenance is enabled
} else {
$because .= "You may only maintain requests from your organisation\n";
}
}
}
if ("{$because}" != "") {
$because = "<H2>Errors with request:</H2>\n" . nl2br($because) . "<HR>\n";
$because .= "<P><B>Changes have not been processed - please correct because and re-submit</B></P>\n";