function KunenaViewPagination($catid, $threadid, $page, $totalpages, $maxpages) { $fbConfig =& CKunenaConfig::getInstance(); $startpage = $page - floor($maxpages / 2) < 1 ? 1 : $page - floor($maxpages / 2); $endpage = $startpage + $maxpages; if ($endpage > $totalpages) { $startpage = $totalpages - $maxpages < 1 ? 1 : $totalpages - $maxpages; $endpage = $totalpages; } $output = '<span class="fb_pagination">' . _PAGE; if ($startpage > 1) { if ($endpage < $totalpages) { $endpage--; } $output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, 1, $fbConfig->messages_per_page, 1, '', $rel = 'follow'); if ($startpage > 2) { $output .= "..."; } } for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) { if ($page == $i) { $output .= "<strong>{$i}</strong>"; } else { $output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, $i, $fbConfig->messages_per_page, $i, '', $rel = 'follow'); } } if ($endpage < $totalpages) { if ($endpage < $totalpages - 1) { $output .= "..."; } $output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, $totalpages, $fbConfig->messages_per_page, $totalpages, '', $rel = 'follow'); } $output .= '</span>'; return $output; }
<td class="kcol-mid ktopictittle"> <?php echo CKunenaLink::GetThreadLink('view', intval($firstpost->catid), intval($firstpost->id), KunenaParser::parseText($firstpost->subject, 20), KunenaParser::stripBBCode($firstpost->message), 'follow', 'ktopic-title km'); ?> <?php if ($message->favcount) { if ($message->myfavorite) { echo CKunenaTools::showIcon('kfavoritestar', JText::_('COM_KUNENA_FAVORITE')); } else { echo CKunenaTools::showIcon('kfavoritestar-grey', JText::_('COM_KUNENA_FAVORITE')); } } ?> <?php if ($message->unread) { echo CKunenaLink::GetThreadPageLink('view', intval($message->catid), intval($message->id), $unreadPage, intval($this->config->messages_per_page), '<sup class="knewchar"> (' . intval($message->unread) . ' ' . JText::_('COM_KUNENA_A_GEN_NEWCHAR') . ')</sup>', intval($message->lastread)); } if ($message->locked != 0) { echo CKunenaTools::showIcon('ktopiclocked', JText::_('COM_KUNENA_GEN_LOCKED_TOPIC')); } ?> <div class="ks"> <!-- Category --> <span class="ktopic-category"> <?php echo JText::_('COM_KUNENA_CATEGORY') . ' ' . CKunenaLink::GetCategoryLink('showcat', intval($message->catid), $this->escape($message->catname)); ?> </span> <!-- /Category --> </div> </td>
<?php } ?> <!-- /Avatar --> <!-- Latest Post --> <span class="topic_latest_post"> <?php if ($fbConfig->default_sort == 'asc') { if ($leaf->moved == 0) { echo CKunenaLink::GetThreadPageLink($fbConfig, 'view', $leaf->catid, $leaf->thread, $threadPages, $fbConfig->messages_per_page, _GEN_LAST_POST, $last_reply[$leaf->id]->id); } else { echo _KUNENA_MOVED . ' '; } } else { echo CKunenaLink::GetThreadPageLink($fbConfig, 'view', $leaf->catid, $leaf->thread, 1, $fbConfig->messages_per_page, _GEN_LAST_POST, $last_reply[$leaf->id]->id); } if ($leaf->name) { echo ' ' . _GEN_BY . ' ' . CKunenaLink::GetProfileLink($fbConfig, $last_reply[$leaf->id]->userid, stripslashes($last_reply[$leaf->id]->name), 'nofollow', 'topic_latest_post_user'); } ?> </span> <!-- /Latest Post --> <br /> <!-- Latest Post Date --> <span class="topic_date"> <?php echo time_since($last_reply[$leaf->id]->time, time() + $fbConfig->board_ofset * 3600); ?> <?php echo _KUNENA_AGO;
?> </span> <?php } } ?> <!-- /Avatar --> <!-- Latest Post --> <span class="ktopic-latest-post"> <?php if ($leaf->moved) { echo JText::_('COM_KUNENA_MOVED'); } elseif ($this->topic_ordering == 'ASC') { echo CKunenaLink::GetThreadPageLink('view', intval($leaf->catid), intval($leaf->thread), $threadPages, intval($this->config->messages_per_page), JText::_('COM_KUNENA_GEN_LAST_POST'), intval($this->lastreply[$leaf->thread]->id)); } else { echo CKunenaLink::GetThreadPageLink('view', intval($leaf->catid), intval($leaf->thread), 1, intval($this->config->messages_per_page), JText::_('COM_KUNENA_GEN_LAST_POST'), intval($this->lastreply[$leaf->thread]->id)); } if ($leaf->name) { echo ' ' . JText::_('COM_KUNENA_GEN_BY') . ' ' . CKunenaLink::GetProfileLink(intval($this->lastreply[$leaf->thread]->userid), $this->escape($this->lastreply[$leaf->thread]->name), '', 'nofollow'); } ?> </span> <!-- /Latest Post --> <br /> <!-- Latest Post Date --> <span class="ktopic-date" title="<?php echo CKunenaTimeformat::showDate($this->lastreply[$leaf->thread]->time, 'config_post_dateformat_hover'); ?> "> <?php echo CKunenaTimeformat::showDate($this->lastreply[$leaf->thread]->time, 'config_post_dateformat');
<?php } ?> <tr> <td rowspan="2" valign="top" class="kprofile-left kresultauthor"> <p><?php echo $this->escape($result->name); ?> </p> </td> <td class="kmessage-left resultmsg"> <div class="kmsgbody"> <div class="kmsgtitle kresult-title"> <span class="kmsgtitle"> <?php echo CKunenaLink::GetThreadPageLink('view', intval($result->catid), intval($result->id), NULL, NULL, $result->htmlsubject, intval($result->id)); ?> </span> </div> <div class="kmsgtext resultmsg"> <?php echo $result->htmlmessage; ?> </div> <div class="resultcat"> <?php echo JText::_('COM_KUNENA_CATEGORY') . ' ' . CKunenaLink::GetCategoryLink('showcat', intval($result->catid), $this->escape($result->catname), $rel = 'follow', $class = '', $title = ''); ?> </div> </div> </td>
<span class="kcategory-views"> <?php echo JText::_('COM_KUNENA_MY_POSTS'); ?> </span> </td> <?php $last = $this->category->getLastPosted(); if ($last->last_topic_id) : ?> <td class="kcategory-topic"> <ul> <?php if ($this->config->avataroncat > 0) : $useravatar = KunenaFactory::getUser((int)$last->last_post_userid)->getAvatarImage('klist-avatar', 'list'); if ($useravatar) : ?> <li class="klatest-avatar"> <?php echo CKunenaLink::GetProfileLink ( intval($last->last_post_userid), $useravatar ); ?></li> <?php endif; ?> <?php endif; ?> <li class="ktopic-title"> <?php echo JText::_('COM_KUNENA_GEN_LAST_POST') . ': '. CKunenaLink::GetThreadPageLink ( 'view', intval($last->id), intval($last->last_topic_id), intval($last->getLastPostLocation()), intval($this->config->messages_per_page), KunenaHtmlParser::parseText($last->last_topic_subject, 30), intval($last->last_post_id) );?> </li> <li class="ktopic-details"> <?php echo JText::_('COM_KUNENA_BY') . ' '; echo CKunenaLink::GetProfileLink ( intval($last->last_post_userid), $this->escape($last->last_post_guest_name) ); echo KunenaDate::getInstance($last->last_post_time)->toSpan('config_post_dateformat','config_post_dateformat_hover'); ?> </li> </ul> </td> <?php else : ?> <td class="kcol-mid kcol-knoposts"><?php echo JText::_('COM_KUNENA_NO_POSTS'); ?></td> <?php endif ?>
?> latest-subject fbm"> <?php echo CKunenaLink::GetThreadPageLink($fbConfig, 'view', $singlerow->catid, $latestthread, $latestthreadpages, $fbConfig->messages_per_page, $latestsubject, $latestid); ?> </div> <div class = "<?php echo $boardclass; ?> latest-subject-by fbs"> <?php echo _GEN_BY . ' '; echo CKunenaLink::GetProfileLink($fbConfig, $latestuserid, $latestname); echo ' | ' . $lastptime . ' '; echo CKunenaLink::GetThreadPageLink($fbConfig, 'view', $singlerow->catid, $latestthread, $latestthreadpages, $fbConfig->messages_per_page, isset($fbIcons['latestpost']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['latestpost'] . '" border="0" alt="' . _SHOW_LAST . '" title="' . _SHOW_LAST . '"/>' : '<img src="' . KUNENA_URLEMOTIONSPATH . 'icon_newest_reply.gif" border="0" alt="' . _SHOW_LAST . '"/>', $latestid); ?> </div> </td> </tr> <?php } else { ?> <td class = "td-5" align="left"> <?php echo _NO_POSTS; ?> </td>
function getPagination($catid, $threadid, $page, $totalpages, $maxpages) { $startpage = $page - floor($maxpages / 2) < 1 ? 1 : $page - floor($maxpages / 2); $endpage = $startpage + $maxpages; if ($endpage > $totalpages) { $startpage = $totalpages - $maxpages < 1 ? 1 : $totalpages - $maxpages; $endpage = $totalpages; } $output = '<ul class="kpagination">'; $output .= '<li class="page">' . JText::_('COM_KUNENA_PAGE') . '</li>'; if ($startpage > 1) { if ($endpage < $totalpages) { $endpage--; } $output .= '<li>' . CKunenaLink::GetThreadPageLink('view', $catid, $threadid, 1, $this->config->messages_per_page, 1, '', $rel = 'follow') . '</li>'; if ($startpage > 2) { $output .= '<li class="more">...</li>'; } } for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) { if ($page == $i) { $output .= '<li class="active">' . $i . '</li>'; } else { $output .= '<li>' . CKunenaLink::GetThreadPageLink('view', $catid, $threadid, $i, $this->config->messages_per_page, $i, '', $rel = 'follow') . '</li>'; } } if ($endpage < $totalpages) { if ($endpage < $totalpages - 1) { $output .= '<li class="more">...</li>'; } $output .= '<li>' . CKunenaLink::GetThreadPageLink('view', $catid, $threadid, $totalpages, $this->config->messages_per_page, $totalpages, '', $rel = 'follow') . '</li>'; } $output .= '</ul>'; return $output; }
function GetLatestPostAutoRedirectHTML($fbConfig, $pid, $limit, $catid = 0) { $kunena_db =& JFactory::getDBO(); // First determine the thread, latest post and number of posts for the post supplied $where = ''; if ($catid > 0) { $where .= " AND a.catid = {$catid} "; } $kunena_db->setQuery("SELECT a.thread AS thread, MAX(a.id) AS latest_id, MAX(a.catid) AS catid, COUNT(*) AS totalmessages\n FROM #__fb_messages AS a,\n (SELECT MAX(thread) AS thread FROM #__fb_messages WHERE id='{$pid}') AS b\n WHERE a.thread = b.thread AND a.hold='0' {$where}\n GROUP BY a.thread"); $result = $kunena_db->loadObject(); check_dberror("Unable to retrieve latest post."); // Now Calculate the number of pages for this particular thread if (is_object($result)) { $catid = $result->catid; $threadPages = ceil($result->totalmessages / $limit); } // Finally build output block $Output = '<div align="center">'; if (is_object($result)) { $Output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $result->thread, $threadPages, $limit, _POST_SUCCESS_VIEW, $result->latest_id) . '<br />'; } $Output .= CKunenaLink::GetCategoryLink('showcat', $catid, _POST_SUCCESS_FORUM) . '<br />'; $Output .= '</div>'; if (is_object($result)) { $Output .= CKunenaLink::GetAutoRedirectHTML(CKunenaLink::GetThreadPageURL($fbConfig, 'view', $catid, $result->thread, $threadPages, $limit, $result->latest_id), 3500); } else { $Output .= CKunenaLink::GetAutoRedirectHTML(JRoute::_(KUNENA_LIVEURLREL . '&func=showcat&catid=' . $catid), 3500); } return $Output; }
echo _GEN_BY; ?> <?php echo CKunenaLink::GetProfileLink($fbConfig, $last_reply[$leaf->id]->userid, kunena_htmlspecialchars(stripslashes($last_reply[$leaf->id]->name))); ?> <?php } ?> <?php $tmpicon = ''; if (!$leaf->moved) { $tmpicon = isset($fbIcons['latestpost']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['latestpost'] . '" border="0" alt="' . _SHOW_LAST . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'icon_newest_reply.gif" border="0" alt="' . _SHOW_LAST . '" title="' . _SHOW_LAST . '" />'; } echo CKunenaLink::GetThreadPageLink($fbConfig, 'view', $leaf->catid, $leaf->id, $threadPages, $fbConfig->messages_per_page, $tmpicon, $last_reply[$leaf->id]->id); ?> </div> </td> <?php if ($is_Moderator) { ?> <td class = "td-7" align="center"> <input type = "checkbox" name = "fbDelete[<?php echo $leaf->id; ?> ]" value = "1"/> </td>
<tr class="ksth"> <th colspan="2"> <span class="kmsgdate"> <?php echo KunenaDate::getInstance($this->message->time)->toSpan() ?> </span> </th> </tr> </thead> <tbody> <tr> <td rowspan="2" valign="top" class="kprofile-left kresultauthor"> <p><?php echo $this->escape($this->message->name) ?></p> </td> <td class="kmessage-left resultmsg"> <div class="kmsgbody"> <div class="kmsgtitle kresult-title"> <span class="kmsgtitle"> <?php echo CKunenaLink::GetThreadPageLink ( 'view', intval($this->category->id), intval($this->topic->id), NULL, NULL, $this->subjectHtml, intval($this->message->id) )?> </span> </div> <div class="kmsgtext resultmsg"> <?php echo $this->messageHtml ?> </div> <div class="resultcat"> <?php echo JText::_('COM_KUNENA_CATEGORY') . ' ' . CKunenaLink::GetCategoryLink ( 'showcat', intval($this->category->id), $this->escape($this->category->name), $rel = 'follow', $class = '', $title = '' )?> </div> </div> </td> </tr> </tbody> </table>
if ($useravatar) { ?> <span class="klatest-avatar"> <?php echo CKunenaLink::GetProfileLink(intval($category->userid), $useravatar); ?> </span> <?php } ?> <!-- /Avatar --> <?php } ?> <div class="klatest-subject ks"> <?php echo JText::_('COM_KUNENA_GEN_LAST_POST') . ': ' . CKunenaLink::GetThreadPageLink('view', intval($category->catid), intval($category->thread), intval($category->page), intval($this->config->messages_per_page), KunenaParser::parseText($category->subject, 30), intval($category->id_last_msg)); ?> </div> <div class="klatest-subject-by ks"> <?php echo JText::_('COM_KUNENA_BY') . ' '; if (!empty($category->userid)) { echo CKunenaLink::GetProfileLink(intval($category->userid), $this->escape($this->config->username ? $category->username : $category->uname)); } else { echo CKunenaLink::GetProfileLink(intval($category->userid), $this->escape($category->mname)); } echo '<br /><span class="nowrap" title="' . CKunenaTimeformat::showDate($category->time_last_msg, 'config_post_dateformat_hover') . '">' . CKunenaTimeformat::showDate($category->time_last_msg, 'config_post_dateformat') . '</span>'; ?> </div> </td>
echo JText::_('COM_KUNENA_MOD_NOTHING'); ?> </td> </tr> <?php } else { $k = 0; foreach ($this->MessagesToApprove as $mes) { ?> <tr class="k<?php echo $this->tabclass[$k ^= 1]; ?> " > <td class="kcol-mid kcol-ktopicicon"> <?php echo CKunenaLink::GetThreadPageLink('view', intval($mes->catid), intval($mes->id), '1', intval($this->config->messages_per_page), CKunenaTools::topicIcon($mes), ''); ?> </td> <td class="kcol-mid kcol-ktopictitle"> <div class="ktopic-title-cover"><?php echo CKunenaLink::GetThreadLink('view', intval($mes->catid), intval($mes->id), KunenaParser::parseText($mes->subject), KunenaParser::stripBBCode($mes->message, 500), 'follow', 'ktopic-title km'); ?> </div> <div class="ktopic-details"> <!-- By --> <!-- Category --> <span class="ktopic-category"> <?php echo JText::_('COM_KUNENA_CATEGORY') . ' ' . CKunenaLink::GetCategoryLink('showcat', intval($mes->catid), $this->escape($mes->catname)); ?>