本文整理匯總了PHP中CKunenaLink::GetLatestPageLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP CKunenaLink::GetLatestPageLink方法的具體用法?PHP CKunenaLink::GetLatestPageLink怎麽用?PHP CKunenaLink::GetLatestPageLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CKunenaLink
的用法示例。
在下文中一共展示了CKunenaLink::GetLatestPageLink方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: KunenaLatestxPagination
function KunenaLatestxPagination($func, $sel, $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 = '<span class="fb_pagination">' . _PAGE;
if ($startpage > 1) {
if ($endpage < $totalpages) {
$endpage--;
}
$output .= CKunenaLink::GetLatestPageLink($func, 1, 'follow', '', $sel);
if ($startpage > 2) {
$output .= "...";
}
}
for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) {
if ($page == $i) {
$output .= "<strong>{$i}</strong>";
} else {
$output .= CKunenaLink::GetLatestPageLink($func, $i, 'follow', '', $sel);
}
}
if ($endpage < $totalpages) {
if ($endpage < $totalpages - 1) {
$output .= "...";
}
$output .= CKunenaLink::GetLatestPageLink($func, $totalpages, 'follow', '', $sel);
}
$output .= '</span>';
return $output;
}
示例2: getPagination
function getPagination($func, $sel, $page, $totalpages, $maxpages)
{
if ($func != 'latest') {
$func = 'latest&do=' . $func;
}
if ($this->userid) {
$func .= '&userid=' . $this->userid;
}
$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::GetLatestPageLink($func, 1, 'follow', '', $sel) . '</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::GetLatestPageLink($func, $i, 'follow', '', $sel) . '</li>';
}
}
if ($endpage < $totalpages) {
if ($endpage < $totalpages - 1) {
$output .= '<li class="more">...</li>';
}
$output .= '<li>' . CKunenaLink::GetLatestPageLink($func, $totalpages, 'follow', '', $sel) . '</li>';
}
$output .= '</ul>';
return $output;
}