mirror of
https://github.com/friendica/friendica
synced 2025-04-26 21:10:16 +00:00
add alt_pager function, add ability to use new pager logic on network, profile, community, and search.
This commit is contained in:
parent
7fc1bae515
commit
717fd8539b
5 changed files with 123 additions and 59 deletions
|
@ -280,6 +280,31 @@ function paginate(&$a) {
|
|||
return $o;
|
||||
}}
|
||||
|
||||
if(! function_exists('alt_pager')) {
|
||||
function alt_pager(&$a, $i) {
|
||||
$o = '';
|
||||
$stripped = preg_replace('/(&page=[0-9]*)/','',$a->query_string);
|
||||
$stripped = str_replace('q=','',$stripped);
|
||||
$stripped = trim($stripped,'/');
|
||||
$pagenum = $a->pager['page'];
|
||||
$url = $a->get_baseurl() . '/' . $stripped;
|
||||
|
||||
$o .= '<div class="pager">';
|
||||
|
||||
if($a->pager['page']>1)
|
||||
$o .= "<a href=\"$url"."&page=".($a->pager['page'] - 1).'">' . t('newer') . '</a>';
|
||||
if($i>0) {
|
||||
if($a->pager['page']>1)
|
||||
$o .= " - ";
|
||||
$o .= "<a href=\"$url"."&page=".($a->pager['page'] + 1).'">' . t('older') . '</a>';
|
||||
}
|
||||
|
||||
|
||||
$o .= '</div>'."\r\n";
|
||||
|
||||
return $o;
|
||||
}}
|
||||
|
||||
// Turn user/group ACLs stored as angle bracketed text into arrays
|
||||
|
||||
if(! function_exists('expand_acl')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue