本文整理汇总了PHP中CKunenaLink::GetThreadLayoutLink方法的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaLink::GetThreadLayoutLink方法的具体用法?PHP CKunenaLink::GetThreadLayoutLink怎么用?PHP CKunenaLink::GetThreadLayoutLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKunenaLink
的用法示例。
在下文中一共展示了CKunenaLink::GetThreadLayoutLink方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getView
//.........这里部分代码省略.........
}
}
// Done with attachments
}
$this->pagination = $this->getPagination($this->catid, $this->thread, $page, $totalpages, $maxpages);
//meta description and keywords
$metaKeys = kunena_htmlspecialchars("{$this->first_message->subject}, {$objCatParentInfo->name}, {$this->config->board_title}, " . JText::_('COM_KUNENA_GEN_FORUM') . ', ' . $this->app->getCfg('sitename'));
// Create Meta Description form the content of the first message
// better for search results display but NOT for search ranking!
$metaDesc = KunenaParser::stripBBCode($this->first_message->message);
$metaDesc = strip_tags($metaDesc);
// Now remove all tags
$metaDesc = preg_replace('/\\s+/', ' ', $metaDesc);
// remove newlines
$metaDesc = preg_replace('/^[^\\w0-9]+/', '', $metaDesc);
// remove characters at the beginning that are not letters or numbers
$metaDesc = trim($metaDesc);
// Remove trailing spaces and beginning
// remove multiple spaces
while (strpos($metaDesc, ' ') !== false) {
$metaDesc = str_replace(' ', ' ', $metaDesc);
}
// limit to 185 characters - google will cut off at ~150
if (strlen($metaDesc) > 185) {
$metaDesc = rtrim(JString::substr($metaDesc, 0, 182)) . '...';
}
$metaDesc = htmlspecialchars($metaDesc);
$document =& JFactory::getDocument();
$document->setMetadata('keywords', $metaKeys);
$document->setDescription($metaDesc);
$this->layout_buttons = array();
if ($this->config->enable_threaded_layouts) {
if ($this->layout != 'view') {
$this->layout_buttons[] = CKunenaLink::GetThreadLayoutLink('flat', $this->catid, $this->thread, $this->mesid, CKunenaTools::showButton('layout-flat', JText::_('COM_KUNENA_BUTTON_LAYOUT_FLAT')), $this->limitstart, $this->limit, JText::_('COM_KUNENA_BUTTON_LAYOUT_FLAT_LONG'), 'nofollow', 'kicon-button kbuttonuser btn-left');
}
if ($this->layout != 'threaded') {
$this->layout_buttons[] = CKunenaLink::GetThreadLayoutLink('threaded', $this->catid, $this->thread, $this->mesid, CKunenaTools::showButton('layout-threaded', JText::_('COM_KUNENA_BUTTON_LAYOUT_THREADED')), $this->limitstart, $this->limit, JText::_('COM_KUNENA_BUTTON_LAYOUT_THREADED_LONG'), 'nofollow', 'kicon-button kbuttonuser btn-left');
}
if ($this->layout != 'indented') {
$this->layout_buttons[] = CKunenaLink::GetThreadLayoutLink('indented', $this->catid, $this->thread, $this->mesid, CKunenaTools::showButton('layout-indented', JText::_('COM_KUNENA_BUTTON_LAYOUT_INDENTED')), $this->limitstart, $this->limit, JText::_('COM_KUNENA_BUTTON_LAYOUT_INDENTED_LONG'), 'nofollow', 'kicon-button kbuttonuser btn-left');
}
}
//Perform subscriptions check only once
$this->cansubscribe = 0;
if ($this->config->allowsubscriptions && $this->config->topic_subscriptions != 'disabled' && $this->my->id) {
$this->db->setQuery("SELECT thread, future1 FROM #__kunena_subscriptions WHERE userid={$this->db->Quote($this->my->id)} AND thread={$this->db->Quote($this->thread)}");
$fb_subscribed = $this->db->loadObject();
KunenaError::checkDatabaseError();
if (!$fb_subscribed) {
$this->cansubscribe = 1;
} elseif ($fb_subscribed->future1 == 1) {
$query_thread = "UPDATE #__kunena_subscriptions\n\t\t\t\t\tSET future1=0 WHERE thread={$this->db->Quote($this->thread)} AND userid={$this->db->Quote($this->my->id)}";
$this->db->setQuery($query_thread);
$this->db->query();
}
}
//Perform favorites check only once
$fb_canfavorite = 0;
$this->db->setQuery("SELECT MAX(userid={$this->db->Quote($this->my->id)}) AS favorited, COUNT(*) AS totalfavorited FROM #__kunena_favorites WHERE thread={$this->db->Quote($this->thread)}");
list($this->favorited, $this->totalfavorited) = $this->db->loadRow();
KunenaError::checkDatabaseError();
if ($this->config->allowfavorites && $this->my->id) {
if (!$this->favorited) {
$fb_canfavorite = 1;
}
}
示例2: implode
">
<span class="<?php
echo implode('"></span><span class="ktree ktree-', $this->msg->indent);
?>
"></span>
<?php
if ($this->msg->id == $this->mesid) {
?>
<?php
echo $this->subjectHtml;
?>
<?php
} else {
?>
<?php
echo CKunenaLink::GetThreadLayoutLink(null, $this->catid, $this->msg->thread, $this->msg->id, $this->subjectHtml, $this->limitstart, $this->limit);
?>
<?php
}
?>
</td>
<td class="kcol-mid kprofile kprofile-list"><?php
echo CKunenaLink::GetProfileLink($this->profile->userid, $this->username);
?>
</td>
<td class="kcol-last kmsgdate kmsgdate-list" title="<?php
echo CKunenaTimeformat::showDate($this->msg->time, 'config_post_dateformat_hover');
?>
">
<?php
echo CKunenaTimeformat::showDate($this->msg->time, 'config_post_dateformat');