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


PHP IPSMember::buildProfilePhoto方法代碼示例

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


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

示例1: _getMemberNames

 /**
  * Returns possible matches for the string input
  *
  * @access	private
  * @return	void		Outputs to screen
  */
 private function _getMemberNames()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $name = $this->convertAndMakeSafe(ipsRegistry::$request['name'], 0);
     //-----------------------------------------
     // Check length
     //-----------------------------------------
     if (IPSText::mbstrlen($name) < 3) {
         $this->returnJsonError('requestTooShort');
     }
     //-----------------------------------------
     // Try query...
     //-----------------------------------------
     $this->DB->build(array('select' => 'm.members_display_name, m.name, m.member_id, m.member_group_id', 'from' => array('members' => 'm'), 'where' => "LOWER(m.members_display_name) LIKE '" . $this->DB->addSlashes($name) . "%'", 'order' => $this->DB->buildLength('m.members_display_name') . ' ASC', 'limit' => array(0, 15), 'add_join' => array(array('select' => 'p.*', 'from' => array('profile_portal' => 'p'), 'where' => 'p.pp_member_id=m.member_id', 'type' => 'left'))));
     $this->DB->execute();
     //-----------------------------------------
     // Got any results?
     //-----------------------------------------
     if (!$this->DB->getTotalRows()) {
         $this->returnJsonArray(array());
     }
     $return = array();
     while ($r = $this->DB->fetch()) {
         $photo = IPSMember::buildProfilePhoto($r);
         $group = IPSLib::makeNameFormatted('', $r['member_group_id']);
         $return[$r['member_id']] = array('name' => $r['members_display_name'], 'showas' => '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')', 'img' => $photo['pp_thumb_photo'], 'img_w' => $photo['pp_mini_width'], 'img_h' => $photo['pp_mini_height']);
     }
     $this->returnJsonArray($return);
 }
開發者ID:dalandis,項目名稱:Visualization-of-Cell-Phone-Locations,代碼行數:37,代碼來源:findnames.php

示例2: __f__3ef85bd3791d32df62652eaa78601bc1

 function __f__3ef85bd3791d32df62652eaa78601bc1($messages, $dirname, $pages, $currentFolderID, $jumpFolderHTML)
 {
     $_ips___x_retval = '';
     $__iteratorCount = 0;
     foreach ($messages as $id => $msg) {
         $__iteratorCount++;
         $_ips___x_retval .= "\r\n\t\t\t\t\t\t\t<tr id='{$msg['mt_id']}' class='" . ($msg['map_has_unread'] ? "unread" : "") . "'>\r\n\t\t\t\t\t\t\t\t<td class='col_m_photo altrow short'>\r\n\t\t\t\t\t\t\t\t\t" . ($msg['_starterMemberData']['member_id'] ? "\r\n\t\t\t\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$msg['_starterMemberData']['member_id']}", "public", ''), "{$msg['_starterMemberData']['members_seo_name']}", "showuser") . "' class='ipsUserPhotoLink'>\r\n\t\t\t\t\t\t\t\t\t\t\t<img src='{$msg['_starterMemberData']['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_mini' />\r\n\t\t\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t\t\t\t" . IPSMember::buildProfilePhoto(0, 'mini') . "\r\n\t\t\t\t\t\t\t\t\t") . "\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class='col_m_subject'>\r\n\t\t\t\t\t\t\t\t\t" . (($msg['mt_is_deleted'] or $msg['map_user_banned']) ? "\r\n\t\t\t\t\t\t\t\t\t\t<span class='ipsBadge ipsBadge_red'>\r\n\t\t\t\t\t\t\t\t\t\t\t{$this->lang->words['msg_deleted']}\r\n\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t\t\t\t<h4>\r\n\t\t\t\t\t\t\t\t\t\t" . ($msg['map_has_unread'] ? "\r\n\t\t\t\t\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&amp;module=messaging&amp;section=view&amp;do=findMessage&amp;topicID={$msg['mt_id']}&amp;msgID=__firstUnread__", "public", ''), "", "") . "' title='{$this->lang->words['first_unread_reply']}'>" . $this->registry->getClass('output')->getReplacement("f_newpost") . "</a>\r\n\t\t\t\t\t\t\t\t\t\t\t<strong>\r\n\t\t\t\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t\t\t\t\t<a href='" . ($currentFolderID == 'drafts' ? "" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&amp;module=messaging&amp;section=send&amp;do=form&amp;topicID={$msg['mt_id']}", "public", ''), "", "") . "" : "" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&amp;module=messaging&amp;section=view&amp;do=showConversation&amp;topicID={$msg['mt_id']}", "public", ''), "", "") . "") . "' title='{$this->lang->words['msg_view_conversation']}'>\r\n\t\t\t\t\t\t\t\t\t\t{$msg['mt_title']}\r\n\t\t\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\t\t" . ($msg['map_has_unread'] ? "</strong>" : "") . "\r\n\t\t\t\t\t\t\t\t\t</h4>\r\n\t\t\t\t\t\t\t\t\t" . ($msg['map_ignore_notification'] ? "\r\n\t\t\t\t\t\t\t\t\t\t<span class='ipsBadge ipsBadge_lightgrey'>\r\n\t\t\t\t\t\t\t\t\t\t\t{$this->lang->words['msg_no_notify']}\r\n\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t<span class='desc lighter blend_links'>\r\n\t\t\t\t\t\t\t\t\t\t{$this->lang->words['msg_startedby']}\r\n\t\t\t\t\t\t\t\t\t\t" . ($msg['_starterMemberData']['members_display_name'] ? "\r\n\t\t\t\t\t\t\t\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($msg['_starterMemberData']) : '') . ",\r\n\t\t\t\t\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t\t\t\t\t<span class='desc'>{$this->lang->words['deleted_user']},</span>\r\n\t\t\t\t\t\t\t\t\t\t") . "\r\n\t\t\t\t\t\t\t\t\t\t<span class='desc lighter blend_links'>\r\n\t\t\t\t\t\t\t\t\t\t\t{$this->lang->words['msg_sentto']}\r\n\t\t\t\t\t\t\t\t\t\t\t" . ($msg['_toMemberData']['members_display_name'] ? "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($msg['_toMemberData']) : '') . "\r\n\t\t\t\t\t\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span class='desc'>{$this->lang->words['deleted_user']}</span>\r\n\t\t\t\t\t\t\t\t\t\t\t") . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . ($msg['_otherInviteeCount'] > 0 ? "" . ($msg['_otherInviteeCount'] > 1 ? "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span title='" . implode(', ', $msg['_invitedMemberNames']) . "'>({$this->lang->words['pc_and']} {$msg['_otherInviteeCount']} {$this->lang->words['pc_others']})</span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span title='" . implode(', ', $msg['_invitedMemberNames']) . "'>({$this->lang->words['pc_and']} {$msg['_otherInviteeCount']} {$this->lang->words['pc_other']})</span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t") . "" : "") . "\r\n\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t" . (in_array($currentFolderID, array('new')) ? "\r\n\t\t\t\t\t\t\t\t\t\t\t<p class='ipsType_small desc'>{$this->lang->words['folder_prefix']} {$msg['_folderName']}</p>\r\n\t\t\t\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t\t\t\t</span>\t\r\n\t\t\t\t\t\t\t\t\t" . ((is_array($msg['pages']) and count($msg['pages'])) ? "\r\n\t\t\t\t\t\t\t\t\t\t<ul class='mini_pagination'>\r\n\t\t\t\t\t\t\t\t\t\t" . $this->__f__c968b6ba9ecaa79fff521ea4ef309c7f($messages, $dirname, $pages, $currentFolderID, $jumpFolderHTML, $id, $msg) . "\t\t\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t\t\t" : "") . "\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class='col_m_replies desc blend_links'>\r\n\t\t\t\t\t\t\t\t\t<ul>\r\n\t\t\t\t\t\t\t\t\t\t<li>" . ($msg['map_user_banned'] ? "-" : "" . sprintf($this->lang->words['msg_xreplies'], intval($msg['mt_replies'])) . "") . "</li>\r\n\t\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class='col_f_post'>\r\n\t\t\t\t\t\t\t\t\t" . ($msg['_lastMsgAuthor']['member_id'] ? "\r\n\t\t\t\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$msg['_lastMsgAuthor']['member_id']}", "public", ''), "{$msg['_lastMsgAuthor']['members_seo_name']}", "showuser") . "' class='ipsUserPhotoLink left'>\r\n\t\t\t\t\t\t\t\t\t\t\t<img src='{$msg['_lastMsgAuthor']['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_mini' />\r\n\t\t\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\t" : "\r\n\t\t\t\t\t\t\t\t\t\t<span class='left'>" . IPSMember::buildProfilePhoto(0, 'mini') . "</span>\r\n\t\t\t\t\t\t\t\t\t") . "\r\n\t\t\t\t\t\t\t\t\t<ul class='last_post ipsType_small'>\r\n\t\t\t\t\t\t\t\t\t\t" . ($msg['map_user_banned'] ? "\r\n\t\t\t\t\t\t\t\t\t\t\t<li><em>{$this->lang->words['info_not_available']}</em></li>\r\n\t\t\t\t\t\t\t\t\t\t" : "<li>{$this->lang->words['pc_by']} " . ($msg['_lastMsgAuthor']['members_display_name'] ? "" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($msg['_lastMsgAuthor']) : '') . "" : "<span class='desc'>{$this->lang->words['deleted_user']}</span>") . "</li>") . "\r\n\t\t\t\t\t\t\t\t\t\t<li class='desc'>\r\n\t\t\t\t\t\t\t\t\t\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&amp;module=messaging&amp;section=view&amp;do=findMessage&amp;topicID={$msg['mt_id']}&amp;msgID={$msg['mt_last_msg_id']}", "public", ''), "", "") . "' title='{$this->lang->words['goto_last_post']}'>" . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($msg['mt_last_post_time'], "DATE", 0)) . "</a>\r\n\t\t\t\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class='col_m_mod short'>\r\n\t\t\t\t\t\t\t\t\t<input type='checkbox' class='input_check msg_check' name='msgid[{$msg['mt_id']}]' id='msg_check_{$msg['mt_id']}' />\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\r\n";
     }
     $_ips___x_retval .= '';
     unset($__iteratorCount);
     return $_ips___x_retval;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:12,代碼來源:skin_messaging.php

示例3: renderForum


//.........這裏部分代碼省略.........
         $_queued = $this->registry->class_forums->fetchPostHiddenQuery(array('visible'), '');
         $this->DB->build(array('select' => $this->DB->buildDistinct('topic_id'), 'from' => 'posts', 'where' => $_queued . ' AND author_id=' . $this->memberData['member_id'] . ' AND topic_id IN(' . implode(',', $topic_ids) . ')'));
         $this->DB->execute();
         while ($p = $this->DB->fetch()) {
             if (is_array($topic_array[$p['topic_id']])) {
                 $topic_array[$p['topic_id']]['author_id'] = $this->memberData['member_id'];
             }
         }
     }
     //-----------------------------------------
     // Get needed members
     //-----------------------------------------
     if (count($member_ids)) {
         $_members = IPSMember::load($member_ids);
         //-----------------------------------------
         // Add member data to announcements
         //-----------------------------------------
         $new_announces = array();
         foreach ($announce_data as $announce) {
             $announce = array_merge($announce, IPSMember::buildDisplayData($_members[$announce['member_id']]));
             $new_announces[] = $announce;
         }
         $announce_data = $new_announces;
     }
     //-----------------------------------------
     // Show meh the topics!
     //-----------------------------------------
     $adCodeSet = false;
     foreach ($topic_array as $topic) {
         /* Add member */
         if ($topic['last_poster_id']) {
             $topic = array_merge(IPSMember::buildDisplayData($_members[$topic['last_poster_id']]), $topic);
         } else {
             $topic = array_merge(IPSMember::buildProfilePhoto(array()), $topic);
         }
         if ($topic['starter_id']) {
             $topic['_starter'] = $_members[$topic['starter_id']];
         }
         /* AD Code */
         if ($this->registry->getClass('IPSAdCode')->userCanViewAds() && !$adCodeSet) {
             $topic['_adCode'] = $this->registry->getClass('IPSAdCode')->getAdCode('ad_code_forum_view_topic_code');
             if ($topic['_adCode']) {
                 $adCodeSet = true;
             }
         }
         if ($topic['pinned']) {
             $this->pinned_topic_count++;
         }
         $topic_data[$topic['tid']] = $this->renderEntry($topic);
         $total_topics_printed++;
     }
     //-----------------------------------------
     // Finish off the rest of the page  $filter_keys[$topicfilter]))
     //-----------------------------------------
     $sort_by_html = "";
     $sort_key_html = "";
     $prune_day_html = "";
     $filter_html = "";
     foreach ($sort_by_keys as $k => $v) {
         $sort_by_html .= $k == $sort_by ? "<option value='{$k}' selected='selected'>{$this->lang->words[$sort_by_keys[$k]]}</option>\n" : "<option value='{$k}'>{$this->lang->words[$sort_by_keys[$k]]}</option>\n";
     }
     foreach ($sort_keys as $k => $v) {
         $sort_key_html .= $k == $sort_key_chk ? "<option value='{$k}' selected='selected'>{$this->lang->words[$sort_keys[$k]]}</option>\n" : "<option value='{$k}'>{$this->lang->words[$sort_keys[$k]]}</option>\n";
     }
     foreach ($prune_by_day as $k => $v) {
         $prune_day_html .= $k == $prune_value ? "<option value='{$k}' selected='selected'>{$this->lang->words[$prune_by_day[$k]]}</option>\n" : "<option value='{$k}'>{$this->lang->words[$prune_by_day[$k]]}</option>\n";
開發者ID:mover5,項目名稱:imobackup,代碼行數:67,代碼來源:forums.php

示例4: showInlineNotifications

 /**
  * Show the logged inline notifications
  *
  * @author	Brandon Farber
  * @param	string		Error message
  * @return	string		Processed HTML
  */
 public function showInlineNotifications($error = '')
 {
     /* Init */
     $start = intval($this->request['st']);
     $perPage = 50;
     //-----------------------------------------
     // Get class
     //-----------------------------------------
     $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications');
     $notifyLibrary = new $classToLoad($this->registry);
     $notifyLibrary->setMember($this->memberData);
     /* Clear them? - used in mobile skin */
     if (isset($this->request['clear']) && trim($this->request['clear']) == 'true') {
         $this->DB->update('inline_notifications', array('notify_read' => 1), 'notify_to_id=' . $this->memberData['member_id']);
         $notifyLibrary->rebuildUnreadCount();
     }
     //-----------------------------------------
     // Turn off normal form
     //-----------------------------------------
     $this->hide_form_and_save_button = 1;
     //-----------------------------------------
     // Get notifications
     //-----------------------------------------
     $_notifications = array();
     $mids = array();
     $count = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as er', 'from' => 'inline_notifications', 'where' => 'notify_to_id=' . $this->memberData['member_id']));
     if ($count['er']) {
         $this->DB->build(array('select' => '*', 'from' => 'inline_notifications', 'where' => 'notify_to_id=' . $this->memberData['member_id'], 'limit' => array($start, $perPage), 'order' => 'notify_sent DESC'));
         $outer = $this->DB->execute();
         while ($r = $this->DB->fetch($outer)) {
             $r['notify_icon'] = $notifyLibrary->getNotificationIcon($r['notify_type_key']);
             $_notifications[] = $r;
             $mids[$r['notify_from_id']] = $r['notify_from_id'];
         }
         /* Get members */
         if (count($mids)) {
             $members = IPSMember::load(array_keys($mids), 'all');
             if (count($members)) {
                 foreach ($_notifications as $key => $data) {
                     if (isset($members[$data['notify_from_id']])) {
                         $_notifications[$key]['member'] = IPSMember::buildProfilePhoto($members[$data['notify_from_id']]);
                     }
                 }
             }
         }
     }
     $pages = $this->registry->getClass('output')->generatePagination(array('totalItems' => $count['er'], 'itemsPerPage' => $perPage, 'currentStartValue' => $start, 'baseUrl' => "app=core&amp;module=usercp&amp;tab=core&amp;area=notificationlog"));
     //-----------------------------------------
     // Send to template
     //-----------------------------------------
     return $this->registry->getClass('output')->getTemplate('ucp')->notificationsLog($_notifications, $error, $pages);
 }
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:59,代碼來源:usercpForms.php

示例5: photo

 /**
  * @desc			Returns HTML code for member's photo.
  * @param	int		$userID User ID. If $userID is ommited, the last known member id is used.
  * @param	bool	$thumb true to activate thumbnail, otherwise false (default)
  * @return	string	HTML code for member photo
  * @author			Matthias Reuter
  * @sample
  * <code>
  * $ipbwi->member->photo(5,true);
  * </code>
  * @since			2.0
  */
 public function photo($userID = false, $thumb = false)
 {
     $member = $this->info($userID);
     $photo = IPSMember::buildProfilePhoto($member);
     if ($photo['pp_main_photo']) {
         if ($thumb === true && $photo['pp_thumb_photo']) {
             $photo = '<a href="' . $photo['pp_main_photo'] . '"><img src="' . $photo['pp_thumb_photo'] . '" width="' . $photo['pp_thumb_width'] . '" height="' . $photo['pp_thumb_height'] . '" alt="' . $this->id2displayname($userID) . '" /></a>';
         } else {
             $photo = '<img src="' . $photo['pp_main_photo'] . '" width="' . $photo['pp_main_width'] . '" height="' . $photo['pp_main_height'] . '" alt="' . $this->id2displayname($userID) . '" />';
         }
         return $photo;
     } else {
         return false;
     }
 }
開發者ID:smgladkovskiy,項目名稱:kohana-ipbwi,代碼行數:27,代碼來源:member.inc.php

示例6: getEditorHtml

 /**
  * Returns the editor for viewing ...
  * @param unknown_type $member
  */
 public function getEditorHtml(array $member)
 {
     /* Fetch member data */
     $member = IPSMember::buildDisplayData(IPSMember::load($member['member_id'], 'all'));
     $p_w = "";
     $p_h = "";
     $cur_photo = "";
     $rand = urlencode(microtime());
     $data = array('currentPhoto' => array('tag' => ''), 'custom' => array('tag' => ''), 'gravatar' => array('tag' => ''), 'twitter' => array('tag' => ''));
     /* Photo type */
     $data['type'] = $member['pp_photo_type'] = $this->getPhotoType($member);
     /* Got gravatar? */
     $member['pp_gravatar'] = $member['pp_gravatar'] ? $member['pp_gravatar'] : $member['email'];
     /* Quick permission check */
     if (!IPSMember::canUploadPhoto($member, TRUE)) {
         return false;
     }
     /* Set the current photo */
     $data['currentPhoto']['tag'] = IPSMember::buildProfilePhoto($member, 'full', IPS_MEMBER_PHOTO_NO_CACHE);
     /* Set up custom */
     $data['custom']['tag'] = $member['pp_photo_type'] != 'custom' ? IPSMember::buildNoPhoto($member, 'thumb', false, true) : "<img src='" . $member['pp_thumb_photo'] . '?__rand=' . $rand . "' width='" . $member['pp_thumb_width'] . "' height='" . $member['pp_thumb_height'] . "' />";
     /* Set up Gravatar */
     $data['gravatar']['tag'] = "<img src='http://www.gravatar.com/avatar/" . md5($member['pp_gravatar']) . "?s=100' alt='' />";
     /* Twitter linked? */
     if (IPSLib::twitter_enabled() && $member['twitter_token'] && $member['twitter_secret']) {
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/twitter/connect.php', 'twitter_connect');
         $twitter = new $classToLoad($this->registry, $member['twitter_token'], $member['twitter_secret']);
         $userData = $twitter->fetchUserData();
         if ($userData['profile_image_url']) {
             $data['twitter']['tag'] = "<img src='" . str_replace('_normal.', '.', $userData['profile_image_url']) . "' />";
         }
     }
     /* Facebook linked? */
     if (IPSLib::fbc_enabled() && $member['fb_uid']) {
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/facebook/connect.php', 'facebook_connect');
         $facebook = new $classToLoad($this->registry);
         /* Now get the linked user */
         $linkedMemberData = IPSMember::load(intval($member['fb_uid']), 'all', 'fb_uid');
         $userData = $facebook->fetchUserData();
         if ($userData['pic_big']) {
             $data['facebook']['tag'] = "<img src='" . $userData['pic_big'] . "' />";
         } else {
             if ($userData['pic']) {
                 $data['facebook']['tag'] = "<img src='" . $userData['pic'] . "' />";
             }
         }
     }
     $this->uploadFormMax = 5000 * 1024;
     return $this->registry->getClass('output')->getTemplate('profile')->photoEditor($data, $member);
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:54,代碼來源:photo.php

示例7: doExecute


//.........這裏部分代碼省略.........
     //-----------------------------------------
     if ($pp_rating_real) {
         $_queryPP = true;
         $query[] = "pp.pp_rating_real > " . $pp_rating_real;
         $url['pp_rating_real'] = "pp_rating_real=" . $pp_rating_real;
     }
     //-----------------------------------------
     // Finish query
     //-----------------------------------------
     //$query[] = "m.members_l_display_name != ''";
     $joins = array();
     if ($_queryPP) {
         $joins[] = array('from' => array('pfields_content' => 'p'), 'where' => 'p.member_id=m.member_id', 'type' => 'left');
         $joins[] = array('from' => array('profile_portal' => 'pp'), 'where' => 'pp.pp_member_id=m.member_id', 'type' => 'left');
     }
     //-----------------------------------------
     // Reputation
     //-----------------------------------------
     if (!ipsRegistry::isClassLoaded('repCache')) {
         $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/class_reputation_cache.php', 'classReputationCache');
         ipsRegistry::setClass('repCache', new $classToLoad());
     }
     //-----------------------------------------
     // START THE LISTING
     //-----------------------------------------
     $notInMembers = 0;
     foreach ($query as $q) {
         if (!strstr($q, 'm.')) {
             $notInMembers++;
         }
     }
     /* Get the count */
     if ($notInMembers > 0 or $this->sort_key != 'members_l_display_name' or $this->request['request_method'] == 'post') {
         $_max = $this->DB->buildAndFetch(array('select' => 'COUNT( * ) as cnt', 'from' => array('members' => 'm'), 'where' => implode(" AND ", $query), 'add_join' => $joins));
         $this->DB->build(array('select' => ' m.member_id', 'from' => array('members' => 'm'), 'where' => implode(" AND ", $query), 'order' => 'm.' . $this->sort_key . ' ' . $this->sort_order, 'limit' => array($this->first, $this->max_results), 'add_join' => $joins));
     } else {
         $_max = $this->DB->buildAndFetch(array('select' => 'COUNT( * ) as cnt', 'from' => 'members m', 'where' => implode(" AND ", $query)));
         $this->DB->build(array('select' => 'm.member_id', 'from' => array('members' => 'm'), 'where' => implode(" AND ", $query), 'order' => 'm.' . $this->sort_key . ' ' . $this->sort_order, 'limit' => array($this->first, $this->max_results)));
     }
     /* Fetch IDs */
     $mids = array();
     $this->DB->execute();
     while ($m = $this->DB->fetch()) {
         if ($m['member_id']) {
             $mids[] = $m['member_id'];
         }
     }
     if (count($mids)) {
         $members = array();
         $_members = IPSMember::load($mids, 'all');
         /* Make sure that we keep the ordering from the query */
         foreach ($mids as $id) {
             $members[$id] = $_members[$id];
         }
     }
     $max = $_max['cnt'];
     if (is_array($members) and count($members)) {
         foreach ($members as $id => $member) {
             /* Damn SQL thing with member_id */
             if (!$member['member_id']) {
                 $member['member_id'] = $member['member_table_id'];
             }
             $member['members_display_name'] = $member['members_display_name'] ? $member['members_display_name'] : $member['name'];
             $member['members_seo_name'] = IPSMember::fetchSeoName($member);
             $member['group'] = $this->mem_groups[$member['member_group_id']]['TITLE'];
             $member = IPSMember::buildProfilePhoto($member);
             $member['pp_reputation_points'] = $member['pp_reputation_points'] ? $member['pp_reputation_points'] : 0;
             $member['author_reputation'] = ipsRegistry::getClass('repCache')->getReputation($member['pp_reputation_points']);
             /* Reputation */
             if ($this->settings['reputation_protected_groups']) {
                 if (in_array($member['member_group_id'], explode(",", $this->settings['reputation_protected_groups']))) {
                     $member['pp_reputation_points'] = null;
                     $member['author_reputation'] = null;
                 }
             }
             $the_members[] = $member;
         }
     }
     /* make sure URL doesn't contain empty params */
     $_url = $url;
     $url = array();
     foreach ($_url as $key => $bit) {
         if (strrpos($bit, '=') + 1 == strlen($bit)) {
             continue;
         }
         $url[] = $bit;
     }
     $pages = $this->registry->output->generatePagination(array('totalItems' => $max, 'itemsPerPage' => $this->max_results, 'currentStartValue' => $this->first, 'seoTitle' => "false", 'seoTemplate' => 'members_list', 'baseUrl' => implode('&amp;', $url)));
     //-----------------------------------------
     // Print...
     //-----------------------------------------
     $this->output .= $this->registry->getClass('output')->getTemplate('mlist')->member_list_show($the_members, $pages, $dropdowns, $defaults, $this->custom_fields, implode('&amp;', $url));
     //-----------------------------------------
     // Push to print handler
     //-----------------------------------------
     $this->registry->output->addContent($this->output);
     $this->registry->output->setTitle($this->lang->words['page_title'] . ' - ' . ipsRegistry::$settings['board_name']);
     $this->registry->output->addNavigation($this->lang->words['page_title'], 'app=members', "false", 'members_list');
     $this->registry->output->sendOutput();
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:101,代碼來源:view.php

示例8: finalizePublicMember

 /**
  * Finalize public member
  *
  * Now that everything has loaded, lets do the final set up
  *
  * @return	@e void
  */
 public static function finalizePublicMember()
 {
     /* Build profile picture */
     self::$data_store = IPSMember::buildProfilePhoto(self::$data_store);
     /* SEO Name */
     if (!self::$data_store['members_seo_name']) {
         self::$data_store['members_seo_name'] = IPSMember::fetchSeoName(self::$data_store);
     }
     /* Rebuild messenger count if triggered */
     if (self::$data_store['msg_count_reset']) {
         /* Just instantiating the class will perform reset */
         $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('members') . '/sources/classes/messaging/messengerFunctions.php', 'messengerFunctions', 'members');
         $messenger = new $classToLoad(ipsRegistry::instance());
     }
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:22,代碼來源:ipsRegistry.php

示例9: parsePost

 /**
  * Builds an array of post data for output
  *
  * @param	array	$row	Array of post data
  * @return	array
  */
 public function parsePost(array $post)
 {
     /* Init */
     $topicData = $this->getTopicData();
     $forumData = $this->registry->getClass('class_forums')->getForumById($topicData['forum_id']);
     $permissionData = $this->getPermissionData();
     /* Start memory debug */
     $_NOW = IPSDebug::getMemoryDebugFlag();
     $poster = array();
     /* Bitwise options */
     $_tmp = IPSBWOptions::thaw($post['post_bwoptions'], 'posts', 'forums');
     if (count($_tmp)) {
         foreach ($_tmp as $k => $v) {
             $post[$k] = $v;
         }
     }
     /* Is this a member? */
     if ($post['author_id'] != 0) {
         $poster = $this->parseMember($post);
     } else {
         /* Sort out guest */
         $post['author_name'] = $this->settings['guest_name_pre'] . $post['author_name'] . $this->settings['guest_name_suf'];
         $poster = IPSMember::setUpGuest($post['author_name']);
         $poster['members_display_name'] = $post['author_name'];
         $poster['_members_display_name'] = $post['author_name'];
         $poster['custom_fields'] = "";
         $poster['warn_img'] = "";
         $poster = IPSMember::buildProfilePhoto($poster);
     }
     /* Memory debug */
     IPSDebug::setMemoryDebugFlag("PID: " . $post['pid'] . " - Member Parsed", $_NOW);
     /* Update permission */
     $this->registry->getClass('class_forums')->setMemberData($this->getMemberData());
     $permissionData['softDelete'] = $this->registry->getClass('class_forums')->canSoftDeletePosts($topicData['forum_id'], $post);
     /* Soft delete */
     $post['_softDelete'] = $post['pid'] != $topicData['topic_firstpost'] ? $permissionData['softDelete'] : FALSE;
     $post['_softDeleteRestore'] = $permissionData['softDeleteRestore'];
     $post['_softDeleteSee'] = $permissionData['softDeleteSee'];
     $post['_softDeleteReason'] = $permissionData['softDeleteReason'];
     $post['_softDeleteContent'] = $permissionData['softDeleteContent'];
     $post['_isVisible'] = $this->registry->getClass('class_forums')->fetchHiddenType($post) == 'visible' ? true : false;
     $post['_isHidden'] = $this->registry->getClass('class_forums')->fetchHiddenType($post) == 'hidden' ? true : false;
     $post['_isDeleted'] = $this->registry->getClass('class_forums')->fetchHiddenType($post) == 'sdelete' ? true : false;
     /* Answered post */
     try {
         $post['_isMarkedAnswered'] = $this->postIsAnswer($post, $topicData) ? true : false;
     } catch (Exception $e) {
         $post['_isMarkedAnswered'] = false;
     }
     $post['_canMarkUnanswered'] = $post['_isMarkedAnswered'] === true && $this->canUnanswerTopic($topicData) ? true : false;
     $post['_canAnswer'] = $post['_isMarkedAnswered'] === false && $this->canAnswerTopic($topicData) ? true : false;
     $post['PermalinkUrlBit'] = '';
     /* Queued */
     if ($topicData['topic_firstpost'] == $post['pid'] and ($post['_isHidden'] or $topicData['_isHidden'])) {
         $post['queued'] = 1;
         $post['_isHidden'] = true;
     }
     if ($topicData['topic_queuedposts'] || $topicData['topic_deleted_posts']) {
         if ($topicData['topic_queuedposts'] && $topicData['Perms']['canQueuePosts']) {
             /* We have hidden data that is viewable */
             $post['PermalinkUrlBit'] = '&amp;p=' . $post['pid'];
         }
         if ($topicData['topic_deleted_posts'] && $post['_softDeleteSee']) {
             /* We have hidden data that is viewable */
             $post['PermalinkUrlBit'] = '&amp;p=' . $post['pid'];
         }
     }
     /* Edited stuff */
     $post['edit_by'] = "";
     if ($post['append_edit'] == 1 and $post['edit_time'] != "" and $post['edit_name'] != "") {
         $e_time = $this->registry->class_localization->getDate($post['edit_time'], 'LONG');
         $post['edit_by'] = sprintf($this->lang->words['edited_by'], $post['edit_name'], $e_time);
     }
     /* Now parse the post */
     if (!isset($post['cache_content']) or !$post['cache_content']) {
         $_NOW2 = IPSDebug::getMemoryDebugFlag();
         /* Grab the parser file */
         if ($this->_parser === null) {
             /* Load parser */
             $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser');
             $this->_parser = new $classToLoad();
         }
         /* set up parser */
         $this->_parser->set(array('memberData' => array('member_id' => $post['member_id'], 'member_group_id' => $post['member_group_id'], 'mgroup_others' => $post['mgroup_others']), 'parseBBCode' => $forumData['use_ibc'], 'parseHtml' => ($forumData['use_html'] and $poster['g_dohtml'] and $post['post_htmlstate']) ? 1 : 0, 'parseEmoticons' => $post['use_emo'], 'parseArea' => 'topics'));
         $post['post'] = $this->_parser->display($post['post']);
         IPSDebug::setMemoryDebugFlag("topics::parsePostRow - bbcode parse - Completed", $_NOW2);
         IPSContentCache::update($post['pid'], 'post', $post['post']);
     } else {
         $post['post'] = '<!--cached-' . gmdate('r', $post['cache_updated']) . '-->' . $post['cache_content'];
     }
     /* Buttons */
     $post['_can_delete'] = $post['pid'] != $topicData['topic_firstpost'] ? $this->canDeletePost($post) : FALSE;
     $post['_can_edit'] = $this->canEditPost($post);
     $post['_show_ip'] = $this->canSeeIp();
//.........這裏部分代碼省略.........
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:101,代碼來源:topics.php

示例10: _archiveRules

 /**
  * Archive Rules overview
  *
  * @return	@e void
  */
 protected function _archiveRules()
 {
     /* Get archive count so far */
     $counts = $this->archiveWriter->getArchivePossibleCount();
     $rules = $this->archiveWriter->getRulesFromDb();
     if ($counts['count'] < 1) {
         $textString = $this->lang->words['archive_no_query'];
     } else {
         $textString = sprintf($this->lang->words['archive_x_query'], $counts['percentage'], $this->lang->formatNumber($counts['count']), $this->lang->formatNumber($counts['total']));
     }
     /* Post process */
     foreach (array('archive', 'skip') as $type) {
         if (!empty($rules[$type]['forum']['text'])) {
             $ids = IPSLib::isSerialized($rules[$type]['forum']['text']) ? unserialize($rules[$type]['forum']['text']) : array();
             if (count($ids)) {
                 foreach ($ids as $fid) {
                     $data = $this->registry->class_forums->getForumbyId($fid);
                     if ($data['id']) {
                         $rules[$type]['forum']['_parseData'][$fid] = array('data' => $this->registry->class_forums->getForumbyId($fid), 'nav' => $this->html->buildForumNav($this->registry->class_forums->forumsBreadcrumbNav($fid, 'showforum=', true)));
                     }
                 }
             }
         }
         if (!empty($rules[$type]['member']['text'])) {
             $ids = IPSLib::isSerialized($rules[$type]['member']['text']) ? unserialize($rules[$type]['member']['text']) : array();
             if (count($ids)) {
                 $members = IPSMember::load($ids, 'all');
                 foreach ($members as $id => $data) {
                     $members[$id] = IPSMember::buildProfilePhoto($members[$id]);
                     $members[$id]['photoTag'] = IPSMember::buildPhotoTag($members[$id], 'inset');
                 }
                 foreach ($ids as $fid) {
                     $rules[$type]['member']['_parseData']['count'] = count($members);
                     $rules[$type]['member']['_parseData']['data'] = $members;
                 }
             }
         }
     }
     /* Show rules page */
     $this->registry->output->html .= $this->html->archiveRules(IPSText::jsonEncodeForTemplate($rules), $textString);
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:46,代碼來源:archive.php

示例11: getUsersIn


//.........這裏部分代碼省略.........
     }
     /* We're a viewer too? Get our session separately */
     $_extraWhere = empty($options['excludeViewer']) ? "s.id='{$this->member->session_id}' OR " : '';
     /* Dee bee */
     $this->DB->build(array('select' => 's.*, s.id as row_session_id', 'from' => array('sessions' => 's'), 'where' => "{$_extraWhere}({$where})", 'add_join' => $_joins));
     $this->DB->execute();
     while ($session = $this->DB->fetch()) {
         /* Reset for possible bad joins */
         $session['id'] = $session['row_session_id'];
         /* Update our own session properly? */
         if ($session['id'] == $this->member->session_id) {
             $session = array_merge($session, $this->member->sessionClass()->returnCurrentSession());
         }
         $rows[$session['running_time'] . '.' . $session['id']] = $session;
     }
     /* No rows? */
     if (!count($rows)) {
         return $return;
     }
     krsort($rows);
     /* Are we parsing online entries or want only the names */
     if (empty($options['skipParsing'])) {
         /* Process them */
         $filename = IPSLib::getAppDir($app) . '/extensions/coreExtensions.php';
         if (is_file($filename)) {
             $classToLoad = IPSLib::loadLibrary($filename, 'publicSessions__' . $app, $app);
             $loader = new $classToLoad();
             if (method_exists($loader, 'parseOnlineEntries')) {
                 $rows = $loader->parseOnlineEntries($rows);
             }
         }
         /* No rows? */
         if (!count($rows)) {
             return $return;
         }
     }
     /* Sort through */
     foreach ($rows as $id => $result) {
         $last_date = $this->registry->getClass('class_localization')->getTime($result['running_time']);
         /* ROBOT - or DODOT! */
         if (strstr($result['id'], '_session')) {
             $botname = preg_replace('/^(.+?)=/', "\\1", $result['id']);
             if (!$cached['srch_' . $result['member_name']]) {
                 $result = IPSMember::buildProfilePhoto($result);
                 $result['parsedMemberName'] = $result['member_name'];
                 $return['rows']['bots'][$result['id']] = $result;
                 $return['names'][$result['id']] = $result['parsedMemberName'];
                 $cached['srch_' . $result['member_name']]['count'] = 1;
             } else {
                 $cached['srch_' . $result['member_name']]['count']++;
             }
             $return['stats']['bots']++;
         } else {
             if (!$result['member_id']) {
                 $result = IPSMember::buildProfilePhoto(0);
                 $result['parsedMemberName'] = $this->lang->words['global_guestname'];
                 $return['rows']['guests'][$result['id']] = $result;
                 $return['stats']['guests']++;
             } else {
                 if (empty($cached[$result['member_id']])) {
                     $cached[$result['member_id']] = 1;
                     $result = IPSMember::buildProfilePhoto($result);
                     $result['parsedMemberName'] = IPSMember::makeNameFormatted($result['member_name'], $result['member_group']);
                     /* Reset login type in case the board/group setting got changed */
                     $result['login_type'] = IPSMember::isLoggedInAnon(array('login_anonymous' => $result['login_type']), $result['member_group_id']);
                     if ($result['login_type']) {
                         if ($this->memberData['g_access_cp'] || $this->memberData['member_id'] == $result['member_id']) {
                             $result['parsedMemberName'] = IPSMember::makeProfileLink($result['parsedMemberName'], $result['member_id'], $result['seo_name']);
                             $result['parsedMemberName'] .= '*';
                             # Add anonymous asterisk
                             $return['rows']['anon'][$result['id']] = $result;
                             $return['names'][$result['id']] = $result['parsedMemberName'];
                         }
                         $return['stats']['anon']++;
                     } else {
                         $result['parsedMemberName'] = IPSMember::makeProfileLink($result['parsedMemberName'], $result['member_id'], $result['seo_name']);
                         $return['rows']['members'][$result['id']] = $result;
                         $return['names'][$result['id']] = $result['parsedMemberName'];
                         $return['stats']['members']++;
                     }
                 }
             }
         }
     }
     /* Process bots */
     foreach ($cached as $name => $val) {
         if ($val['count'] && substr($name, 0, 5) == 'srch_') {
             foreach ($return['rows']['bots'] as $row) {
                 if ($row['parsedMemberName'] == substr($name, 5)) {
                     $return['rows']['bots'][$row['id']]['parsedMemberName'] .= ' (' . $val['count'] . ')';
                     $return['rows']['bots'][$row['id']]['member_name'] = $return['rows']['bots'][$row['id']]['parsedMemberName'];
                     $return['names'][$row['id']] = $return['rows']['bots'][$row['id']]['parsedMemberName'];
                     break;
                 }
             }
         }
     }
     $return['stats']['total'] = intval($return['stats']['bots']) + intval($return['stats']['guests']) + intval($return['stats']['anon']) + intval($return['stats']['members']);
     return $return;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:101,代碼來源:api.php

示例12: _membersSearch

 /**
  * Perform a MEMBER search.
  * Returns an array of a total count (total number of matches)
  * and an array of IDs ( 0 => 1203, 1 => 928, 2 => 2938 ).. matching the required number based on pagination. The ids returned would be based on the filters and type of search
  *
  * So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25
  *
  * @return array
  */
 public function _membersSearch()
 {
     /* Not allowed to see profile information */
     if (!$this->memberData['g_mem_info']) {
         return array('count' => 0, 'resultSet' => array());
     }
     /* INIT */
     $sort_by = IPSSearchRegistry::get('in.search_sort_by');
     $sort_order = IPSSearchRegistry::get('in.search_sort_order');
     $search_term = IPSSearchRegistry::get('in.clean_search_term');
     $sortKey = '';
     $rows = array();
     /* Sorting */
     switch ($sort_by) {
         default:
         case 'date':
             $sortKey = 'member_id';
             break;
         case 'title':
             $sortKey = 'members_l_display_name';
             break;
     }
     /* Query the count */
     $count = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as total_results', 'from' => array('members' => 'm'), 'where' => $this->_buildWhereStatement($search_term), 'add_join' => array(array('from' => array('profile_portal' => 'p'), 'where' => "p.pp_member_id=m.member_id", 'type' => 'left'))));
     /* Fetch data */
     $this->DB->build(array('select' => 'm.*', 'from' => array('members' => 'm'), 'where' => $this->_buildWhereStatement($search_term), 'order' => $sortKey . ' ' . $sort_order, 'limit' => array(IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page')), 'add_join' => array(array('select' => 'p.*', 'from' => array('profile_portal' => 'p'), 'where' => "p.pp_member_id=m.member_id", 'type' => 'left'))));
     $this->DB->execute();
     /* Get results */
     while ($_row = $this->DB->fetch()) {
         $rows[] = IPSMember::buildProfilePhoto($_row);
     }
     /* Return it */
     return array('count' => $count['total_results'], 'resultSet' => $rows);
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:43,代碼來源:sql.php

示例13: getDataByRelationshipId

 /**
  * Get data based on a relationship ID
  *
  * @param	array 	$data (id, type, app)
  * @return	mixed	Array of like data OR null
  */
 public function getDataByRelationshipId($data)
 {
     /* Init */
     $mids = array();
     $members = array();
     $rows = array();
     $where = !empty($data['rating']) ? " AND rep_rating=" . $data['rating'] : '';
     /* Fetch data */
     $this->DB->build(array('select' => '*', 'from' => 'reputation_index', 'where' => 'app=\'' . $data['app'] . "' AND type='" . $data['type'] . "' AND type_id=" . intval($data['id']) . $where, 'order' => 'rep_date DESC', 'limit' => array(0, 250)));
     $o = $this->DB->execute();
     while ($row = $this->DB->fetch($o)) {
         $return[$row['member_id']] = $row;
         $mids[$row['member_id']] = intval($row['member_id']);
     }
     /* Just the one? */
     if (count($mids)) {
         $members = IPSMember::load($mids, 'all');
         foreach ($members as $i => $d) {
             $_m = IPSMember::buildProfilePhoto($d);
             $return[$i] = array_merge((array) $_m, (array) $return[$i]);
         }
     }
     return is_array($return) ? $return : null;
 }
開發者ID:ConnorChristie,項目名稱:GrabViews,代碼行數:30,代碼來源:class_reputation_cache.php

示例14: fetchUnreadNotifications

 /**
  * Fetch new PM notification
  *
  * @access	public
  * @param	int			Number if items to limit
  * @param	string		Sort column
  * @param	string		Sort order
  * @param	bool		Only get unread notifications
  * @param	bool		Run text through preDisplayParse
  * @return 	array 		Unread notifications
  */
 public function fetchUnreadNotifications($limit = 0, $sortKey = 'notify_sent', $sortOrder = 'desc', $unread = 1, $parseText = false, $keyNames = array())
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $return = array();
     $limit = $limit ? array(0, intval($limit)) : array(0, 500);
     $members = array();
     $mids = array();
     $where = "";
     $unread = is_array($unread) ? $unread : array($unread);
     if (count($keyNames)) {
         $where = " AND notify_type_key IN ('" . implode("','", $keyNames) . "')";
     }
     //-----------------------------------------
     // Fetch unread notifications
     //-----------------------------------------
     $this->DB->build(array('select' => '*', 'from' => 'inline_notifications', 'where' => 'notify_to_id=' . $this->_member['member_id'] . ' AND notify_read IN (' . implode(',', $unread) . ')' . $where, 'order' => $sortKey . ' ' . $sortOrder, 'limit' => $limit));
     $outer = $this->DB->execute();
     while ($row = $this->DB->fetch($outer)) {
         /* As the email template parser makes an attempt to reparse 'safe' HTML, we need to make it safe here */
         $row['notify_text'] = IPSText::htmlspecialchars($row['notify_text']);
         IPSText::getTextClass('bbcode')->parse_smilies = 1;
         IPSText::getTextClass('bbcode')->parse_nl2br = 1;
         IPSText::getTextClass('bbcode')->parse_html = 0;
         IPSText::getTextClass('bbcode')->parse_bbcode = 1;
         IPSText::getTextClass('bbcode')->parsing_section = 'global';
         if ($parseText) {
             $row['notify_text'] = IPSText::getTextClass('bbcode')->preDisplayParse(nl2br($row['notify_text']));
         }
         $row['notify_icon'] = $this->getNotificationIcon($row['notify_type_key']);
         $return[$row['notify_sent'] . '.' . $row['notify_id']] = $row;
         /* Store member id */
         $mids[$row['notify_from_id']] = $row['notify_from_id'];
     }
     /* Got anything? */
     if (!count($return)) {
         return array();
     }
     if (count($mids)) {
         $members = IPSMember::load(array_keys($mids), 'all');
         if (count($members)) {
             foreach ($return as $key => $data) {
                 if (in_array($data['notify_from_id'], array_keys($members))) {
                     $return[$key]['member'] = IPSMember::buildProfilePhoto($members[$data['notify_from_id']]);
                 }
             }
         }
     }
     /* 3.1 didn't store notify_from_id so we need to catch that */
     foreach ($return as $key => $data) {
         if (!$data['member']['member_id']) {
             $return[$key]['member'] = IPSMember::buildProfilePhoto(0);
         }
     }
     /* Return 'em */
     return $return;
 }
開發者ID:Advanture,項目名稱:Online-RolePlay,代碼行數:69,代碼來源:notifications.php

示例15: _getMembers

 /**
  * Returns possible matches for the string input
  *
  * @return	@e void		Outputs to screen
  */
 protected function _getMembers()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $name = IPSText::convertUnicode($this->convertAndMakeSafe($this->request['name'], 0), true);
     $name = IPSText::convertCharsets($name, 'utf-8', IPS_DOC_CHAR_SET);
     //-----------------------------------------
     // Check length
     //-----------------------------------------
     if (IPSText::mbstrlen($name) < 3) {
         $this->returnJsonError('requestTooShort');
     }
     //-----------------------------------------
     // Try query...
     //-----------------------------------------
     $this->DB->build(array('select' => 'm.members_display_name, m.member_id, m.members_seo_name, m.member_group_id', 'from' => array('members' => 'm'), 'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes(strtolower($name)) . "%'", 'order' => $this->DB->buildLength('m.members_display_name') . ' ASC', 'limit' => array(0, 15), 'add_join' => array(array('select' => 'p.*', 'from' => array('profile_portal' => 'p'), 'where' => 'p.pp_member_id=m.member_id', 'type' => 'left'))));
     $this->DB->execute();
     //-----------------------------------------
     // Got any results?
     //-----------------------------------------
     if (!$this->DB->getTotalRows()) {
         $this->returnJsonArray(array());
     }
     $return = array();
     while ($r = $this->DB->fetch()) {
         $url = $this->registry->output->buildSEOUrl("app=core&amp;module=modcp&amp;do=editmember&amp;mid={$r['member_id']}", 'public');
         $photo = IPSMember::buildProfilePhoto($r);
         $group = IPSMember::makeNameFormatted('', $r['member_group_id']);
         $return[$r['member_id']] = array('name' => $r['members_display_name'], 'showas' => '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')', 'img' => $photo['pp_thumb_photo'], 'img_w' => $photo['pp_mini_width'], 'img_h' => $photo['pp_mini_height'], 'url' => $url);
     }
     $this->returnJsonArray($return);
 }
開發者ID:ConnorChristie,項目名稱:GrabViews-Live,代碼行數:38,代碼來源:modcp.php


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