[geeklog-hg] geeklog: For multi-language content sites now anything not assig...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Jul 14 09:22:43 EDT 2013


changeset 9195:00c2007d2097
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/00c2007d2097
user: Tom <websitemaster at cogeco.net>
date: Sun Jul 14 09:22:13 2013 -0400
description:
For multi-language content sites now anything not assigned to a language will display for all languages.

diffstat:

 public_html/lib-common.php |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (35 lines):

diff -r ec93e765084c -r 00c2007d2097 public_html/lib-common.php
--- a/public_html/lib-common.php	Sun Jul 14 09:18:50 2013 -0400
+++ b/public_html/lib-common.php	Sun Jul 14 09:22:13 2013 -0400
@@ -7582,24 +7582,23 @@
 * @return   string          SQL expression string (may be empty)
 *
 */
-function COM_getLangSQL( $field, $type = 'WHERE', $table = '' )
+function COM_getLangSQL($field, $type = 'WHERE', $table = '')
 {
     global $_CONF;
 
     $sql = '';
 
-    if( !empty( $_CONF['languages'] ) && !empty( $_CONF['language_files'] ))
-    {
-        if( !empty( $table ))
-        {
+    if (!empty( $_CONF['languages'] ) && !empty( $_CONF['language_files'])) {
+        if (!empty($table)) {
             $table .= '.';
         }
 
         $lang_id = COM_getLanguageId();
 
-        if( !empty( $lang_id ))
-        {
-            $sql = ' ' . $type . " ({$table}$field LIKE '%\\_$lang_id')";
+        if (!empty($lang_id)) {
+            // $sql = ' ' . $type . " ({$table}$field LIKE '%\\_$lang_id')";
+            $length = strlen('_' . $lang_id);
+            $sql = ' ' . $type . " (({$table}$field LIKE '%\\_$lang_id') OR ('_' <> SUBSTRING({$table}$field, -$length, 1)))";
         }
     }
 



More information about the geeklog-cvs mailing list