[geeklog-cvs] geeklog: Fixed handling of "entire page" centerblocks in a multi...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon May 11 06:16:59 EDT 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/84cdcac317cf
changeset: 7027:84cdcac317cf
user:      Dirk Haun <dirk at haun-online.de>
date:      Mon May 11 12:16:47 2009 +0200
description:
Fixed handling of "entire page" centerblocks in a multi-language environment

diffstat:

2 files changed, 18 insertions(+), 1 deletion(-)
plugins/staticpages/services.inc.php |   17 ++++++++++++++++-
public_html/docs/history             |    2 ++

diffs (39 lines):

diff -r ba11d6859ebc -r 84cdcac317cf plugins/staticpages/services.inc.php
--- a/plugins/staticpages/services.inc.php	Sun May 10 21:43:03 2009 +0200
+++ b/plugins/staticpages/services.inc.php	Mon May 11 12:16:47 2009 +0200
@@ -369,7 +369,22 @@
 
         // make sure there's only one "entire page" static page per topic
         if (($sp_centerblock == 1) && ($sp_where == 0)) {
-            DB_query ("UPDATE {$_TABLES['staticpage']} SET sp_centerblock = 0 WHERE sp_centerblock = 1 AND sp_where = 0 AND sp_tid = '$sp_tid'" . COM_getLangSQL ('sp_id', 'AND'));
+            $sql = "UPDATE {$_TABLES['staticpage']} SET sp_centerblock = 0 WHERE sp_centerblock = 1 AND sp_where = 0 AND sp_tid = '$sp_tid'";
+
+            // if we're in a multi-language setup, we need to allow one "entire
+            // page" centerblock for 'all' or 'none' per language
+            if ((!empty($_CONF['languages']) &&
+                    !empty($_CONF['language_files'])) &&
+                    (($sp_tid == 'all') || ($sp_tid == 'none'))) {
+                $ids = explode('_', $sp_id);
+                if (count($ids) > 1) {
+                    $lang_id = array_pop($ids);
+
+                    $sql .= " AND sp_id LIKE '%\\_$lang_id'";
+                }
+            }
+
+            DB_query($sql);
         }
 
         $formats = array ('allblocks', 'blankpage', 'leftblocks', 'noblocks');
diff -r ba11d6859ebc -r 84cdcac317cf public_html/docs/history
--- a/public_html/docs/history	Sun May 10 21:43:03 2009 +0200
+++ b/public_html/docs/history	Mon May 11 12:16:47 2009 +0200
@@ -24,6 +24,8 @@
 
 Static Pages plugin
 -------------------
+- Fixed handling of "entire page" centerblocks in a multi-language environment:
+  Need to allow one per language (reported by Norbert Ortmann) [Dirk]
 - Fixed a typo that prevented the [staticpage:] autotag from working [Dirk]
 
 XMLSitemap plugin



More information about the geeklog-cvs mailing list