本文整理汇总了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;
}