[geeklog-hg] geeklog: Fixed a bug where the same block was displayed more tha...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Aug 12 04:19:10 EDT 2014


changeset 9539:cba303c2aa0f
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/cba303c2aa0f
user: Kenji ITO <mystralkk at gmail.com>
date: Tue Aug 12 17:18:16 2014 +0900
description:
Fixed a bug where the same block was displayed more than once when it belonged to multiple topics

diffstat:

 public_html/lib-common.php |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r 017347368a16 -r cba303c2aa0f public_html/lib-common.php
--- a/public_html/lib-common.php	Sun Aug 03 14:32:47 2014 +0900
+++ b/public_html/lib-common.php	Tue Aug 12 17:18:16 2014 +0900
@@ -4449,12 +4449,12 @@
         }
     }
 
-    $blocksql['mssql']  = "SELECT bid, is_enabled, name, b.type, title, blockorder, cast(content as text) as content, cache_time, ";
+    $blocksql['mssql']  = "SELECT DISTINCT bid, is_enabled, name, b.type, title, blockorder, cast(content as text) as content, cache_time, ";
     $blocksql['mssql'] .= "rdfurl, rdfupdated, rdflimit, onleft, phpblockfn, help, owner_id, ";
     $blocksql['mssql'] .= "group_id, perm_owner, perm_group, perm_members, perm_anon, allow_autotags,UNIX_TIMESTAMP(rdfupdated) AS date ";
 
-    $blocksql['mysql'] = "SELECT b.*,UNIX_TIMESTAMP(rdfupdated) AS date ";
-    $blocksql['pgsql'] = 'SELECT b.*, date_part(\'epoch\', rdfupdated) AS date ';
+    $blocksql['mysql'] = "SELECT DISTINCT b.*,UNIX_TIMESTAMP(rdfupdated) AS date ";
+    $blocksql['pgsql'] = 'SELECT DISTINCT b.*, date_part(\'epoch\', rdfupdated) AS date ';
 
     $blocksql['mysql'] .= "FROM {$_TABLES['blocks']} b, {$_TABLES['topic_assignments']} ta WHERE ta.type = 'block' AND ta.id = bid AND is_enabled = 1";
     $blocksql['mssql'] .= "FROM {$_TABLES['blocks']} b, {$_TABLES['topic_assignments']} ta WHERE ta.type = 'block' AND ta.id = bid AND is_enabled = 1";



More information about the geeklog-cvs mailing list