aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-19 00:43:05 -0800
committerfriendica <info@friendica.com>2013-01-19 00:43:05 -0800
commit9725dcf41dce7b03828a29b7f6def11ef120a88f (patch)
tree34a697e6dc276bde2fbc18540f7d64af26bc00c6 /include/text.php
parent33b6d916611f6b9ec214fff38f60df128fbc940a (diff)
downloadvolse-hubzilla-9725dcf41dce7b03828a29b7f6def11ef120a88f.tar.gz
volse-hubzilla-9725dcf41dce7b03828a29b7f6def11ef120a88f.tar.bz2
volse-hubzilla-9725dcf41dce7b03828a29b7f6def11ef120a88f.zip
distributed directory search from the navbar
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php29
1 files changed, 18 insertions, 11 deletions
diff --git a/include/text.php b/include/text.php
index 9db22d9ed..1cfc89cae 100644
--- a/include/text.php
+++ b/include/text.php
@@ -302,26 +302,33 @@ function paginate(&$a) {
}}
if(! function_exists('alt_pager')) {
-function alt_pager(&$a, $i) {
- $o = '';
+function alt_pager(&$a, $i, $more = '', $less = '') {
+
+ $o = '';
+
+ if(! $more)
+ $more = t('older');
+ if(! $less)
+ $less = t('newer');
+
$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;
+ $url = $a->get_baseurl() . '/' . $stripped;
- $o .= '<div class="pager">';
+ $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 .= "&nbsp;-&nbsp;";
- $o .= "<a href=\"$url"."&page=".($a->pager['page'] + 1).'">' . t('older') . '</a>';
+ if($a->pager['page'] > 1)
+ $o .= "<a href=\"$url"."&page=".($a->pager['page'] - 1).'">' . $less . '</a>';
+ if($i > 0 && $i == $a->pager['itemspage']) {
+ if($a->pager['page']>1)
+ $o .= " | ";
+ $o .= "<a href=\"$url"."&page=".($a->pager['page'] + 1).'">' . $more . '</a>';
}
- $o .= '</div>'."\r\n";
+ $o .= '</div>'."\r\n";
return $o;
}}