當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IPSMember::setUpModerator方法代碼示例

本文整理匯總了PHP中IPSMember::setUpModerator方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::setUpModerator方法的具體用法?PHP IPSMember::setUpModerator怎麽用?PHP IPSMember::setUpModerator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在IPSMember的用法示例。


在下文中一共展示了IPSMember::setUpModerator方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor
  *
  * @param	object		ipsRegistry reference
  * @return	@e void
  */
 public function __construct(ipsRegistry $registry)
 {
     parent::__construct($registry);
     /* Load and init forums */
     if (ipsRegistry::isClassLoaded('class_forums') !== TRUE) {
         try {
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
             $this->registry->setClass('class_forums', new $classToLoad($registry));
         } catch (Exception $error) {
             IPS_exception_error($error);
         }
         $this->registry->getClass('class_forums')->strip_invisible = 1;
         $this->registry->getClass('class_forums')->forumsInit();
         $this->memberData = IPSMember::setUpModerator($this->memberData);
     }
     /* Load topic class */
     if (!$this->registry->isClassLoaded('topics')) {
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/topics.php", 'app_forums_classes_topics', 'forums');
         $this->registry->setClass('topics', new $classToLoad($this->registry));
     }
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:27,代碼來源:plugin_post.php

示例2: __construct

 /**
  * Construct.
  * @access	public
  * @param	object		Registry
  * @param	string		Plug in key
  * @return	@e void
  */
 public function __construct($registry, $plugin)
 {
     /* Make object */
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     /* Store */
     $this->_pluginKey = $plugin;
     try {
         $this->_initPlugin($plugin);
     } catch (Exception $e) {
         return $e->getMessage();
     }
     /* Verify moderator perms are set */
     $this->memberData = IPSMember::setUpModerator($this->memberData);
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:29,代碼來源:links.php

示例3: makeRegistryShortcuts

 /**
  * Creates all the registry shorctus
  *
  * @access	public
  * @param	object	ipsRegistry reference
  * @return	@e void
  */
 public function makeRegistryShortcuts(ipsRegistry $registry)
 {
     /* Make registry objects */
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     $this->memberData = IPSMember::setUpModerator($this->memberData);
     $classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classAjax.php', 'classAjax');
     $this->ajax = new $classToLoad();
     IPSDebug::fireBug('registerExceptionHandler');
     IPSDebug::fireBug('registerErrorHandler');
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:25,代碼來源:ipsController.php

示例4: __call

 /**
  * Magic Call method
  *
  * @param	string	Method Name
  * @param	mixed	Method arguments
  * @return	mixed
  * Exception codes:
  */
 public function __call($method, $arguments)
 {
     $firstBit = substr($method, 0, 3);
     $theRest = substr($method, 3);
     if (in_array($theRest, $this->_allowedInternalData)) {
         if ($firstBit == 'set') {
             if ($theRest == 'Author') {
                 if (is_array($arguments[0])) {
                     $this->_internalData[$theRest] = $arguments[0];
                 } else {
                     if ($arguments[0]) {
                         /* Set up moderator stuff, too */
                         $this->_internalData[$theRest] = IPSMember::setUpModerator(IPSMember::load(intval($arguments[0]), 'all'));
                         /* And ignored users */
                         $this->_internalData[$theRest]['ignored_users'] = array();
                         $this->registry->DB()->build(array('select' => '*', 'from' => 'ignored_users', 'where' => "ignore_owner_id=" . intval($arguments[0])));
                         $this->registry->DB()->execute();
                         while ($r = $this->registry->DB()->fetch()) {
                             $this->_internalData[$theRest]['ignored_users'][] = $r['ignore_ignore_id'];
                         }
                     } else {
                         $this->_internalData[$theRest] = IPSMember::setUpGuest();
                     }
                 }
                 if ($this->_internalData['Author']['mgroup_others']) {
                     $_others = explode(',', IPSText::cleanPermString($this->_internalData['Author']['mgroup_others']));
                     $_perms = array();
                     foreach ($_others as $_other) {
                         $_perms[] = $this->caches['group_cache'][$_other]['g_perm_id'];
                     }
                     if (count($_perms)) {
                         $this->_internalData['Author']['g_perm_id'] = $this->_internalData['Author']['g_perm_id'] . ',' . implode(',', $_perms);
                     }
                 }
             } else {
                 $this->_internalData[$theRest] = $arguments[0];
                 return TRUE;
             }
         } else {
             if (($theRest == 'Author' or $theRest == 'Settings' or $theRest == 'ModOptions') and isset($arguments[0])) {
                 return isset($this->_internalData[$theRest][$arguments[0]]) ? $this->_internalData[$theRest][$arguments[0]] : '';
             } else {
                 return isset($this->_internalData[$theRest]) ? $this->_internalData[$theRest] : '';
             }
         }
     } else {
         switch ($method) {
             case 'setForumData':
                 $this->_forumData = $arguments[0];
                 break;
             case 'setPostData':
                 $this->_postData = $arguments[0];
                 break;
             case 'setTopicData':
                 $this->_topicData = $arguments[0];
                 break;
             case 'getForumData':
                 if (!empty($arguments[0])) {
                     return $this->_forumData[$arguments[0]];
                 } else {
                     return $this->_forumData;
                 }
                 break;
             case 'getPostData':
                 if (!empty($arguments[0])) {
                     return $this->_postData[$arguments[0]];
                 } else {
                     return $this->_postData;
                 }
                 break;
             case 'getTopicData':
                 if (!empty($arguments[0])) {
                     return $this->_topicData[$arguments[0]];
                 } else {
                     return $this->_topicData;
                 }
                 break;
             case 'getPostError':
                 return isset($this->lang->words[$this->_postErrors]) ? $this->lang->words[$this->_postErrors] : $this->_postErrors;
                 break;
         }
     }
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:91,代碼來源:classPost.php

示例5: __construct

 /**
  * Constructor
  *
  * @param	object		ipsRegistry reference
  * @return	@e void
  */
 public function __construct(ipsRegistry $registry)
 {
     /* Make object */
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     $this->lang = $this->registry->getClass('class_localization');
     $this->member = $this->registry->member();
     $this->memberData =& $this->registry->member()->fetchMemberData();
     if (IN_ACP) {
         try {
             require_once IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php";
             /*noLibHook*/
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/admin_forum_functions.php", 'admin_forum_functions', 'forums');
             $this->registry->setClass('class_forums', new $classToLoad($registry));
             $this->registry->getClass('class_forums')->strip_invisible = 0;
         } catch (Exception $error) {
             IPS_exception_error($error);
         }
     } else {
         try {
             $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums');
             $this->registry->setClass('class_forums', new $classToLoad($registry));
             $this->registry->getClass('class_forums')->strip_invisible = 1;
         } catch (Exception $error) {
             IPS_exception_error($error);
         }
     }
     //---------------------------------------------------
     // Grab and cache the topic now as we need the 'f' attr for
     // the skins...
     //---------------------------------------------------
     if (!empty($_GET['showtopic'])) {
         /* Load tagging stuff */
         if (!$this->registry->isClassLoaded('tags')) {
             require_once IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php';
             /*noLibHook*/
             $this->registry->setClass('tags', classes_tags_bootstrap::run('forums', 'topics'));
         }
         $this->request['t'] = intval($_GET['showtopic']);
         $this->DB->build(array('select' => 't.*', 'from' => array('topics' => 't'), 'where' => 't.tid=' . $this->request['t'], 'add_join' => array($this->registry->tags->getCacheJoin(array('meta_id_field' => 't.tid')))));
         $this->DB->execute();
         $topic = $this->DB->fetch();
         $this->registry->getClass('class_forums')->topic_cache = $topic;
         $this->request['f'] = $topic['forum_id'];
         /* Update query location */
         $this->member->sessionClass()->addQueryKey('location_2_id', ipsRegistry::$request['f']);
     }
     $this->registry->getClass('class_forums')->forumsInit();
     //-----------------------------------------
     // Set up moderators
     //-----------------------------------------
     $this->memberData = IPSMember::setUpModerator($this->memberData);
     /* Other set up for this app */
     $this->settings['topic_title_max_len'] = $this->settings['topic_title_max_len'] > 2 ? $this->settings['topic_title_max_len'] : 2;
 }
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:65,代碼來源:app_class_forums.php

示例6: checkEmailAccess

 /**
  * Determine if user can still access forum
  *
  * @param	array 		Topic/member/forum data
  * @param	boolean		Check topic access
  * @return	boolean
  */
 public function checkEmailAccess($t, $checkTopic = true)
 {
     //-----------------------------------------
     // Test for group permissions
     //-----------------------------------------
     $member_groups = array($t['member_group_id']);
     $mgroup_others = "";
     $temp_mgroups = array();
     $mgroup_perms = array();
     $t['mgroup_others'] = IPSText::cleanPermString($t['mgroup_others']);
     if ($t['mgroup_others']) {
         $temp_mgroups = explode(",", $t['mgroup_others']);
         if (count($temp_mgroups)) {
             foreach ($temp_mgroups as $other_mgroup) {
                 /* Does it exist? */
                 if ($this->caches['group_cache'][$other_mgroup]['g_perm_id']) {
                     $member_groups[] = $other_mgroup;
                     $mgroup_perms[] = $this->caches['group_cache'][$other_mgroup]['g_perm_id'];
                 }
             }
         }
         if (count($mgroup_perms)) {
             $mgroup_others = "," . implode(",", $mgroup_perms) . ",";
         }
     }
     $perm_id = $t['org_perm_id'] ? $t['org_perm_id'] : $this->caches['group_cache'][$t['member_group_id']]['g_perm_id'] . $mgroup_others;
     //-----------------------------------------
     // Can they view forum?
     //-----------------------------------------
     if ($this->registry->permissions->check('view', $this->allForums[$t['forum_id']], explode(',', $perm_id)) !== TRUE) {
         return false;
     }
     //-----------------------------------------
     // Can they read topics in the forum?
     //-----------------------------------------
     if ($this->registry->permissions->check('read', $this->allForums[$t['forum_id']], explode(',', $perm_id)) !== TRUE) {
         return false;
     }
     //-----------------------------------------
     // Can view others topics
     //-----------------------------------------
     if ($checkTopic) {
         $canViewOthers = false;
         $t = IPSMember::setUpModerator($t);
         foreach ($member_groups as $mgroup) {
             if ($this->caches['group_cache'][$mgroup]['g_other_topics']) {
                 $canViewOthers = true;
             }
         }
         if (!$canViewOthers and $t['starter_id'] != $t['member_id']) {
             return false;
         } else {
             if (!$this->allForums[$t['forum_id']]['can_view_others'] and $t['starter_id'] != $t['member_id'] and !$t['is_mod']) {
                 return false;
             }
         }
     }
     //-----------------------------------------
     // Minimum posts to view
     //-----------------------------------------
     if ($this->allForums[$t['forum_id']]['min_posts_view'] && $this->allForums[$t['forum_id']]['min_posts_view'] > $t['posts'] && !$t['g_is_supmod']) {
         return false;
     }
     //-----------------------------------------
     // Banned?
     //-----------------------------------------
     if ($t['member_banned']) {
         return false;
     }
     $_canView = false;
     foreach ($member_groups as $mgroup) {
         if ($this->caches['group_cache'][$mgroup]['g_view_board']) {
             $_canView = true;
             break;
         }
     }
     return $_canView;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:85,代碼來源:class_forums.php

示例7: buildDisplayData


//.........這裏部分代碼省略.........
     }
     //-----------------------------------------
     // Group image
     //-----------------------------------------
     $member['member_rank_img'] = '';
     $member['member_rank_img_i'] = '';
     if ($group_cache[$member['member_group_id']]['g_icon']) {
         $_img = $group_cache[$member['member_group_id']]['g_icon'];
         if (substr($_img, 0, 4) != 'http' and strpos($_img, '{style_images_url}') === false) {
             $_img = ipsRegistry::$settings['_original_base_url'] . '/' . ltrim($_img, '/');
         }
         $member['member_rank_img_i'] = 'img';
         $member['member_rank_img'] = $_img;
     } else {
         if ($pips and $member['member_id']) {
             if (is_numeric($pips)) {
                 for ($i = 1; $i <= $pips; ++$i) {
                     $member['member_rank_img_i'] = 'pips';
                     $member['member_rank_img'] = $member['member_rank_img'] . ipsRegistry::getClass('output')->getReplacement('pip_pip');
                 }
             } else {
                 $member['member_rank_img_i'] = 'img';
                 $member['member_rank_img'] = ipsRegistry::$settings['public_dir'] . 'style_extra/team_icons/' . $pips;
             }
         }
     }
     //-----------------------------------------
     // Moderator data
     //-----------------------------------------
     if (($parseFlags['spamStatus'] or $parseFlags['warn']) and $member['member_id']) {
         /* Possible forums class isn't init at this point */
         if (!ipsRegistry::isClassLoaded('class_forums')) {
             try {
                 $viewingMember = IPSMember::setUpModerator(ipsRegistry::member()->fetchMemberData());
                 ipsRegistry::member()->setProperty('forumsModeratorData', $viewingMember['forumsModeratorData']);
             } catch (Exception $error) {
                 IPS_exception_error($error);
             }
         }
         $moderator = ipsRegistry::member()->getProperty('forumsModeratorData');
     }
     $forum_id = isset(ipsRegistry::$request['f']) ? intval(ipsRegistry::$request['f']) : 0;
     //-----------------------------------------
     // Spammer status
     //-----------------------------------------
     if ($parseFlags['spamStatus'] and $member['member_id'] and ipsRegistry::member()->getProperty('member_id')) {
         /* Defaults */
         $member['spamStatus'] = NULL;
         $member['spamImage'] = NULL;
         if (!empty($moderator[$forum_id]['bw_flag_spammers']) or ipsRegistry::member()->getProperty('g_is_supmod')) {
             if (!ipsRegistry::$settings['warn_on'] or !IPSMember::isInGroup($member, explode(',', ipsRegistry::$settings['warn_protected']))) {
                 if ($member['bw_is_spammer']) {
                     $member['spamStatus'] = TRUE;
                 } else {
                     $member['spamStatus'] = FALSE;
                 }
             }
         }
     }
     //-----------------------------------------
     // Warny porny?
     //-----------------------------------------
     $member['show_warn'] = FALSE;
     if ($parseFlags['warn'] and $member['member_id']) {
         if (ipsRegistry::$settings['warn_on'] and !IPSMember::isInGroup($member, explode(',', ipsRegistry::$settings['warn_protected']))) {
             /* Warnings */
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:67,代碼來源:ipsMember.php


注:本文中的IPSMember::setUpModerator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。