function memberCommentsSearchResult($r, $resultAsTitle = false)
 {
     $IPBHTML = "";
     if (IPSLib::locationHasHooks('skin_search', $this->_funcHooks['memberCommentsSearchResult'])) {
         $count_0b4cc0e4587a35c85ace76e4b0547ec8 = is_array($this->functionData['memberCommentsSearchResult']) ? count($this->functionData['memberCommentsSearchResult']) : 0;
         $this->functionData['memberCommentsSearchResult'][$count_0b4cc0e4587a35c85ace76e4b0547ec8]['r'] = $r;
         $this->functionData['memberCommentsSearchResult'][$count_0b4cc0e4587a35c85ace76e4b0547ec8]['resultAsTitle'] = $resultAsTitle;
     }
     $IPBHTML .= "<span class='icon'>\n\t" . IPSMember::buildPhotoTag($r['status_author'], 'small') . "\n</span>\n<div class='result_info'>\n\t<h3>\n\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($r['status_author']) : '') . "\n\t\t" . ($r['status_member_id'] != $r['status_author_id'] ? "\n\t\t\t&rarr;\n\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('global'), 'userHoverCard') ? $this->registry->getClass('output')->getTemplate('global')->userHoverCard($r['status_member']) : '') . "\n\t\t" : "") . "\n\t</h3>\n\t<span class='desc breadcrumb'>\n\t\t<a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&amp;module=profile&amp;section=status&amp;type=single&amp;status_id={$r['status_id']}", "public", ''), "true", "members_status_single") . "'>{$this->lang->words['results_pf_comment']}</a>, " . IPSText::htmlspecialchars($this->registry->getClass('class_localization')->getDate($r['status_date'], "short", 0)) . "\n\t</span>\n\t<p>{$r['status_content']}</p>\n\t<div id=\"statusFeedback-{$r['status_id']}\" class='status_feedback'>\n\t\t" . (($r['status_replies'] and count($r['replies'])) ? "" . ($r['status_replies'] > 3 ? "\n\t\t\t\t<div class='status_mini_wrap row2 altrow' id='statusMoreWrap-{$r['status_id']}'>\n\t\t\t\t\t<img src=\"{$this->settings['img_url']}/comments.png\" alt=\"\" /> &nbsp;<a href=\"#\" id=\"statusMore-{$r['status_id']}\" class='__showAll __x{$r['status_id']}'>" . sprintf($this->lang->words['status_show_all_x'], $r['status_replies']) . "</a>\n\t\t\t\t</div>\n\t\t\t" : "") . "\n\t\t\t<ul id='statusReplies-{$r['status_id']}' class='ipsList_withtinyphoto clear'>\n\t\t\t\t" . (method_exists($this->registry->getClass('output')->getTemplate('profile'), 'statusReplies') ? $this->registry->getClass('output')->getTemplate('profile')->statusReplies($r['replies'], 1) : '') . "\n\t\t\t</ul>" : "") . "\n\t\t<div id='statusReplyBlank-{$r['status_id']}'></div>\n\t\t<div class='status_mini_wrap row2 altrow' id='statusMaxWrap-{$r['status_id']}' " . ($r['status_replies'] < $this->settings['su_max_replies'] ? "style='display:none'" : "") . ">\n\t\t\t<img src=\"{$this->settings['img_url']}/locked_replies.png\" title=\"{$this->lang->words['status_too_many_replies']}\" alt='x' /> {$this->lang->words['status_too_many_replies']}\n\t\t</div>\n\t</div>\n</div>";
     return $IPBHTML;
 }
Exemple #2
0
 /**
  * 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);
 }
 /**
  * Saves the add forum dialog
  */
 protected function _saveAddMemberDialog()
 {
     $type = trim($this->request['type']);
     $rules = $this->archiveWriter->getRulesFromDb();
     $int = $type == 'archive' ? 0 : 1;
     $return = array();
     /* INIT */
     $memberName = trim($this->request['addName']);
     /* Existing names */
     $current = IPSLib::isSerialized($rules[$type]['member']['text']) ? unserialize($rules[$type]['member']['text']) : array();
     /* Fetch from DB */
     $member = $this->DB->buildAndFetch(array('select' => 'member_id', 'from' => 'members', 'where' => "members_display_name = '" . $this->DB->addSlashes($memberName) . "'"));
     if ($member['member_id']) {
         $current[] = $member['member_id'];
     }
     $current = array_unique($current);
     /* Update DB */
     $this->DB->replace('core_archive_rules', array('archive_key' => md5('forums_member_' . $int), 'archive_app' => 'forums', 'archive_field' => 'member', 'archive_value' => '', 'archive_text' => serialize($current), 'archive_unit' => '', 'archive_skip' => $int), array('archive_key'));
     /* Update members */
     if (count($current)) {
         $members = IPSMember::load($current, 'all');
         foreach ($members as $id => $data) {
             $members[$id] = IPSMember::buildProfilePhoto($members[$id]);
             $members[$id]['photoTag'] = IPSMember::buildPhotoTag($members[$id], 'inset');
         }
     }
     $this->returnJsonArray(array('count' => count($members), 'data' => $members, 'ids' => serialize(array_keys($members))));
 }
 /**
  * Get me the latest notification and FAST or whatever...
  */
 public function getLatestNotificationForInlinePopUp()
 {
     $latest = $this->fetchLatestNotifications(1, $this->_showInlinePopUp, true);
     $detail = array();
     if (!is_array($latest) or !count($latest)) {
         return false;
     }
     $latest = array_shift($latest);
     if (!is_array($latest)) {
         $latest = array();
     }
     /* Alright can we get a better version of the text? */
     if (!empty($latest['notify_meta_app']) && !empty($latest['notify_meta_area']) && !empty($latest['notify_meta_id'])) {
         $detail = $this->getLinkedDataByMetaData($this->_cleanMeta($latest));
     }
     /* Do it the old fashioned way */
     if (empty($detail['content'])) {
         $detail = array('authorId' => $latest['notify_from_id'], 'content' => $latest['notify_text'], 'date' => $latest['notify_sent'], 'title' => $latest['notify_title'], 'type' => $this->lang->words['gbl_notify_item']);
     }
     /* Parse date */
     $detail['date_parsed'] = $this->lang->getDate($detail['date'], 'short');
     /* Format the content */
     $detail['content'] = nl2br(IPSText::getTextClass('bbcode')->stripAllTags($detail['content']));
     /* Format the author */
     $author = IPSMember::buildDisplayData(IPSMember::load($detail['authorId'], 'all'), array('__all__' => 1));
     /* Flatten for JSON template eval */
     foreach ($author as $k => $v) {
         $detail['member_' . $k] = $v;
     }
     $detail['member_PhotoTag'] = IPSMember::buildPhotoTag($author, 'mini');
     $detail['member_HoverCard'] = $this->registry->getClass('output')->getTemplate('global')->userHoverCard($author);
     /* Slap on the URL */
     $detail['url'] = $latest['notify_url'];
     return array_merge($latest, $detail);
 }