aboutsummaryrefslogtreecommitdiffstats
path: root/admin/comments.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2013-11-28 13:06:31 +0000
committerplegall <plg@piwigo.org>2013-11-28 13:06:31 +0000
commit092fdc76e0e628d7d31cf10439cb4aa39637c99f (patch)
tree80ba66059bac1275ebd76fe6c4c6a12a15ca3464 /admin/comments.php
parent33d57530a3cfa77a544fa6526b9365a2701d75df (diff)
feature 2920: add a navigation bar for long list of comments
git-svn-id: http://piwigo.org/svn/trunk@25744 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/comments.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/admin/comments.php b/admin/comments.php
index e22771a78..7a391ceac 100644
--- a/admin/comments.php
+++ b/admin/comments.php
@@ -28,9 +28,19 @@ if (!defined('PHPWG_ROOT_PATH'))
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+if (isset($_GET['start']) and is_numeric($_GET['start']))
+{
+ $page['start'] = $_GET['start'];
+}
+else
+{
+ $page['start'] = 0;
+}
+
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
// +-----------------------------------------------------------------------+
+
check_status(ACCESS_ADMINISTRATOR);
// +-----------------------------------------------------------------------+
@@ -165,6 +175,7 @@ SELECT
ON u.'.$conf['user_fields']['id'].' = c.author_id
WHERE '.implode(' AND ', $where_clauses).'
ORDER BY c.date DESC
+ LIMIT '.$page['start'].', '.$conf['comments_page_nb_comments'].'
;';
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
@@ -200,6 +211,19 @@ while ($row = pwg_db_fetch_assoc($result))
}
// +-----------------------------------------------------------------------+
+// | navigation bar |
+// +-----------------------------------------------------------------------+
+
+$navbar = create_navigation_bar(
+ get_root_url().'admin.php'.get_query_string_diff(array('start')),
+ ('pending' == $page['filter'] ? $nb_pending : $nb_total),
+ $page['start'],
+ $conf['comments_page_nb_comments']
+ );
+
+$template->assign('navbar', $navbar);
+
+// +-----------------------------------------------------------------------+
// | sending html code |
// +-----------------------------------------------------------------------+