[geeklog-hg] geeklog: Fixed topic last page count. It could be incorrect if a...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Wed Sep 18 21:36:03 EDT 2013


changeset 9303:3894f8c4c995
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/3894f8c4c995
user: Tom <websitemaster at cogeco.net>
date: Wed Sep 18 20:10:14 2013 -0400
description:
Fixed topic last page count. It could be incorrect if any articles belong to more than one child topics

diffstat:

 public_html/index.php |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (19 lines):

diff -r 7e15f915da0e -r 3894f8c4c995 public_html/index.php
--- a/public_html/index.php	Mon Sep 16 21:28:10 2013 -0400
+++ b/public_html/index.php	Wed Sep 18 20:10:14 2013 -0400
@@ -318,11 +318,10 @@
 
 $result = DB_query ($msql);
 
-$nrows = DB_numRows ($result);
-
-$data = DB_query ("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} AS s, {$_TABLES['topic_assignments']} AS ta WHERE ta.type = 'article' AND ta.id = s.sid AND $sql");
-$D = DB_fetchArray ($data);
-$num_pages = ceil ($D['count'] / $limit);
+//Figure out number of total pages
+$data = DB_query ("SELECT s.sid FROM {$_TABLES['stories']} AS s, {$_TABLES['topic_assignments']} AS ta WHERE ta.type = 'article' AND ta.id = s.sid AND $sql GROUP BY s.sid");
+$nrows = DB_numRows ($data);
+$num_pages = ceil ($nrows / $limit);
 
 $breadcrumbs = '';
 



More information about the geeklog-cvs mailing list