[geeklog-cvs] geeklog-1.3/public_html/admin story.php,1.94,1.95
geeklog-cvs-admin at lists.geeklog.net
geeklog-cvs-admin at lists.geeklog.net
Sat Jul 5 17:01:02 EDT 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin
In directory internal.geeklog.net:/tmp/cvs-serv31232
Modified Files:
story.php
Log Message:
Fixed "Google paging" on the list of stories when the Story Admin didn't have access to all the topics.
Index: story.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/story.php,v
retrieving revision 1.94
retrieving revision 1.95
diff -C2 -d -r1.94 -r1.95
*** story.php 1 Jul 2003 14:52:56 -0000 1.94
--- story.php 5 Jul 2003 21:01:00 -0000 1.95
***************
*** 441,459 ****
$excludetopics = '';
$topicsql = "SELECT tid FROM {$_TABLES['topics']}" . COM_getPermSQL ();
! $tresult = DB_query( $topicsql );
! $trows = DB_numRows( $tresult );
! if( $trows > 0 )
! {
! $excludetopics .= "WHERE (";
! for( $i = 1; $i <= $trows; $i++ )
! {
! $T = DB_fetchArray ($tresult);
! if ($i > 1)
! {
! $excludetopics .= " OR ";
! }
! $excludetopics .= "tid = '{$T['tid']}'";
}
- $excludetopics .= ") ";
}
--- 441,455 ----
$excludetopics = '';
$topicsql = "SELECT tid FROM {$_TABLES['topics']}" . COM_getPermSQL ();
! $tresult = DB_query ($topicsql);
! $trows = DB_numRows ($tresult);
! if ($trows > 0) {
! $tids = array ();
! for ($i = 0; $i < $trows; $i++) {
! $T = DB_fetchArray ($tresult);
! $tids[] = $T['tid'];
! }
! if (sizeof ($tids) > 0) {
! $excludetopics = " WHERE (tid IN ('" . implode ("','", $tids) . "'))";
}
}
***************
*** 498,502 ****
// Print prev/next page links if needed
! $numstories = DB_count ($_TABLES['stories']);
if ($numstories > 50) {
$prevpage = $page - 1;
--- 494,500 ----
// Print prev/next page links if needed
! $nresult = DB_query ("SELECT COUNT(*) AS count FROM {$_TABLES['stories']}" . $excludetopics);
! $N = DB_fetchArray ($nresult);
! $numstories = $N['count'];
if ($numstories > 50) {
$prevpage = $page - 1;
More information about the geeklog-cvs
mailing list