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


PHP IPSMember::buildDisplayData方法代碼示例

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


在下文中一共展示了IPSMember::buildDisplayData方法的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: 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

示例3: 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

示例4: remove_photo

 /**
  * Remove user's photo
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function remove_photo()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $member_id = intval($this->request['member_id']);
     //-----------------------------------------
     // Get member
     //-----------------------------------------
     $member = IPSMember::load($member_id);
     if (!$member['member_id']) {
         $this->returnJsonError($this->lang->words['m_noid']);
         exit;
     }
     //-----------------------------------------
     // Allowed to upload pics for administrators?
     //-----------------------------------------
     if ($member['g_access_cp'] and !$this->registry->getClass('class_permissions')->checkPermission('member_photo_admin', 'members', 'members')) {
         $this->returnJsonError($this->lang->words['m_editadmin']);
         exit;
     }
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/member/photo.php', 'classes_member_photo');
     $photos = new $classToLoad($this->registry);
     $photos->remove($member_id);
     ipsRegistry::getClass('adminFunctions')->saveAdminLog(sprintf($this->lang->words['m_imgremlog'], $member_id));
     $member = IPSMember::load($member_id);
     $member = IPSMember::buildDisplayData($member, 0);
     //-----------------------------------------
     // Return
     //-----------------------------------------
     $this->returnJsonArray(array('success' => 1, 'pp_main_photo' => $member['pp_main_photo'], 'pp_main_width' => $member['pp_main_width'], 'pp_main_height' => $member['pp_main_height']));
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:37,代碼來源:editform.php

示例5: getOutput

 public function getOutput()
 {
     /* INIT */
     $time_high = time();
     $ids = array();
     $rows = array();
     $time_low = $time_high - 60 * 60 * 24;
     $todays_posts = 0;
     $store = array();
     /* List of forum ids */
     foreach (ipsRegistry::getClass('class_forums')->forum_by_id as $id => $data) {
         if (!isset($data['inc_postcount']) || !$data['inc_postcount']) {
             continue;
         }
         $ids[] = $id;
     }
     /* Found some forums? */
     if (count($ids)) {
         /* Total Posts Today */
         /*$total_today = $this->DB->buildAndFetch( array( 
         					'select'   => 'count(*) as cnt',
         					'from'     => array( 'posts' => 'p' ),
         					'where'    => "p.post_date > {$time_low} AND t.forum_id IN(" . implode( ",", $ids ) . ")",
         					'add_join' => array(
         										array( 
         												'from'	=> array( 'topics' => 't' ),
         												'where'	=> 't.tid=p.topic_id',
         												'type'	=> 'left' 
         											)
         										)
         		)		);*/
         /* Query the top posters */
         $this->DB->build(array('select' => 'COUNT(*) as tpost', 'from' => array('posts' => 'p'), 'where' => "p.post_date > {$time_low} AND t.forum_id IN(" . implode(",", $ids) . ")", 'group' => 'p.author_id', 'order' => 'tpost DESC', 'limit' => array(0, 9), 'add_join' => array(array('from' => array('topics' => 't'), 'where' => 't.tid=p.topic_id', 'type' => 'left'), array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => 'm.member_id=p.author_id', 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left'))));
         $this->DB->execute();
         /* Loop through and save the members */
         while ($r = $this->DB->fetch()) {
             $todays_posts += $r['tpost'];
             $store[] = $r;
         }
         /* Format the results for output */
         if ($todays_posts) {
             foreach ($store as $info) {
                 $info['total_today_posts'] = $todays_posts;
                 if ($todays_posts > 0 and $info['tpost'] > 0) {
                     //$info['today_pct'] = sprintf( '%.2f',  ( $info['tpost'] / $total_today['cnt'] ) * 100  );
                 }
                 $rows[] = IPSMember::buildDisplayData($info);
             }
         }
     }
     return $this->registry->getClass('output')->getTemplate('boards')->hookTopPosters($rows);
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:52,代碼來源:boardIndexTopPosters_94912bfecad274ecb4f92df77d579225.php

示例6: 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

示例7: return_html_block

 /**
  * Feturn HTML block
  *
  * @param	array		Member information
  * @return	string		HTML block
  */
 public function return_html_block($member = array())
 {
     //-----------------------------------------
     // Got a member?
     //-----------------------------------------
     if (!is_array($member) or !count($member)) {
         return $this->registry->getClass('output')->getTemplate('profile')->tabNoContent('err_no_aboutme_to_show');
     }
     $friends = array();
     //-----------------------------------------
     // Grab the friends
     //-----------------------------------------
     /* How many friends do we have? */
     $count = $this->DB->buildAndFetch(array('select' => 'count(*) as dracula', 'from' => 'profile_friends', 'where' => 'friends_member_id=' . $member['member_id'] . ' AND friends_approved=1'));
     /* Sort out pagination */
     $st = intval($this->request['st']) >= 0 ? intval($this->request['st']) : 0;
     $pagination = $this->registry->output->generatePagination(array('totalItems' => $count['dracula'], 'itemsPerPage' => self::FRIENDS_PER_PAGE, 'currentStartValue' => $st, 'baseUrl' => "showuser={$member['member_id']}&amp;tab=friends", 'seoTemplate' => 'showuser', 'seoTitle' => $member['members_seo_name']));
     /* Get em! */
     $queryData = array('select' => 'f.*', 'from' => array('profile_friends' => 'f'), 'where' => 'f.friends_member_id=' . $member['member_id'] . ' AND f.friends_approved=1 AND m.member_banned=0 AND ( ! ' . IPSBWOptions::sql('bw_is_spammer', 'members_bitoptions', 'members', 'global', 'has') . ')', 'add_join' => array(1 => array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=f.friends_friend_id', 'type' => 'left'), 2 => array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => 'm.member_id=f.friends_friend_id', 'type' => 'left')));
     // Ordering is bad because it causes a filesort, but if they have more than 100 members, we're going to have
     // to order so we can paginate
     if ($count['dracula'] > self::FRIENDS_PER_PAGE) {
         $queryData['order'] = 'm.members_display_name';
         $queryData['limit'] = array($st, self::FRIENDS_PER_PAGE);
     }
     $this->DB->build($queryData);
     $outer = $this->DB->execute();
     //-----------------------------------------
     // Get and store...
     //-----------------------------------------
     while ($row = $this->DB->fetch($outer)) {
         if ($row['member_id']) {
             $friends[IPSText::mbstrtolower($row['members_display_name'])] = IPSMember::buildDisplayData($row, 0);
         }
     }
     ksort($friends);
     $content = $this->registry->getClass('output')->getTemplate('profile')->tabFriends($friends, $member, $pagination);
     //-----------------------------------------
     // Macros...
     //-----------------------------------------
     $content = $this->registry->output->replaceMacros($content);
     //-----------------------------------------
     // Return content..
     //-----------------------------------------
     return $content ? $content : $this->registry->getClass('output')->getTemplate('profile')->tabNoContent('err_no_aboutme_to_show');
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:52,代碼來源:friends.php

示例8: 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

示例9: executeFeed


//.........這裏部分代碼省略.........
     if ($config['filters']['filter_groups']) {
         $where[] = "m.member_group_id IN(" . $config['filters']['filter_groups'] . ")";
     }
     if ($config['filters']['filter_posts']) {
         $where[] = "m.posts > " . $config['filters']['filter_posts'];
     }
     if ($config['filters']['filter_bday_day']) {
         $where[] = "m.bday_day=" . date('j') . " AND m.bday_month=" . date('n');
     }
     if ($config['filters']['filter_bday_mon']) {
         $where[] = "m.bday_month=" . date('n');
     }
     if ($config['filters']['filter_has_blog']) {
         $where[] = "m.has_blog=1";
     }
     if ($config['filters']['filter_has_gallery']) {
         $where[] = "m.has_gallery=1";
     }
     if ($config['filters']['filter_min_rating']) {
         $where[] = "p.pp_rating_value >= " . $config['filters']['filter_min_rating'];
     }
     if ($config['filters']['filter_min_rep']) {
         $where[] = "p.pp_reputation_points >= " . $config['filters']['filter_min_rep'];
     }
     $order = '';
     switch ($config['sortby']) {
         case 'name':
             $order .= "m.members_display_name ";
             break;
         default:
         case 'posts':
             $order .= "m.posts ";
             break;
         case 'joined':
             $order .= "m.joined ";
             break;
         case 'last_active':
             $order .= "m.last_active ";
             break;
         case 'last_post':
             $order .= "m.last_post ";
             break;
         case 'age':
             $where[] = "bday_year IS NOT NULL AND bday_year > 0";
             $order .= "m.bday_year " . $config['sortorder'] . ",m.bday_mon " . $config['sortorder'] . ",m.bday_day ";
             break;
         case 'profile_views':
             $order .= "m.members_profile_views ";
             break;
         case 'status_update':
             $order .= "p.pp_status_update ";
             break;
         case 'rating':
             $order .= "p.pp_rating_value ";
             break;
         case 'rep':
             $order .= "p.pp_reputation_points ";
             break;
         case 'rand':
             $order .= "RAND() ";
             break;
     }
     $order .= $config['sortorder'];
     //-----------------------------------------
     // Run the query and get the results
     //-----------------------------------------
     $members = array();
     $this->DB->build(array('select' => 'm.*, m.member_id as mid', 'from' => array('members' => 'm'), 'where' => implode(' AND ', $where), 'order' => $order, 'limit' => array($config['offset_a'], $config['offset_b']), 'add_join' => array(array('select' => 'p.*', 'from' => array('profile_portal' => 'p'), 'where' => 'p.pp_member_id=m.member_id', 'type' => 'left'), array('select' => 'pf.*', 'from' => array('pfields_content' => 'pf'), 'where' => 'pf.member_id=m.member_id', 'type' => 'left'), array('select' => 's.*', 'from' => array('sessions' => 's'), 'where' => 's.member_id=m.member_id', 'type' => 'left'))));
     $this->DB->execute();
     while ($r = $this->DB->fetch()) {
         //-----------------------------------------
         // Normalization
         //-----------------------------------------
         $r['member_id'] = $r['mid'];
         $r['url'] = $this->registry->output->buildSEOUrl($this->settings['board_url'] . '/index.php?showuser=' . $r['member_id'], 'none', $r['members_seo_name'], 'showuser');
         $r['title'] = $r['members_display_name'];
         $r['date'] = $r['joined'];
         $r['content'] = $r['pp_about_me'];
         IPSText::getTextClass('bbcode')->parse_smilies = $this->settings['aboutme_emoticons'];
         IPSText::getTextClass('bbcode')->parse_html = intval($this->settings['aboutme_html']);
         IPSText::getTextClass('bbcode')->parse_nl2br = 1;
         IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['aboutme_bbcode'];
         IPSText::getTextClass('bbcode')->parsing_section = 'aboutme';
         IPSText::getTextClass('bbcode')->parsing_mgroup = $r['member_group_id'];
         IPSText::getTextClass('bbcode')->parsing_mgroup_others = $r['mgroup_others'];
         $r['content'] = IPSText::getTextClass('bbcode')->preDisplayParse($r['content']);
         $r['content'] = IPSText::getTextClass('bbcode')->memberViewImages($r['content']);
         $r = IPSMember::buildDisplayData($r);
         $members[] = $r;
     }
     //-----------------------------------------
     // Return formatted content
     //-----------------------------------------
     $feedConfig = $this->returnFeedInfo();
     $templateBit = $feedConfig['templateBit'] . '_' . $block['block_id'];
     if ($config['hide_empty'] and !count($members)) {
         return '';
     }
     return $this->registry->output->getTemplate('ccs')->{$templateBit}($block['block_name'], $members);
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:101,代碼來源:members.php

示例10: executePlugin

 /**
  * Execute plugin
  *
  * @param	array 	$permissions	Moderator permissions
  * @return	@e string
  */
 public function executePlugin($permissions)
 {
     //-----------------------------------------
     // Check permissions
     //-----------------------------------------
     if (!$this->canView($permissions)) {
         return '';
     }
     /* Add some CSS.. */
     $this->registry->output->addToDocumentHead('importcss', "{$this->settings['css_base_url']}style_css/{$this->registry->output->skin['_csscacheid']}/ipb_mlist.css");
     //-----------------------------------------
     // Get 10 members on suspension
     //-----------------------------------------
     $st = intval($this->request['st']);
     $total = $this->DB->buildAndFetch(array('select' => 'count(*) as members', 'from' => 'members', 'where' => "temp_ban!=0 AND temp_ban!='' AND temp_ban " . $this->DB->buildIsNull(false)));
     $members = array();
     $this->DB->build(array('select' => 'm.*', 'from' => array('members' => 'm'), 'order' => 'm.joined DESC', 'limit' => array($st, 10), 'where' => "m.temp_ban!=0 AND m.temp_ban!='' AND m.temp_ban " . $this->DB->buildIsNull(false), 'add_join' => array(array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'm.member_id=pp.pp_member_id', 'type' => 'left'))));
     $outer = $this->DB->execute();
     while ($r = $this->DB->fetch($outer)) {
         $mod_arr = IPSMember::processBanEntry($r['temp_ban']);
         if ($mod_arr['date_end'] and $mod_arr['date_end'] < time()) {
             IPSMember::save($r['member_id'], array('core' => array('temp_ban' => 0)));
             continue;
         }
         if ($mod_arr['date_start'] == 1) {
             $r['_language'] = $this->lang->words['modcp_modq_indef'];
         } else {
             $r['_language'] = $this->registry->getClass('class_localization')->getDate($mod_arr['date_end'], 'SHORT');
         }
         $members[] = IPSMember::buildDisplayData($r);
     }
     //-----------------------------------------
     // Page links
     //-----------------------------------------
     $pages = $this->registry->output->generatePagination(array('totalItems' => $total['members'], 'itemsPerPage' => 10, 'currentStartValue' => $st, 'baseUrl' => "app=core&amp;module=modcp&amp;fromapp=members&amp;tab=suspended"));
     return $this->registry->output->getTemplate('modcp')->membersList('suspended', $members, $pages);
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:43,代碼來源:plugin_suspended.php

示例11: _displayReport

 /**
  * Handles ajax/non-ajax window for reports and comments linked from reports
  *
  * @access	private
  * @return	boolean
  */
 private function _displayReport()
 {
     //-----------------------------------------
     // Lets make sure this report exists...
     //-----------------------------------------
     $rid = intval($this->request['rid']);
     $options = array('rid' => $rid);
     $reports = array();
     $comments = array();
     if (!$rid) {
         $this->registry->output->showError('reports_no_rid', 10137);
     }
     $this->registry->class_localization->loadLanguageFile(array('public_editors'));
     $report_index = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'rc_reports_index', 'where' => "id=" . $rid));
     //-----------------------------------------
     // Basic title and nav routine..
     //-----------------------------------------
     $this->registry->output->addNavigation($this->lang->words['main_title'], 'app=core&amp;module=reports&amp;do=index');
     $this->registry->output->addNavigation($report_index['title'], '');
     if ($this->DB->getTotalRows() == 0) {
         $this->registry->output->showError('reports_no_rid', 10138);
     }
     $COM_PERM = $this->registry->getClass('reportLibrary')->buildQueryPermissions();
     IPSText::getTextClass('bbcode')->parse_bbcode = 1;
     IPSText::getTextClass('bbcode')->parse_html = 0;
     IPSText::getTextClass('bbcode')->parse_emoticons = 1;
     IPSText::getTextClass('bbcode')->parse_nl2br = 0;
     IPSText::getTextClass('bbcode')->parsing_section = 'global';
     //-----------------------------------------
     // Get reports
     //-----------------------------------------
     $this->DB->buildFromCache('grab_report', array('COM' => $COM_PERM, 'rid' => $rid), 'report_sql_queries');
     $outer = $this->DB->execute();
     while ($row = $this->DB->fetch($outer)) {
         IPSText::getTextClass('bbcode')->parsing_mgroup = $row['member_group_id'];
         IPSText::getTextClass('bbcode')->parsing_mgroup_others = $row['mgroup_others'];
         $row['points'] = isset($row['points']) ? $row['points'] : $this->settings['_tmpPoints'][$row['id']];
         if (!$options['url'] && $row['url']) {
             $options['url'] = $this->registry->getClass('reportLibrary')->processUrl($row['url'], $row['seoname'], $row['seotemplate']);
         }
         if (!$options['class'] && $row['my_class']) {
             $options['class'] = $row['my_class'];
         }
         if ($row['my_class'] == 'messages' && !$options['topicID'] && $row['exdat1']) {
             $options['topicID'] = intval($row['exdat1']);
         }
         $options['title'] = $row['title'];
         $options['status_id'] = $row['status'];
         if (!$options['image'] && $row['img_preview']) {
             $options['image'] = $this->registry->getClass('reportLibrary')->processUrl($row['img_preview'], $row['seoname'], $row['seotemplate']);
         }
         if (!$options['status_icon']) {
             $options['status_icon'] = $this->_buildStatusIcon($row);
             $options['status_text'] = $this->registry->getClass('reportLibrary')->flag_cache[$row['status']][$row['points']]['title'];
         }
         $row['report'] = IPSText::getTextClass('bbcode')->preDisplayParse($row['report']);
         $row['report'] = IPSText::getTextClass('bbcode')->memberViewImages($row['report']);
         $reports[$row['id']] = $row;
     }
     if (!$options['class']) {
         $this->registry->output->showError('reports_no_rid', 10138);
     }
     $_tmp = $this->registry->getClass('reportLibrary')->flag_cache;
     // Manually build array get just the statuses, not severities
     foreach ($_tmp as $sid => $sta) {
         if (is_array($sta) && count($sta)) {
             foreach ($sta as $points => $info) {
                 if ($options['statuses'][$sid]) {
                     break;
                 }
                 $options['statuses'][$sid] = $info;
             }
         }
     }
     //-----------------------------------------
     // Get comments
     //-----------------------------------------
     $ids = array(0 => 0);
     $this->DB->build(array('select' => 'id', 'from' => 'rc_comments', 'where' => 'rid=' . $rid, 'group' => 'id'));
     $this->DB->execute();
     while ($row = $this->DB->fetch()) {
         $ids[$row['id']] = $row['id'];
     }
     $this->DB->build(array('select' => 'comm.*', 'from' => array('rc_comments' => 'comm'), 'where' => 'comm.id IN (' . implode(',', $ids) . ')', 'order' => 'comm.comment_date ASC', 'add_join' => array(array('select' => 'mem.*', 'from' => array('members' => 'mem'), 'where' => 'mem.member_id=comm.comment_by'), array('select' => 'grop.*,grop.g_is_supmod as iscop', 'from' => array('groups' => 'grop'), 'where' => 'grop.g_id=mem.member_group_id'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=mem.member_id'))));
     $outer = $this->DB->execute();
     while ($row = $this->DB->fetch($outer)) {
         IPSText::getTextClass('bbcode')->parsing_mgroup = $row['member_group_id'];
         IPSText::getTextClass('bbcode')->parsing_mgroup_others = $row['mgroup_others'];
         $row['author'] = IPSMember::buildDisplayData($row['member_id']);
         $row['comment'] = IPSText::getTextClass('bbcode')->preDisplayParse($row['comment']);
         $row['comment'] = IPSText::getTextClass('bbcode')->memberViewImages($row['comment']);
         $comments[$row['id']] = $row;
     }
     //-----------------------------------------
//.........這裏部分代碼省略.........
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:101,代碼來源:reports.php

示例12: buildComments

 /**
  * Builds comments
  *
  * @access	public
  * @param	array 		Member information
  * @param	boolean		Use a new id
  * @param	string		Message to display
  * @return	string		Comment HTML
  * @since	IPB 2.2.0.2006-08-02
  */
 public function buildComments($member, $new_id = 0, $return_msg = '')
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $comments = array();
     $member_id = intval($member['member_id']);
     $comment_perpage = 15;
     //intval( $member['pp_setting_count_comments'] );
     $comment_html = 0;
     $comment_start = intval($this->request['st']);
     $comment_approved = ($this->memberData['member_id'] == $member['member_id'] or $this->memberData['g_is_supmod']) ? '' : ' AND ( pc.comment_approved=1 OR ( pc.comment_approved=0 AND pc.comment_by_member_id=' . $member_id . ') )';
     //-----------------------------------------
     // Not showing comments?
     //-----------------------------------------
     if ($comment_perpage < 1) {
         return '';
     }
     //-----------------------------------------
     // Regenerate comments...
     //-----------------------------------------
     $this->DB->build(array('select' => 'pc.*', 'from' => array('profile_comments' => 'pc'), 'where' => 'pc.comment_for_member_id=' . $member_id . $comment_approved, 'order' => 'pc.comment_date DESC', 'limit' => array($comment_start, $comment_perpage), 'calcRows' => TRUE, 'add_join' => array(array('select' => 'm.members_display_name, m.members_seo_name, m.posts, m.last_activity, m.member_group_id, m.member_id, m.last_visit, m.warn_level', 'from' => array('members' => 'm'), 'where' => 'm.member_id=pc.comment_by_member_id', 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left'))));
     $o = $this->DB->execute();
     $max = $this->DB->fetchCalculatedRows();
     while ($row = $this->DB->fetch($o)) {
         $row['_comment_date'] = ipsRegistry::getClass('class_localization')->getDate($row['comment_date'], 'TINY');
         $row = IPSMember::buildDisplayData($row);
         if (!$row['members_display_name_short']) {
             $row = array_merge($row, IPSMember::setUpGuest());
         }
         $comments[] = $row;
     }
     //-----------------------------------------
     // Pagination
     //-----------------------------------------
     $links = $this->registry->output->generatePagination(array('totalItems' => $max, 'itemsPerPage' => $comment_perpage, 'currentStartValue' => $comment_start, 'baseUrl' => "showuser={$member_id}", 'seoTitle' => $member['members_seo_name']));
     $comment_html = $this->registry->getClass('output')->getTemplate('profile')->showComments($member, $comments, $new_id, $return_msg, $links);
     //-----------------------------------------
     // Return it...
     //-----------------------------------------
     return $comment_html;
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:52,代碼來源:comments.php

示例13: getSearchResults

 /**
  * Get search results
  *
  * @param	int		$st				Start offset
  * @param	int		$limit			Results limit
  * @param	string	[$extraQuery]	Extra query where clause
  * @param	bool	[$minimalInfo]	Only return ids, names and groups
  * @return	array 	Array of search results, or an array with keys 'ids' and 'names' if $minimalInfo is true
  */
 public function getSearchResults($st, $limit, $extraQuery = '', $minimalInfo = false)
 {
     $extra = $extraQuery ? " AND " . $extraQuery : '';
     $members = array();
     $ids = array();
     $names = array();
     $groups = array();
     //-----------------------------------------
     // Build query
     //-----------------------------------------
     $query = array('select' => 'm.*, m.member_id as mem_id, m.ip_address as mem_ip', 'from' => array('members' => 'm'), 'where' => $this->getWhereClause() . $extra, 'order' => $this->getOrderByClause(), 'add_join' => array(array('select' => 'p.*', 'from' => array('pfields_content' => 'p'), 'where' => 'p.member_id=m.member_id', 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left'), array('select' => 'par.*', 'from' => array('members_partial' => 'par'), 'where' => 'par.partial_member_id=m.member_id', 'type' => 'left'), array('select' => 'val.*', 'from' => array('validating' => 'val'), 'where' => 'val.member_id=m.member_id', 'type' => 'left')));
     if ($st or $limit) {
         $query['limit'] = array($st, $limit);
     }
     //-----------------------------------------
     // Execute query and return results
     //-----------------------------------------
     $this->DB->build($query);
     $outer = $this->DB->execute();
     while ($r = $this->DB->fetch($outer)) {
         if ($minimalInfo) {
             $ids[$r['mem_id']] = $r['mem_id'];
             $names[$r['mem_id']] = $r['members_display_name'];
             $groups[$r['mem_id']] = $r['member_group_id'];
         } else {
             $r['member_id'] = $r['mem_id'];
             $r['ip_address'] = $r['mem_ip'];
             $r['_joined'] = $this->registry->class_localization->getDate($r['joined'], 'JOINED');
             $r['group_title'] = $this->caches['group_cache'][$r['member_group_id']]['g_title'];
             $members[$r['member_id']] = IPSMember::buildDisplayData($r);
         }
     }
     return $minimalInfo ? array('ids' => $ids, 'names' => $names, 'groups' => $groups) : $members;
 }
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:43,代碼來源:adminSearch.php

示例14: doExecute


//.........這裏部分代碼省略.........
         $this->cache->setCache('adminnotes', $text, array('donow' => 1, 'deletefirst' => 0, 'array' => 0));
     }
     $this->cache->updateCacheWithoutSaving('adminnotes', htmlspecialchars($this->cache->getCache('adminnotes'), ENT_QUOTES));
     $this->cache->updateCacheWithoutSaving('adminnotes', str_replace("&amp;#", "&#", $this->cache->getCache('adminnotes')));
     $content['ad_notes'] = $this->html->acp_notes($this->cache->getCache('adminnotes'));
     //-----------------------------------------
     // ADMINS USING CP
     //-----------------------------------------
     $t_time = time() - 60 * 10;
     $time_now = time();
     $seen_name = array();
     $acponline = "";
     $this->DB->build(array('select' => 's.session_member_name, s.session_member_id, s.session_location, s.session_log_in_time, s.session_running_time, s.session_ip_address, s.session_url', 'from' => array('core_sys_cp_sessions' => 's'), 'add_join' => array(array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => "m.member_id=s.session_member_id", 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left'))));
     $q = $this->DB->execute();
     while ($r = $this->DB->fetch($q)) {
         if (isset($seen_name[$r['session_member_name']]) and $seen_name[$r['session_member_name']] == 1) {
             continue;
         } else {
             $seen_name[$r['session_member_name']] = 1;
         }
         $r['_log_in'] = $time_now - $r['session_log_in_time'];
         $r['_click'] = $time_now - $r['session_running_time'];
         if ($r['_log_in'] / 60 < 1) {
             $r['_log_in'] = sprintf("%0d", $r['_log_in']) . $this->lang->words['cp_secondsago'];
         } else {
             $r['_log_in'] = sprintf("%0d", $r['_log_in'] / 60) . $this->lang->words['cp_minutesago'];
         }
         if ($r['_click'] / 60 < 1) {
             $r['_click'] = sprintf("%0d", $r['_click']) . $this->lang->words['cp_secondsago'];
         } else {
             $r['_click'] = sprintf("%0d", $r['_click'] / 60) . $this->lang->words['cp_minutesago'];
         }
         $r['session_location'] = $r['session_location'] ? "<a href='" . preg_replace('/&amp;app=([a-zA-Z0-9\\-_]+)/', '', $this->settings['base_url']) . $r['session_url'] . "'>{$r['session_location']}</a>" : $this->lang->words['cp_index'];
         $acponline .= $this->html->acp_onlineadmin_row(IPSMember::buildDisplayData($r));
     }
     $content['acp_online'] = $this->html->acp_onlineadmin_wrapper($acponline);
     //-----------------------------------------
     // Stats
     //-----------------------------------------
     $reg = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as reg', 'from' => array('validating' => 'v'), 'where' => 'v.lost_pass <> 1 AND m.member_group_id=' . $this->settings['auth_group'], 'add_join' => array(array('from' => array('members' => 'm'), 'where' => 'm.member_id=v.member_id', 'type' => 'left'))));
     if ($this->settings['ipb_bruteforce_attempts']) {
         $lock = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as mems', 'from' => 'members', 'where' => 'failed_login_count >= ' . $this->settings['ipb_bruteforce_attempts']));
     }
     $coppa = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as coppa', 'from' => 'validating', 'where' => 'coppa_user=1'));
     $my_timestamp = time() - $this->settings['au_cutoff'] * 60;
     $online = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as sessions', 'from' => 'sessions', 'where' => 'running_time>' . $my_timestamp));
     $pending = $this->DB->buildAndFetch(array('select' => 'SUM(queued_topics) as topics, SUM(queued_posts) as posts', 'from' => 'forums'));
     $spammers = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as count, MAX(joined) as joined', 'from' => 'members', 'where' => "members_bitoptions = '1'"));
     $content['stats'] = $this->html->acp_stats_wrapper(array('topics' => intval($this->caches['stats']['total_topics']), 'replies' => intval($this->caches['stats']['total_replies']), 'topics_mod' => intval($pending['topics']), 'posts_mod' => intval($pending['posts']), 'members' => intval($this->caches['stats']['mem_count']), 'validate' => intval($reg['reg']), 'spammer' => array(intval($spammers['count']), intval($spammers['joined'])), 'locked' => intval($lock['mems']), 'coppa' => intval($coppa['coppa']), 'sql_driver' => strtoupper(SQL_DRIVER), 'sql_version' => $this->DB->true_version, 'php_version' => phpversion(), 'sessions' => intval($online['sessions']), 'php_sapi' => @php_sapi_name(), 'ipb_version' => ipsRegistry::$version, 'ipb_id' => ipsRegistry::$vn_full));
     //-----------------------------------------
     // Members awaiting admin validation?
     //-----------------------------------------
     if ($this->settings['reg_auth_type'] == 'admin_user' or $this->settings['reg_auth_type'] == 'admin') {
         $where_extra = $this->settings['reg_auth_type'] == 'admin_user' ? ' AND user_verified=1' : '';
         $admin_reg = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as reg', 'from' => 'validating', 'where' => 'new_reg=1' . $where_extra));
         if ($admin_reg['reg'] > 0) {
             // We have some member's awaiting admin validation
             $data = null;
             $this->DB->build(array('select' => 'v.*', 'from' => array('validating' => 'v'), 'where' => 'new_reg=1' . $where_extra, 'limit' => array(3), 'add_join' => array(array('type' => 'left', 'select' => 'm.members_display_name, m.email, m.ip_address', 'from' => array('members' => 'm'), 'where' => 'm.member_id=v.member_id'))));
             $this->DB->execute();
             while ($r = $this->DB->fetch()) {
                 if ($r['coppa_user'] == 1) {
                     $r['_coppa'] = ' ( COPPA )';
                 } else {
                     $r['_coppa'] = "";
                 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:67,代碼來源:dashboard.php

示例15: fetchAllReplies

 /**
  * Fetch all replies to a status
  * Default filters are sorted on reply_date ASC
  *
  * @param	mixed	[Array of member data OR member ID INT for member updating their status - will use ->getAuthor() if null]	
  * @param	array	Array of sort/filter data ( member_id [int], latest_only [0,1], offset [int], limit [int], unix_cutoff [int], sort_dir [asc,desc], sort_field [string] )
  */
 public function fetchAllReplies($status = null, $filters = array())
 {
     $status = $status === null ? $this->_internalData['StatusData'] : (is_array($status) ? $status : $this->_loadStatus($status));
     $where = array();
     $replies = array();
     $sort_dir = $filters['sort_dir'] == 'desc' ? 'desc' : 'asc';
     $sort_field = isset($filters['sort_field']) ? $filters['sort_field'] : 'reply_date';
     $offset = isset($filters['offset']) ? intval($filters['offset']) : 0;
     $limit = isset($filters['limit']) ? intval($filters['limit']) : 100;
     /* Grab them */
     $this->DB->build(array('select' => 's.*', 'from' => array('member_status_replies' => 's'), 'where' => 's.reply_status_id=' . intval($status['status_id']), 'order' => 's.' . $sort_field . ' ' . $sort_dir, 'limit' => array($offset, $limit), 'add_join' => array(array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => 'm.member_id=s.reply_member_id', 'type' => 'left'), array('select' => 'pp.*', 'from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left'))));
     $o = $this->DB->execute();
     while ($row = $this->DB->fetch($o)) {
         /* Format some data */
         $row['reply_date_formatted'] = $this->registry->getClass('class_localization')->getDate($row['reply_date'], 'SHORT');
         $row['_canDelete'] = $this->canDeleteReply($this->getAuthor(), $row, $status);
         /* Format member */
         $row = IPSMember::buildDisplayData($row, array('reputation' => 0, 'warn' => 0));
         $replies[$row['reply_id']] = $row;
     }
     /* Phew */
     return $replies;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:30,代碼來源:status.php


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