[geeklog-hg] geeklog: Fixed topics not displaying correct stories for a langu...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jul 13 13:42:42 EDT 2013


changeset 9186:9e2be3704d10
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/9e2be3704d10
user: Tom <websitemaster at cogeco.net>
date: Sat Jul 13 13:13:28 2013 -0400
description:
Fixed topics not displaying correct stories for a language (in multi language setups)

diffstat:

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

diffs (41 lines):

diff -r fc379b4c0ef7 -r 9e2be3704d10 public_html/index.php
--- a/public_html/index.php	Sat Jul 13 12:32:48 2013 -0400
+++ b/public_html/index.php	Sat Jul 13 13:13:28 2013 -0400
@@ -240,6 +240,7 @@
     }
 }
 
+// Figure out different settings to display stories in a topic
 $sql = " (date <= NOW()) AND (draft_flag = 0)";
 
 if (empty ($topic)) {
@@ -295,7 +296,7 @@
          . $userfields . ", t.topic, t.imageurl "
          . "FROM {$_TABLES['stories']} AS s, {$_TABLES['topic_assignments']} AS ta,{$_TABLES['users']} AS u, "
          . "{$_TABLES['topics']} AS t WHERE (s.uid = u.uid) AND (ta.tid = t.tid) AND"
-         . " ta.type = 'article' AND ta.id = s.sid AND"
+         . " ta.type = 'article' AND ta.id = s.sid " . COM_getLangSQL('sid', 'AND', 's') . " AND "
          . $sql . " GROUP BY s.sid ORDER BY featured DESC, date DESC LIMIT $offset, $limit";     
 
 $msql['mssql'] = "SELECT s.sid, s.uid, s.draft_flag, ta.tid, s.date, s.title, cast(s.introtext as text) as introtext, cast(s.bodytext as text) as bodytext, s.hits, s.numemails, s.comments, s.trackbacks, s.related, s.featured, s.show_topic_icon, s.commentcode, s.trackbackcode, s.statuscode, s.expire, s.postmode, s.frontpage, s.owner_id, s.group_id, s.perm_owner, s.perm_group, s.perm_members, s.perm_anon, s.advanced_editor_mode, "
@@ -304,7 +305,7 @@
          . $userfields . ", t.topic, t.imageurl "
          . "FROM {$_TABLES['stories']} AS s, {$_TABLES['topic_assignments']} AS ta, {$_TABLES['users']} AS u, "
          . "{$_TABLES['topics']} AS t WHERE (s.uid = u.uid) AND (ta.tid = t.tid) AND"
-         . " ta.type = 'article' AND ta.id = s.sid AND"
+         . " ta.type = 'article' AND ta.id = s.sid AND " . COM_getLangSQL('sid', 'AND', 's') . " AND "
          . $sql . " GROUP BY s.sid ORDER BY featured DESC, date DESC LIMIT $offset, $limit";   
          
 $msql['pgsql'] = "SELECT s.*, ta.tid, UNIX_TIMESTAMP(s.date) AS unixdate,
@@ -312,9 +313,9 @@
             {$userfields}, t.topic, t.imageurl
             FROM {$_TABLES['stories']} AS s, {$_TABLES['topic_assignments']} AS ta, {$_TABLES['users']} AS u,
             {$_TABLES['topics']} AS t WHERE (s.uid = u.uid) AND (ta.tid = t.tid) AND 
-            ta.type = 'article' AND ta.id = s.sid AND
+            ta.type = 'article' AND ta.id = s.sid AND  " . COM_getLangSQL('sid', 'AND', 's') . " AND 
             {$sql} GROUP BY s.sid, ta.tid, expireunix, {$userfields}, t.topic, t.imageurl ORDER BY featured DESC, date DESC LIMIT {$offset}, {$limit}";   
-         
+
 $result = DB_query ($msql);
 
 $nrows = DB_numRows ($result);



More information about the geeklog-cvs mailing list