Пример #1
0
 function getPagination($function, $q, $urlparams, $page, $limit, $totalpages, $maxpages)
 {
     if ($page == 0) {
         $page++;
     }
     $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::GetSearchLink($function, $q, 0, $limit, 1, $urlparams, $rel = 'nofollow') . '</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::GetSearchLink($function, $q, ($i - 1) * $limit, $limit, $i, $urlparams, $rel = 'nofollow') . '</li>';
         }
     }
     if ($endpage < $totalpages) {
         if ($endpage < $totalpages - 1) {
             $output .= '<li class="more">...</li>';
         }
         $output .= '<li>' . CKunenaLink::GetSearchLink($function, $q, ($totalpages - 1) * $limit, $limit, $totalpages, $urlparams, $rel = 'nofollow') . '</li>';
     }
     $output .= '</ul>';
     return $output;
 }
Пример #2
0
function KunenaSearchPagination($function, $q, $urlparams, $page, $limit, $totalpages, $maxpages)
{
    $fbConfig =& CKunenaConfig::getInstance();
    if ($page == 0) {
        $page++;
    }
    $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 = '<div class="fb_pagination">' . _PAGE;
    if ($startpage > 1) {
        if ($endpage < $totalpages) {
            $endpage--;
        }
        $output .= CKunenaLink::GetSearchLink($fbConfig, $function, $q, 0, $limit, 1, $urlparams, $rel = 'nofollow');
        if ($startpage > 2) {
            $output .= "...";
        }
    }
    for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) {
        if ($page == $i) {
            $output .= "<strong>{$i}</strong>";
        } else {
            $output .= CKunenaLink::GetSearchLink($fbConfig, $function, $q, ($i - 1) * $limit, $limit, $i, $urlparams, $rel = 'nofollow');
        }
    }
    if ($endpage < $totalpages) {
        if ($endpage < $totalpages - 1) {
            $output .= "...";
        }
        $output .= CKunenaLink::GetSearchLink($fbConfig, $function, $q, ($totalpages - 1) * $limit, $limit, $totalpages, $urlparams, $rel = 'nofollow');
    }
    $output .= '</div>';
    return $output;
}
Пример #3
0
        $is_editor = false;
    }
    if ($is_editor) {
        ?>
| <a href = "<?php 
        echo CKunenaLink::GetAnnouncementURL($fbConfig, 'show');
        ?>
"><?php 
        echo _ANN_ANNOUNCEMENTS;
        ?>
 </a>
<?php 
    }
    ?>
| <?php 
    echo CKunenaLink::GetSearchLink($fbConfig, 'search', '', 0, 0, _KUNENA_SEARCH_ADVSEARCH);
    ?>

</td>
			<?php 
    if (JDocumentHTML::countModules('kunena_profilebox')) {
        ?>

			<td>
				<div class = "fb_profilebox_modul">
				<?php 
        $document =& JFactory::getDocument();
        $renderer = $document->loadRenderer('modules');
        $options = array('style' => 'xhtml');
        $position = 'kunena_profilebox';
        echo $renderer->render($position, $options, null);