[geeklog-hg] geeklog: Homepage Staticpage now can be viewed by itself (topic ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Apr 2 20:32:33 EDT 2013


changeset 9027:0ca924e03ea3
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/0ca924e03ea3
user: Tom <websitemaster at cogeco.net>
date: Tue Apr 02 20:31:06 2013 -0400
description:
Homepage Staticpage now can be viewed by itself (topic is set to all). Staticpage search now returns pages that are assigned to all topics and homepage (bug #0001574)

diffstat:

 plugins/staticpages/functions.inc    |  13 ++++++-------
 plugins/staticpages/services.inc.php |   5 +++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diffs (76 lines):

diff -r 755c386a9969 -r 0ca924e03ea3 plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Tue Apr 02 20:29:04 2013 -0400
+++ b/plugins/staticpages/functions.inc	Tue Apr 02 20:31:06 2013 -0400
@@ -804,7 +804,7 @@
     $sql .= "FROM {$_TABLES['staticpage']} AS sp,{$_TABLES['users']} AS u, {$_TABLES['topic_assignments']} ta ";
     $sql .= "WHERE (sp.owner_id = u.uid) AND (draft_flag = 0) AND (template_flag = 0) ";
     $sql .= "AND ta.type = 'staticpages' AND ta.id = sp.sp_id ";
-    $sql .= COM_getPermSQL('AND') . COM_getTopicSQL('AND', 0, 'ta') . COM_getLangSQL('sp_id', 'AND', 'sp') . ' ';
+    $sql .= COM_getPermSQL('AND') . COM_getLangSQL('sp_id', 'AND', 'sp') . ' ';
 
     if (!empty ($author)) {
         $sql .= "AND (owner_id = '$author') ";
@@ -813,10 +813,10 @@
     if (!empty($topic)) {
         // Retrieve list of inherited topics
         if ($topic == TOPIC_ALL_OPTION) {
-            $sql .= "AND (ta.inherit = 1 OR (ta.inherit = 0 AND ta.tid = '".$topic."')) ";
+            $sql .= "AND ((ta.inherit = 1 " . COM_getTopicSQL('AND', 0, 'ta') . ") OR (ta.inherit = 0 AND ta.tid = '".TOPIC_ALL_OPTION."') OR (ta.inherit = 0 AND ta.tid = '".TOPIC_HOMEONLY_OPTION."')) ";
         } else {
             $tid_list = TOPIC_getChildList($topic);
-            $sql .= "AND (ta.tid IN({$tid_list}) AND (ta.inherit = 1 OR (ta.inherit = 0 AND ta.tid = '".$topic."'))) ";
+            $sql .= "AND (ta.tid IN('".TOPIC_ALL_OPTION."',{$tid_list}) AND (ta.inherit = 1 OR (ta.inherit = 0 AND (ta.tid = '".$topic."' OR ta.tid = '".TOPIC_ALL_OPTION."')))) ";
         }
     }
         
@@ -854,7 +854,7 @@
     $sql .= "LEFT JOIN {$_TABLES['staticpage']} AS s ON ((s.sp_id = c.sid) ";
     $sql .= COM_getPermSQL('AND',0,2,'s') . COM_getLangSQL('sp_id','AND','s') . ") ";
     $sql .= "WHERE (u.uid = c.uid) AND (s.draft_flag = 0) AND (s.template_flag = 0) AND (s.commentcode >= 0) AND (s.created <= NOW()) ";
-    $sql .= "AND ta.type = 'staticpages' AND ta.id = s.sp_id " . COM_getTopicSQL('AND',0,'ta');;
+    $sql .= "AND ta.type = 'staticpages' AND ta.id = s.sp_id ";
 
     if (!empty($author)) {
         $sql .= "AND (c.uid = '$author') ";
@@ -862,9 +862,9 @@
 
     if (!empty($topic)) {
         if ($topic == TOPIC_ALL_OPTION) {
-            $sql .= "AND (ta.inherit = 1 OR (ta.inherit = 0 AND ta.tid = '".$topic."')) ";
+            $sql .= "AND ((ta.inherit = 1 " . COM_getTopicSQL('AND', 0, 'ta') . ") OR (ta.inherit = 0 AND ta.tid = '".TOPIC_ALL_OPTION."') OR (ta.inherit = 0 AND ta.tid = '".TOPIC_HOMEONLY_OPTION."')) ";
         } else {
-            $sql .= "AND (ta.tid IN({$tid_list}) AND (ta.inherit = 1 OR (ta.inherit = 0 AND ta.tid = '".$topic."'))) ";
+            $sql .= "AND (ta.tid IN('".TOPIC_ALL_OPTION."',{$tid_list}) AND (ta.inherit = 1 OR (ta.inherit = 0 AND (ta.tid = '".$topic."' OR ta.tid = '".TOPIC_ALL_OPTION."')))) ";
         }
     }    
     
@@ -881,7 +881,6 @@
     return array($search_p, $search_c);
 }
 
-
 /**
 * This will put an option for static pages in the command and control block on
 * moderation.php
diff -r 755c386a9969 -r 0ca924e03ea3 plugins/staticpages/services.inc.php
--- a/plugins/staticpages/services.inc.php	Tue Apr 02 20:29:04 2013 -0400
+++ b/plugins/staticpages/services.inc.php	Tue Apr 02 20:31:06 2013 -0400
@@ -595,7 +595,7 @@
  */
 function service_get_staticpages($args, &$output, &$svc_msg)
 {
-    global $_CONF, $_TABLES, $LANG_ACCESS, $LANG12, $LANG_STATIC, $_SP_CONF;
+    global $_CONF, $_TABLES, $LANG_ACCESS, $LANG12, $LANG_STATIC, $_SP_CONF, $topic;
 
     $output = '';
 
@@ -670,7 +670,8 @@
             if (COM_onFrontpage()) {
                 $topic_perms .= " OR (ta.tid = '" . TOPIC_HOMEONLY_OPTION . "' OR ta.tid = '" . TOPIC_ALL_OPTION . "'))";
             } else {
-                $topic_perms .= " OR ta.tid = '" . TOPIC_ALL_OPTION . "')";
+                // $topic_perms .= " OR ta.tid = '" . TOPIC_ALL_OPTION . "')";
+                $topic_perms .= " OR (ta.tid = '" . TOPIC_HOMEONLY_OPTION . "' OR ta.tid = '" . TOPIC_ALL_OPTION . "'))";
             }
         }
         $topic_perms .= " GROUP BY sp_id";        



More information about the geeklog-cvs mailing list