public
Created

The pagenav parameter in wp-filebase shortcode was ignored. So the paginator in the bottom of the list can't be hidden. The patch below solved this issue.

  • Download Gist
wp-filebase.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
diff -ur wp-filebase.0.2.9.27//classes/ListTpl.php wp-filebase/classes/ListTpl.php
--- wp-filebase.0.2.9.27//classes/ListTpl.php 2012-11-28 23:16:38.000000000 +0800
+++ wp-filebase/classes/ListTpl.php 2012-11-30 09:14:26.849134906 +0800
@@ -94,7 +94,7 @@
return $link.($desc?'gt;':'lt;').$by;
}
- function Generate($categories, $show_cats, $file_order, $page_limit, $cat_order=null)
+ function Generate($categories, $show_cats, $file_order, $page_limit, $cat_order=null, $is_pagenav)
{
$uid = uniqid();
$content = self::ParseHeaderFooter($this->header, $uid);
@@ -183,7 +183,7 @@
$footer = self::ParseHeaderFooter($this->footer, $uid);
- if($page_limit > 0 && $num_total_files > $page_limit) {
+ if($page_limit > 0 && $num_total_files > $page_limit && $is_pagenav) {
$pagenav = paginate_links( array(
'base' => add_query_arg( 'wpfb_list_page', '%#%' ),
'format' => '',
diff -ur wp-filebase.0.2.9.27//classes/Output.php wp-filebase/classes/Output.php
--- wp-filebase.0.2.9.27//classes/Output.php 2012-11-28 23:16:38.000000000 +0800
+++ wp-filebase/classes/Output.php 2012-11-30 08:49:42.881494552 +0800
@@ -85,7 +85,7 @@
}
}
- return $tpl->Generate($cats, $args['showcats'], $args['sort'], $args['num'], $args['sortcats']);
+ return $tpl->Generate($cats, $args['showcats'], $args['sort'], $args['num'], $args['sortcats'], $args['pagenav']);
}
static function FileBrowser(&$content, $root_cat_id=0, $cur_cat_id=0)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.