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


PHP IPSMember::load方法代碼示例

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


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

示例1: doExecute

 /**
  * Class entry point
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     $this->registry->class_localization->loadLanguageFile(array('public_profile'));
     /* INIT */
     $member_id = intval($this->request['mid']);
     //-----------------------------------------
     // Can we access?
     //-----------------------------------------
     if (!$this->memberData['g_mem_info']) {
         $this->returnString('error');
     }
     if (!$member_id) {
         $this->returnString('error');
     }
     $member = IPSMember::load($member_id, 'profile_portal,pfields_content,sessions,groups,basic', 'id');
     if (!$member['member_id']) {
         $this->returnString('error');
     }
     $this->registry->class_localization->loadLanguageFile(array('public_online'), 'members');
     $member = IPSMember::buildDisplayData($member, array('customFields' => 1, 'cfSkinGroup' => 'profile'));
     $member = IPSMember::getLocation($member);
     $board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies'];
     if ($member['posts'] and $board_posts) {
         $member['_posts_day'] = round($member['posts'] / ((time() - $member['joined']) / 86400), 2);
         # Fix the issue when there is less than one day
         $member['_posts_day'] = $member['_posts_day'] > $member['posts'] ? $member['posts'] : $member['_posts_day'];
         $member['_total_pct'] = sprintf('%.2f', $member['posts'] / $board_posts * 100);
     }
     $member['_posts_day'] = floatval($member['_posts_day']);
     $this->returnHtml($this->registry->getClass('output')->getTemplate('profile')->showCard($member));
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:38,代碼來源:card.php

示例2: show

 /**
  * Show the form
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function show()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $name = trim(IPSText::alphanumericalClean(ipsRegistry::$request['name']));
     $member_id = intval(ipsRegistry::$request['member_id']);
     $output = '';
     //-----------------------------------------
     // Get member data
     //-----------------------------------------
     $member = IPSMember::load($member_id, 'extendedProfile,customFields');
     //-----------------------------------------
     // Got a member?
     //-----------------------------------------
     if (!$member['member_id']) {
         $this->returnJsonError($this->lang->words['t_noid']);
     }
     //-----------------------------------------
     // Return the form
     //-----------------------------------------
     if (method_exists($this->html, $name)) {
         $output = $this->html->{$name}($member);
     }
     //-----------------------------------------
     // Print...
     //-----------------------------------------
     $this->returnHtml($output);
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:34,代碼來源:member_editform.php

示例3: process

 /**
  * Process Results
  *
  * @param	array	Row from database using query specified in fetch()
  * @return	array	Same data with any additional processing necessary
  */
 public function process($row)
 {
     /* Build poster's display data */
     $member = $row['author_id'] ? IPSMember::load($row['author_id'], 'profile_portal,pfields_content,sessions,groups', 'id') : IPSMember::setUpGuest();
     $row = array_merge($row, IPSMember::buildDisplayData($member, array('reputation' => 0, 'warn' => 0)));
     /* Get forum data (damn HTML >.<) */
     $forumData = ipsRegistry::getClass('class_forums')->getForumById($row['forum_id']);
     /* Parse BBCode */
     IPSText::getTextClass('bbcode')->parse_smilies = $row['use_emo'];
     IPSText::getTextClass('bbcode')->parse_html = ($forumData['use_html'] and $member['g_dohtml'] and $row['post_htmlstate']) ? 1 : 0;
     IPSText::getTextClass('bbcode')->parse_nl2br = $row['post_htmlstate'] == 2 ? 1 : 0;
     IPSText::getTextClass('bbcode')->parse_bbcode = 1;
     IPSText::getTextClass('bbcode')->parsing_section = 'topics';
     IPSText::getTextClass('bbcode')->parsing_mgroup = $member['member_group_id'];
     IPSText::getTextClass('bbcode')->parsing_mgroup_others = $member['mgroup_others'];
     $row['post'] = IPSText::getTextClass('bbcode')->preDisplayParse($row['post']);
     /* Parse attachments */
     $messageHTML = array($row['pid'] => $row['post']);
     $attachHTML = $this->class_attach->renderAttachments($messageHTML, array($row['pid']));
     if (is_array($attachHTML) and count($attachHTML)) {
         /* Get rid of any lingering attachment tags */
         if (stristr($attachHTML[$row['pid']]['html'], "[attachment=")) {
             $attachHTML[$row['pid']]['html'] = IPSText::stripAttachTag($attachHTML[$row['pid']]['html']);
         }
         $row['post'] = $attachHTML[$row['pid']]['html'] . $attachHTML[$row['pid']]['attachmentHtml'];
     }
     /* Get rep buttons */
     if ($row['repUserGiving'] == ipsRegistry::member()->getProperty('member_id')) {
         $row['has_given_rep'] = $row['rep_rating'];
     }
     $row['rep_points'] = ipsRegistry::getClass('repCache')->getRepPoints(array('app' => 'forums', 'type' => 'pid', 'type_id' => $row['pid'], 'rep_points' => $row['rep_points']));
     $row['repButtons'] = ipsRegistry::getClass('repCache')->getLikeFormatted(array('app' => 'forums', 'type' => 'pid', 'id' => $row['pid'], 'rep_like_cache' => $row['rep_like_cache']));
     /* Return */
     return $row;
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:41,代碼來源:reputation.php

示例4: _viewRep

 /**
  * Displays reputation popup
  *
  * @return	@e void
  */
 protected function _viewRep()
 {
     $this->lang->loadLanguageFile(array('public_topic'), 'forums');
     if (!$this->memberData['gbw_view_reps']) {
         $this->returnJsonError('no_permission');
     }
     $repApp = $this->request['repApp'];
     $repType = $this->request['repType'];
     $repId = intval($this->request['repId']);
     /* Get data */
     $reps = array();
     $members = array();
     $this->DB->build(array('select' => 'member_id, rep_rating', 'from' => 'reputation_index', 'where' => "app='{$repApp}' AND type='{$repType}' AND type_id='{$repId}'", 'order' => 'rep_date'));
     $q = $this->DB->execute();
     while ($r = $this->DB->fetch($q)) {
         $reps[$r['member_id']] = $r;
         $members[$r['member_id']] = $r['member_id'];
     }
     if (count($members) and count($reps)) {
         $_members = IPSMember::load($members);
         foreach ($reps as $memId => $repData) {
             $reps[$memId]['member'] = $_members[$memId];
         }
     }
     return $this->returnHtml($this->registry->output->getTemplate('global_other')->reputationPopup($reps));
 }
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:31,代碼來源:reputation.php

示例5: getContentUrl

 /**
  * Get Content URL
  *
  * @param	array		$warning		Row from members_warn_logs
  * @return	@e array	array( url => URL to the content the warning came from, title => Title )
  */
 public function getContentUrl($warning)
 {
     ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_profile'), 'members');
     if ($warning['wl_content_id1']) {
         $post = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'message_posts', 'where' => "msg_id=" . intval($warning['wl_content_id1'])));
         if (!empty($post['msg_topic_id'])) {
             $topic = ipsRegistry::DB()->buildAndFetch(array('select' => '*', 'from' => 'message_topics', 'where' => "mt_id={$post['msg_topic_id']}"));
             if (!empty($topic['mt_id'])) {
                 ipsRegistry::DB()->build(array('select' => '*', 'from' => 'message_topic_user_map', 'where' => "map_topic_id={$post['msg_topic_id']}"));
                 ipsRegistry::DB()->execute();
                 while ($row = ipsRegistry::DB()->fetch()) {
                     if ($row['map_user_id'] == ipsRegistry::member()->getProperty('member_id')) {
                         return array('url' => ipsRegistry::getClass('output')->buildUrl("app=members&amp;module=messaging&amp;section=view&amp;do=findMessage&amp;topicID={$topic['mt_id']}&amp;msgID={$post['msg_id']}"), 'title' => $topic['mt_title']);
                     }
                 }
                 return array('url' => ipsRegistry::getClass('output')->buildUrl("app=core&module=reports&section=reports&do=showMessage&topicID={$topic['mt_id']}&msg={$post['msg_id']}"), 'title' => $topic['mt_title']);
             }
         }
     } else {
         $member = IPSMember::load($warning['wl_member']);
         if (!empty($member['member_id'])) {
             return array('url' => ipsRegistry::getClass('output')->buildSEOUrl("showuser={$member['member_id']}", 'public', $member['members_seo_name'], 'showuser'), 'title' => ipsRegistry::getClass('class_localization')->words['warnings_profile']);
         }
     }
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:31,代碼來源:warnings.php

示例6: doExecute

 /**
  * Class entry point
  *
  * @access	public
  * @param	object		Registry reference
  * @return	void		[Outputs to screen/redirects]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $info = array();
     $id = intval($this->request['id']);
     //-----------------------------------------
     // Get HTML and skin
     //-----------------------------------------
     $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
     //-----------------------------------------
     // Can we access?
     //-----------------------------------------
     if (!$this->memberData['g_mem_info']) {
         $this->registry->output->showError('photos_profiles_off', 10242);
     }
     if (!$id) {
         $this->registry->output->showError('photos_no_id', 10243);
     }
     $member = IPSMember::load($id);
     $member = IPSMember::buildDisplayData($member);
     $html = $this->registry->getClass('output')->getTemplate('profile')->showPhoto($member);
     //-----------------------------------------
     // Push to print handler
     //-----------------------------------------
     $this->registry->getClass('output')->setTitle($this->lang->words['photo_title']);
     $this->registry->getClass('output')->popUpWindow($html);
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:36,代碼來源:photo.php

示例7: setMemberData

 /**
  * @param	string	key
  * @param	string	value
  */
 public function setMemberData($k, $v = '')
 {
     if (is_integer($k)) {
         $this->_memberData = empty($k) ? IPSMember::setUpGuest() : IPSMember::load($k, 'all');
     } else {
         if (is_string($k) && $k == intval($k)) {
             $this->_memberData = empty($k) ? IPSMember::setUpGuest() : IPSMember::load($k, 'all');
         } else {
             if (is_array($k)) {
                 $this->_memberData = $k;
             } else {
                 if (!empty($k)) {
                     $this->_memberData[$k] = $v;
                 }
             }
         }
     }
     /* Set perm ids and that */
     if ($this->memberData['member_id'] == $this->_memberData['member_id']) {
         $this->_memberData['_perm_id_array'] = $this->member->perm_id_array;
     } else {
         /* Force to guest for now */
         $permId = !empty($this->_memberData['org_perm_id']) ? $this->_memberData['org_perm_id'] : $this->_memberData['g_perm_id'];
         $this->_memberData['_perm_id_array'] = array_unique(explode(",", $permId));
     }
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:30,代碼來源:class_public_permissions.php

示例8: doExecute

 /**
  * Class entry point
  *
  * @param	object		Registry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $member_id = intval(ipsRegistry::$request['member_id']);
     $md5check = IPSText::md5Clean($this->request['md5check']);
     $CONFIG = array();
     $tab = explode(':', ipsRegistry::$request['tab']);
     $app = substr(IPSText::alphanumericalClean(str_replace('..', '', trim($tab[0]))), 0, 20);
     $tab = substr(IPSText::alphanumericalClean(str_replace('..', '', trim($tab[1]))), 0, 20);
     $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
     //-----------------------------------------
     // MD5 check
     //-----------------------------------------
     if ($md5check != $this->member->form_hash) {
         $this->returnString('error');
     }
     //-----------------------------------------
     // Load member
     //-----------------------------------------
     $member = IPSMember::load($member_id);
     //-----------------------------------------
     // Check
     //-----------------------------------------
     if (!$member['member_id']) {
         $this->returnString('error');
     }
     //-----------------------------------------
     // Load config
     //-----------------------------------------
     if (!is_file(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.conf.php')) {
         $this->returnString('error');
     }
     require IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.conf.php';
     /*noLibHook*/
     //-----------------------------------------
     // Active?
     //-----------------------------------------
     if (!$CONFIG['plugin_enabled']) {
         $this->returnString('error');
     }
     //-----------------------------------------
     // Load main class...
     //-----------------------------------------
     if (!is_file(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.php')) {
         $this->returnString('error');
     }
     require IPSLib::getAppDir('members') . '/sources/tabs/pluginParentClass.php';
     /*noLibHook*/
     $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir($app) . '/extensions/profileTabs/' . $tab . '.php', 'profile_' . $tab, $app);
     $plugin = new $classToLoad($this->registry);
     $html = $plugin->return_html_block($member);
     //-----------------------------------------
     // Return it...
     //-----------------------------------------
     $this->returnHtml($html);
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:64,代碼來源:load.php

示例9: doExecute

 /**
  * Main function executed automatically by the controller
  *
  * @param	object		$registry		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     $member = IPSMember::load(intval($this->request['member']), 'none', 'id');
     if ($member['member_id'] and $this->request['key'] == md5($member['email'] . ':' . $member['members_pass_hash'])) {
         IPSMember::save($member['member_id'], array('members' => array('allow_admin_mails' => 0)));
         $this->registry->getClass('output')->addContent($this->registry->output->getTemplate('ucp')->unsubscribed());
         $this->registry->getClass('output')->sendOutput();
     }
     $this->registry->output->showError('email_no_unsubscribe');
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:16,代碼來源:unsubscribe.php

示例10: doExecute

 /**
  * Class entry point
  *
  * @param	object		Registry reference
  * @return	@e void		[Outputs to screen/redirects]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $info = array();
     $id = intval($this->request['id']);
     //-----------------------------------------
     // Get HTML and skin
     //-----------------------------------------
     $this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
     //-----------------------------------------
     // Can we access?
     //-----------------------------------------
     if (!$this->memberData['g_mem_info']) {
         $this->registry->output->showError('dname_profiles_off', 10233.22, null, null, 403);
     }
     if (!$this->settings['auth_allow_dnames']) {
         $this->registry->output->showError('dnames_off', 10234, null, null, 403);
     }
     if (!$id) {
         $this->registry->output->showError('dnames_no_id', 10235, null, null, 404);
     }
     $member = IPSMember::load($id);
     //-----------------------------------------
     // Get Dname history
     //-----------------------------------------
     $this->DB->build(array('select' => 'd.*', 'from' => array('dnames_change' => 'd'), 'where' => 'dname_member_id=' . $id, 'add_join' => array(0 => array('select' => 'm.members_display_name', 'from' => array('members' => 'm'), 'where' => 'm.member_id=d.dname_member_id', 'type' => 'inner')), 'order' => 'dname_date DESC'));
     $this->DB->execute();
     while ($row = $this->DB->fetch()) {
         $records[] = $row;
     }
     /* Stop Google indexing soft 404s */
     if (!count($records) && !$this->memberData['member_id']) {
         $this->registry->output->showError('404_soft', 10235.1, null, null, 404);
     }
     //-----------------------------------------
     // Print the pop-up window
     //-----------------------------------------
     $html = $this->registry->getClass('output')->getTemplate('profile')->dnameWrapper($member['members_display_name'], $records);
     //-----------------------------------------
     // Push to print handler
     //-----------------------------------------
     $this->registry->getClass('output')->setTitle($this->lang->words['dname_title'] . ' - ' . ipsRegistry::$settings['board_name']);
     $this->registry->getClass('output')->addNavigation($this->lang->words['dname_title'], '');
     $this->registry->getClass('output')->addContent($html);
     $this->registry->output->sendOutput();
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:54,代碼來源:dname.php

示例11: doExecute

 /**
  * Main class entry point
  *
  * @param	object		ipsRegistry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Get member data and format
     //-----------------------------------------
     $user = intval($this->request['user']);
     $id = intval($this->request['id']);
     if (!$user) {
         $this->returnString("no");
     }
     if ($id) {
         $member = IPSMember::buildDisplayData(IPSMember::load($id));
     } else {
         $member = IPSMember::buildDisplayData(IPSMember::setUpGuest($this->lang->words['global_guestname'] . "_" . $user));
     }
     //-----------------------------------------
     // Mod permissions
     //-----------------------------------------
     $my_groups = array($this->memberData['member_group_id']);
     if ($this->memberData['mgroup_others']) {
         $my_groups = array_merge($my_groups, explode(",", IPSText::cleanPermString($this->memberData['mgroup_others'])));
     }
     $permissions = 0;
     $private = 0;
     if ($this->settings['ipschat_mods']) {
         $mod_groups = explode(",", $this->settings['ipschat_mods']);
         foreach ($my_groups as $group_id) {
             if (in_array($group_id, $mod_groups)) {
                 $permissions = 1;
                 break;
             }
         }
     }
     if ($this->settings['ipschat_private']) {
         $mod_groups = explode(",", $this->settings['ipschat_private']);
         foreach ($my_groups as $group_id) {
             if (in_array($group_id, $mod_groups)) {
                 $private = 1;
                 break;
             }
         }
     }
     //-----------------------------------------
     // Return output
     //-----------------------------------------
     $this->returnJsonArray(array('html' => ipsRegistry::getClass('output')->replaceMacros($this->registry->getClass('output')->getTemplate('ipchat')->ajaxNewUser(array('user_id' => $user, 'moderator' => $permissions, 'private' => $private, 'member' => $member))), 'prefix' => $this->settings['ipschat_format_names'] ? str_replace('"', '__DBQ__', $member['prefix']) : '', 'suffix' => $this->settings['ipschat_format_names'] ? str_replace('"', '__DBQ__', $member['suffix']) : '', 'pp_small_photo' => $member['pp_small_photo'], 'name' => $member['members_display_name'], '_canBeIgnored' => $member['member_id'] ? $member['_canBeIgnored'] : 1, 'g_id' => $member['g_id']));
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:53,代碼來源:adduser.php

示例12: doExecute

 /**
  * Class entry point
  *
  * @param	object		Registry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Can we access?
     //-----------------------------------------
     if (!$this->memberData['g_mem_info']) {
         $this->returnString('error');
     }
     $this->registry->class_localization->loadLanguageFile(array('public_profile', 'public_online'), 'members');
     /* Got a valid member? */
     $member_id = intval($this->request['mid']);
     if (empty($member_id)) {
         $this->returnString('error');
     }
     $member = IPSMember::load($member_id, 'profile_portal,pfields_content,sessions,groups,basic', 'id');
     if (empty($member['member_id'])) {
         $this->returnString('error');
     }
     $member = IPSMember::buildDisplayData($member, array('customFields' => 1, 'cfSkinGroup' => 'profile', 'spamStatus' => 1));
     $member = IPSMember::getLocation($member);
     $board_posts = $this->caches['stats']['total_topics'] + $this->caches['stats']['total_replies'];
     if ($member['posts'] and $board_posts) {
         $member['_posts_day'] = round($member['posts'] / ((time() - $member['joined']) / 86400), 2);
         # Fix the issue when there is less than one day
         $member['_posts_day'] = $member['_posts_day'] > $member['posts'] ? $member['posts'] : $member['_posts_day'];
         $member['_total_pct'] = sprintf('%.2f', $member['posts'] / $board_posts * 100);
     }
     $member['_posts_day'] = floatval($member['_posts_day']);
     /* Load status class */
     if (!$this->registry->isClassLoaded('memberStatus')) {
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/member/status.php', 'memberStatus');
         $this->registry->setClass('memberStatus', new $classToLoad(ipsRegistry::instance()));
     }
     /* Fetch */
     $member['_status'] = $this->registry->getClass('memberStatus')->fetch($this->memberData, array('member_id' => $member['member_id'], 'limit' => 1));
     if (is_array($member['_status']) and count($member['_status'])) {
         $member['_status'] = array_pop($member['_status']);
     }
     /* Reputation */
     if ($this->settings['reputation_protected_groups']) {
         if (in_array($member['member_group_id'], explode(",", $this->settings['reputation_protected_groups']))) {
             $this->settings['reputation_show_profile'] = false;
         }
     }
     $this->returnHtml($this->registry->getClass('output')->getTemplate('profile')->showCard($member));
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:52,代碼來源:card.php

示例13: getDisplayContent

 /**
  * Returns HTML tabs content for the page
  *
  * @param	array		$member		Member data
  * @return	@e array Array of 'tabs' (HTML for the tabs), 'content' (HTML for the content)
  */
 public function getDisplayContent($member = array())
 {
     //-----------------------------------------
     // Load skin
     //-----------------------------------------
     $html = ipsRegistry::getClass('output')->loadTemplate('cp_skin_chat', 'ipchat');
     //-----------------------------------------
     // Load lang
     //-----------------------------------------
     ipsRegistry::getClass('class_localization')->loadLanguageFile(array('admin_chat'), 'ipchat');
     //-----------------------------------------
     // Get member data
     //-----------------------------------------
     $member = IPSMember::load($member['member_id'], 'extendedProfile');
     //-----------------------------------------
     // Show...
     //-----------------------------------------
     return array('tabs' => $html->acp_member_form_tabs($member), 'content' => $html->acp_member_form_main($member));
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:25,代碼來源:member_form.php

示例14: doExecute

 /**
  * Main class entry point
  *
  * @param	object		ipsRegistry reference
  * @return	@e void		[Outputs to screen]
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Got sess ID and mem ID?
     //-----------------------------------------
     if (!$this->member->getProperty('member_id')) {
         $this->returnString("no");
     }
     //-----------------------------------------
     // Get data
     //-----------------------------------------
     $block = $this->request['block'] ? true : false;
     $id = intval($this->request['id']);
     if (!$id) {
         $this->returnString("no");
     }
     //-----------------------------------------
     // Get member record and verify we can ignore
     //-----------------------------------------
     $member = IPSMember::load($id, 'core');
     if ($member['_canBeIgnored'] !== TRUE) {
         $this->returnString("no");
     }
     //-----------------------------------------
     // Get ignore record
     //-----------------------------------------
     $_ignore = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'ignored_users', 'where' => "ignore_owner_id=" . $this->memberData['member_id'] . ' AND ignore_ignore_id=' . $id));
     if ($_ignore['ignore_id']) {
         $this->DB->update('ignored_users', array('ignore_chats' => $block ? 1 : 0), 'ignore_id=' . $_ignore['ignore_id']);
     } else {
         $_ignore = array('ignore_owner_id' => $this->memberData['member_id'], 'ignore_ignore_id' => $id, 'ignore_chats' => 1);
         $this->DB->insert('ignored_users', $_ignore);
     }
     //-----------------------------------------
     // Update cache
     //-----------------------------------------
     IPSMember::rebuildIgnoredUsersCache($this->memberData);
     //-----------------------------------------
     // Something to return
     //-----------------------------------------
     $this->returnString("ok");
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:48,代碼來源:block.php

示例15: displayNameCheck

 /**
  * Checks a display name
  *
  * @return	@e void		[Outputs JSON to browser AJAX call]
  */
 protected function displayNameCheck()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $name = strtolower($this->convertAndMakeSafe($this->request['name'], 0));
     $name = str_replace("&#43;", "+", $name);
     $member = array();
     $return = TRUE;
     $id = intval($this->request['member_id']);
     # Set member ID
     $id = $this->memberData['member_id'] ? $this->memberData['member_id'] : $id;
     //-----------------------------------------
     // Load member if required
     //-----------------------------------------
     if ($id != $this->memberData['member_id']) {
         $member = IPSMember::load($id, 'all');
     } else {
         $member = $this->member->fetchMemberData();
     }
     //-----------------------------------------
     // Test name
     //-----------------------------------------
     try {
         $return = IPSMember::getFunction()->checkNameExists($name, $member);
     } catch (Exception $error) {
         $_msg = $error->getMessage();
         if ($_msg == 'NO_MORE_CHANGES') {
             $this->returnString('nomorechanges');
             return;
         }
         # Really, we're not very interested why it didn't work at this point, so
         # just return with a 'found' string which will make a nice red cross and
         # force the user to choose another.
         $this->returnString('found');
         return;
     }
     //-----------------------------------------
     // So, what's it to be?
     //-----------------------------------------
     $this->returnString($return === TRUE ? 'found' : 'notfound');
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:47,代碼來源:usercp.php


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