[geeklog-cvs] geeklog: For individual topics, syndication now returns stories ...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Mon Dec 5 11:47:01 EST 2011
changeset 8455:ccebfd88ae7b
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/ccebfd88ae7b
user: Tom <websitemaster at cogeco.net>
date: Mon Dec 05 11:45:50 2011 -0500
description:
For individual topics, syndication now returns stories for topics that have anonymous access.
diffstat:
system/lib-syndication.php | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (43 lines):
diff -r ca5dc37cadde -r ccebfd88ae7b system/lib-syndication.php
--- a/system/lib-syndication.php Mon Dec 05 11:42:09 2011 -0500
+++ b/system/lib-syndication.php Mon Dec 05 11:45:50 2011 -0500
@@ -96,7 +96,7 @@
$where .= ' AND frontpage = 1';
}
- $result = DB_query( "SELECT sid FROM {$_TABLES['stories']}, {$_TABLES['topic_assignments']} ta WHERE draft_flag = 0 AND date <= NOW() $where AND perm_anon > 0 ORDER BY date DESC $limitsql" );
+ $result = DB_query( "SELECT sid FROM {$_TABLES['stories']}, {$_TABLES['topic_assignments']} ta WHERE draft_flag = 0 AND date <= NOW() $where AND perm_anon > 0 GROUP BY sid ORDER BY date DESC $limitsql" );
$nrows = DB_numRows( $result );
for( $i = 0; $i < $nrows; $i++ )
@@ -160,7 +160,8 @@
FROM {$_TABLES['stories']}, {$_TABLES['topic_assignments']} ta
WHERE draft_flag = 0 AND date <= NOW() AND perm_anon > 0
AND ta.type = 'article' AND ta.id = sid
- AND ta.tid = '$tid'" . COM_getTopicSQL('AND', 1, 'ta') . "
+ AND ta.tid = '$tid'" . COM_getTopicSQL('AND', 1, 'ta') . "
+ GROUP BY sid
ORDER BY date DESC $limitsql";
$result = DB_query($sql);
@@ -264,8 +265,8 @@
$topic = stripslashes( DB_getItem( $_TABLES['topics'], 'topic',
"tid = '$tid'" ));
- // Retrieve list of inherited topics
- $tid_list = TOPIC_getChildList($tid);
+ // Retrieve list of inherited topics for anonymous user
+ $tid_list = TOPIC_getChildList($tid, 1);
//$sql = "SELECT sid,uid,title,introtext,bodytext,postmode,UNIX_TIMESTAMP(date) AS modified,commentcode,trackbackcode FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() AND tid = '$tid' AND perm_anon > 0 ORDER BY date DESC $limitsql";
$sql = "SELECT sid,uid,title,introtext,bodytext,postmode,UNIX_TIMESTAMP(date) AS modified,commentcode,trackbackcode
@@ -410,7 +411,8 @@
$sql = "SELECT sid,ta.tid,uid,title,introtext,bodytext,postmode,UNIX_TIMESTAMP(date) AS modified,commentcode,trackbackcode
FROM {$_TABLES['stories']}, {$_TABLES['topic_assignments']} ta
- WHERE draft_flag = 0 AND date <= NOW() AND ta.type = 'article' AND ta.id = sid AND ta.tdefault = 1 $where AND perm_anon > 0
+ WHERE draft_flag = 0 AND date <= NOW() AND ta.type = 'article' AND ta.id = sid $where AND perm_anon > 0
+ GROUP BY sid
ORDER BY date DESC $limitsql";
$result = DB_query($sql);
More information about the geeklog-cvs
mailing list