diff options
author | Thomas Willingham <founder@kakste.com> | 2013-06-07 03:46:43 +0100 |
---|---|---|
committer | Thomas Willingham <founder@kakste.com> | 2013-06-07 03:46:43 +0100 |
commit | 466a6d5227fbaf0a36cd76b5603cb42bb1b7462b (patch) | |
tree | 395936a63e27fa105e0dc69d13c1b951dc9e9439 /include/text.php | |
parent | dc6472e046ee6ac0afc934e8ad1edc1e281a3cb0 (diff) | |
parent | c21f8c68e39e22a0348e5717109f0005d4d35809 (diff) | |
download | volse-hubzilla-466a6d5227fbaf0a36cd76b5603cb42bb1b7462b.tar.gz volse-hubzilla-466a6d5227fbaf0a36cd76b5603cb42bb1b7462b.tar.bz2 volse-hubzilla-466a6d5227fbaf0a36cd76b5603cb42bb1b7462b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/text.php')
-rwxr-xr-x | include/text.php | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/include/text.php b/include/text.php index 9f32959b2..71f2257ac 100755 --- a/include/text.php +++ b/include/text.php @@ -334,20 +334,16 @@ function alt_pager(&$a, $i, $more = '', $less = '') { $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).'">' . $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"; + return replace_macros(get_markup_template('alt_pager.tpl'),array( + '$has_less' => (($a->pager['page'] > 1) ? true : false), + '$has_more' => (($i > 0 && $i == $a->pager['itemspage']) ? true : false), + '$less' => $less, + '$more' => $more, + '$url' => $url, + '$prevpage' => $a->pager['page'] - 1, + '$nextpage' => $a->pager['page'] + 1, + )); - return $o; } // Turn user/group ACLs stored as angle bracketed text into arrays @@ -1598,7 +1594,7 @@ function store_item_tag($uid,$iid,$otype,$type,$term,$url = '') { dbesc($term), dbesc($url) ); - if(count($r)) + if($r) return false; $r = q("insert into term (uid, oid, otype, type, term, url) values( %d, %d, %d, %d, '%s', '%s') ", @@ -1650,7 +1646,7 @@ function file_tag_save_file($uid,$item,$file) { intval($item), intval($uid) ); - if(count($r)) { + if($r) { if(! stristr($r[0]['file'],'[' . file_tag_encode($file) . ']')) q("update item set file = '%s' where id = %d and uid = %d limit 1", dbesc($r[0]['file'] . '[' . file_tag_encode($file) . ']'), @@ -1680,7 +1676,7 @@ function file_tag_unsave_file($uid,$item,$file,$cat = false) { intval($item), intval($uid) ); - if(! count($r)) + if(! $r) return false; q("update item set file = '%s' where id = %d and uid = %d limit 1", @@ -1693,7 +1689,7 @@ function file_tag_unsave_file($uid,$item,$file,$cat = false) { intval($uid) ); - if(! count($r)) { + if(! $r) { $saved = get_pconfig($uid,'system','filetags'); set_pconfig($uid,'system','filetags',str_replace($pattern,'',$saved)); |