本文整理汇总了PHP中IPSLib::makeProfileLink方法的典型用法代码示例。如果您正苦于以下问题:PHP IPSLib::makeProfileLink方法的具体用法?PHP IPSLib::makeProfileLink怎么用?PHP IPSLib::makeProfileLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPSLib
的用法示例。
在下文中一共展示了IPSLib::makeProfileLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _threadedRenderListRow
/**
* Builds an array of output for used in threaded view
*
* @access public
* @param array $post
* @param integer $depth
* @return array
**/
public function _threadedRenderListRow($post, $depth)
{
$post['depthguide'] = "";
$this->settings['post_showtext_notitle'] = 1;
for ($i = 1; $i < $depth; $i++) {
$post['depthguide'] .= $this->depth_guide[$i];
}
// Last child?
if ($depth > 0) {
$last_id = count($this->structured_pids[$post['post_parent']]) - 1;
if ($this->structured_pids[$post['post_parent']][$last_id] == $post['pid']) {
$this->depth_guide[$depth] = '<img src="' . $this->settings['img_url'] . '/spacer.gif" alt="" width="20" height="16">';
$post['depthguide'] .= "<img src='" . $this->settings['img_url'] . "/to_post_no_children.gif' alt='-' />";
} else {
$this->depth_guide[$depth] = '<img src="' . $this->settings['img_url'] . '/to_down_pipe.gif" alt="|" />';
$post['depthguide'] .= "<img src='" . $this->settings['img_url'] . "/to_post_with_children.gif' alt='-' />";
}
}
if (!$post['post_title']) {
if ($this->settings['post_showtext_notitle']) {
$post_text = IPSText::getTextClass('bbcode')->stripAllTags(strip_tags(IPSText::br2nl($post['post'])));
if (IPSText::mbstrlen($post_text) > 50) {
$post['post_title'] = IPSText::truncate($post_text, 50) . '...';
} else {
$post['post_title'] = $post_text;
}
if (!trim($post['post_title'])) {
$post['post_title'] = $this->lang->words['post_title_re'] . $this->topics->topic['title'];
}
} else {
$post['post_title'] = $this->lang->words['post_title_re'] . $this->topics->topic['title'];
}
}
$post['linked_name'] = IPSLib::makeProfileLink($post['author_name'], $post['author_id']);
$post['formatted_date'] = $this->registry->class_localization->getDate($post['post_date'], 'LONG');
$post['new_post'] = 't_threaded_read';
if ($post['post_date'] > $this->topics->last_read_tid) {
$post['new_post'] = 't_threaded_read';
}
if (strstr($this->used_post_ids, ',' . $post['pid'] . ',')) {
$post['_show_highlight'] = 1;
}
return $post;
}
示例2: parseTopicData
/**
* Parase Topic Data
*
* @access public
* @param array $topic Topic data
* @param bool $last_time_default Use default "last read time"
* @return array
**/
public function parseTopicData($topic, $last_time_default = true)
{
//-----------------------------------------
// INIT
//-----------------------------------------
$topic['real_tid'] = $topic['tid'];
$topic['_last_post'] = $topic['last_post'];
//-----------------------------------------
// Do we have an SEO title?
//-----------------------------------------
$_hasSEOTitle = false;
if ($topic['title_seo']) {
$_hasSEOTitle = true;
}
$topic['title_seo'] = $topic['title_seo'] ? $topic['title_seo'] : IPSText::makeSeoTitle($topic['title']);
/**
* Here we'll take the one query hit to update in order to speed it up in the future
*/
if (!$_hasSEOTitle and $this->settings['use_friendly_urls']) {
$this->DB->update('topics', array('title_seo' => $topic['title_seo'] ? $topic['title_seo'] : '-'), 'tid=' . $topic['tid']);
}
//-----------------------------------------
// Need to update this topic?
//-----------------------------------------
if ($topic['state'] == 'open') {
if (!$topic['topic_open_time'] or $topic['topic_open_time'] < $topic['topic_close_time']) {
if ($topic['topic_close_time'] and ($topic['topic_close_time'] <= time() and (time() >= $topic['topic_open_time'] or !$topic['topic_open_time']))) {
$topic['state'] = 'closed';
$this->update_topics_close[] = $topic['real_tid'];
}
} else {
if ($topic['topic_open_time'] or $topic['topic_open_time'] > $topic['topic_close_time']) {
if ($topic['topic_close_time'] and ($topic['topic_close_time'] <= time() and time() <= $topic['topic_open_time'])) {
$topic['state'] = 'closed';
$this->update_topics_close[] = $topic['real_tid'];
}
}
}
} else {
if ($topic['state'] == 'closed') {
if (!$topic['topic_close_time'] or $topic['topic_close_time'] < $topic['topic_open_time']) {
if ($topic['topic_open_time'] and ($topic['topic_open_time'] <= time() and (time() >= $topic['topic_close_time'] or !$topic['topic_close_time']))) {
$topic['state'] = 'open';
$this->update_topics_open[] = $topic['real_tid'];
}
} else {
if ($topic['topic_close_time'] or $topic['topic_close_time'] > $topic['topic_open_time']) {
if ($topic['topic_open_time'] and ($topic['topic_open_time'] <= time() and time() <= $topic['topic_close_time'])) {
$topic['state'] = 'open';
$this->update_topics_open[] = $topic['real_tid'];
}
}
}
}
}
//-----------------------------------------
// For polls we check last vote instead
// @todo [Future] Show a diff icon for new vote + new reply, new vote + no new reply, etc.
// Bug 16598: Need separate checks for icon vs getnewpost link
//-----------------------------------------
if ($topic['poll_state'] and $topic['last_vote'] > $topic['last_post']) {
$is_read = $this->registry->classItemMarking->isRead(array('forumID' => $topic['forum_id'], 'itemID' => $topic['tid'], 'itemLastUpdate' => $topic['last_vote']), 'forums');
$gotonewpost = $this->registry->classItemMarking->isRead(array('forumID' => $topic['forum_id'], 'itemID' => $topic['tid'], 'itemLastUpdate' => $topic['last_post']), 'forums');
} else {
$is_read = $this->registry->classItemMarking->isRead(array('forumID' => $topic['forum_id'], 'itemID' => $topic['tid'], 'itemLastUpdate' => $topic['last_post']), 'forums');
$gotonewpost = $is_read;
}
//-----------------------------------------
// Yawn
//-----------------------------------------
$topic['last_poster'] = $topic['last_poster_id'] ? IPSLib::makeProfileLink($topic['last_poster_name'], $topic['last_poster_id'], $topic['seo_last_name']) : $this->settings['guest_name_pre'] . $topic['last_poster_name'] . $this->settings['guest_name_suf'];
$topic['starter'] = $topic['starter_id'] ? IPSLib::makeProfileLink($topic['starter_name'], $topic['starter_id'], $topic['seo_first_name']) : $this->settings['guest_name_pre'] . $topic['starter_name'] . $this->settings['guest_name_suf'];
$topic['prefix'] = $topic['poll_state'] ? $this->registry->getClass('output')->getTemplate('forum')->topicPrefixWrap($this->settings['pre_polls']) : '';
$show_dots = "";
if ($this->memberData['member_id'] and (isset($topic['author_id']) and $topic['author_id'])) {
$show_dots = 1;
}
$topic['folder_img'] = $this->registry->getClass('class_forums')->fetchTopicFolderIcon($topic, $show_dots, $is_read);
/* SKINNOTE: Change these so that the link is built in the skin, not here */
$topic['topic_icon'] = $topic['icon_id'] ? '<img src="' . $this->settings['mime_img'] . '/style_extra/post_icons/icon' . $topic['icon_id'] . '.gif" border="0" alt="" />' : ' ';
$topic['topic_icon'] = $topic['pinned'] ? '<{B_PIN}>' : $topic['topic_icon'];
$topic['start_date'] = $this->registry->getClass('class_localization')->getDate($topic['start_date'], 'LONG');
//-----------------------------------------
// Pages 'n' posts
//-----------------------------------------
$pages = 1;
$topic['PAGES'] = "";
if ($this->memberData['is_mod']) {
$topic['posts'] += intval($topic['topic_queuedposts']);
}
if ($topic['posts']) {
$mode = IPSCookie::get('topicmode');
//.........这里部分代码省略.........
示例3: formatContent
/**
* Formats the forum search result for display
*
* @access public
* @param array $search_row Array of data from search_index
* @param bool $isVnc Is from view new content
* @return mixed Formatted content, ready for display, or array containing a $sub section flag, and content
**/
public function formatContent($search_row, $isVnc = false)
{
/* Get class forums, used for displaying forum names on results */
if (ipsRegistry::isClassLoaded('class_forums') !== TRUE) {
require_once IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php";
ipsRegistry::setClass('class_forums', new class_forums(ipsRegistry::instance()));
ipsRegistry::getClass('class_forums')->forumsInit();
}
/* Array */
$search_row = $this->_buildOutputArray($search_row);
/* Indent */
$indent = $this->last_topic == $search_row['type_id_2'];
$this->last_topic = $search_row['type_id_2'];
/* Various data */
$search_row['_last_post'] = $search_row['last_post'];
$search_row['_longTitle'] = $search_row['content_title'];
$search_row['_shortTitle'] = IPSText::truncate($search_row['content_title'], 60);
$search_row['last_poster'] = $search_row['last_poster_id'] ? IPSLib::makeProfileLink($search_row['last_poster_name'], $search_row['last_poster_id'], $search_row['seo_last_name']) : ipsRegistry::$settings['guest_name_pre'] . $search_row['last_poster_name'] . ipsRegistry::$settings['guest_name_suf'];
$search_row['starter'] = $search_row['starter_id'] ? IPSLib::makeProfileLink($search_row['starter_name'], $search_row['starter_id'], $search_row['seo_first_name']) : $this->settings['guest_name_pre'] . $search_row['starter_name'] . $this->settings['guest_name_suf'];
//$search_row['posts'] = ipsRegistry::getClass('class_localization')->formatNumber( intval($search_row['posts']) );
//$search_row['views'] = ipsRegistry::getClass('class_localization')->formatNumber( intval($search_row['views']) );
$search_row['last_post'] = ipsRegistry::getClass('class_localization')->getDate($search_row['last_post'], 'SHORT');
if (isset($search_row['post_date'])) {
$search_row['_post_date'] = $search_row['post_date'];
$search_row['post_date'] = ipsRegistry::getClass('class_localization')->getDate($search_row['post_date'], 'SHORT');
}
if ($this->memberData['is_mod']) {
$search_row['posts'] += intval($search_row['topic_queuedposts']);
}
if ($search_row['posts']) {
if (($search_row['posts'] + 1) % ipsRegistry::$settings['display_max_posts'] == 0) {
$pages = ($search_row['posts'] + 1) / ipsRegistry::$settings['display_max_posts'];
} else {
$number = ($search_row['posts'] + 1) / ipsRegistry::$settings['display_max_posts'];
$pages = ceil($number);
}
}
if ($pages > 1) {
for ($i = 0; $i < $pages; ++$i) {
$real_no = $i * ipsRegistry::$settings['display_max_posts'];
$page_no = $i + 1;
if ($page_no == 4 and $pages > 4) {
$search_row['pages'][] = array('last' => 1, 'st' => ($pages - 1) * ipsRegistry::$settings['display_max_posts'], 'page' => $pages);
break;
} else {
$search_row['pages'][] = array('last' => 0, 'st' => $real_no, 'page' => $page_no);
}
}
}
/* Format as a topic */
if ($search_row['type_2'] == 'topic') {
/* Forum Breadcrum */
$search_row['_forum_trail'] = ipsRegistry::getClass('class_forums')->forumsBreadcrumbNav($search_row['forum_id']);
/* Is it read? We don't support last_vote in search. */
$is_read = ipsRegistry::getClass('classItemMarking')->isRead(array('forumID' => $search_row['forum_id'], 'itemID' => $search_row['type_id_2'], 'itemLastUpdate' => $search_row['lastupdate'] ? $search_row['lastupdate'] : $search_row['updated']), 'forums');
/* Has posted dot */
$show_dots = '';
if (ipsRegistry::$settings['show_user_posted']) {
if (ipsRegistry::member()->getProperty('member_id') && (isset($search_row['_topic_array'][$search_row['type_id_2']]) && $search_row['_topic_array'][$search_row['type_id_2']])) {
$show_dots = 1;
}
}
/* Icon */
$search_row['_icon'] = ipsRegistry::getClass('class_forums')->fetchTopicFolderIcon($search_row, $show_dots, $is_read);
/* Display type */
if ($this->search_plugin->getShowAsForum() !== true) {
return array(ipsRegistry::getClass('output')->getTemplate('search')->topicPostSearchResult($search_row, $indent, $this->search_plugin->onlyTitles || $this->search_plugin->noPostPreview ? 1 : 0), $indent);
} else {
return array(ipsRegistry::getClass('output')->getTemplate('search')->topicPostSearchResultAsForum($search_row, $indent, $this->search_plugin->onlyTitles || $this->search_plugin->noPostPreview ? 1 : 0), $indent);
}
} else {
return ipsRegistry::getClass('output')->getTemplate('search')->forumSearchResult($search_row, $this->search_plugin->onlyTitles || $this->search_plugin->noPostPreview ? 1 : 0);
}
}