[geeklog-cvs] Geeklog-1.x/public_html lib-common.php,1.703,1.704

Dirk Haun dhaun at qs1489.pair.com
Fri Jul 4 07:58:55 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html
In directory qs1489.pair.com:/tmp/cvs-serv80573/public_html

Modified Files:
	lib-common.php 
Log Message:
Adopted hack to allow multilingual blocks (bug #0000626)


Index: lib-common.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/lib-common.php,v
retrieving revision 1.703
retrieving revision 1.704
diff -C2 -d -r1.703 -r1.704
*** lib-common.php	26 Jun 2008 21:27:57 -0000	1.703
--- lib-common.php	4 Jul 2008 11:58:50 -0000	1.704
***************
*** 3449,3453 ****
      }
  
!     $commonsql .= ' ORDER BY blockorder,title asc';
  
      $blocksql['mysql'] .= $commonsql;
--- 3449,3453 ----
      }
  
!     $commonsql .= ' ORDER BY blockorder,title ASC';
  
      $blocksql['mysql'] .= $commonsql;
***************
*** 3514,3517 ****
--- 3514,3540 ----
  
      $retval = '';
+ 
+     $lang = COM_getLanguageId();
+     if (!empty($lang)) {
+ 
+         $blocksql['mssql']  = "SELECT bid, is_enabled, name, type, title, tid, blockorder, cast(content as text) as content, ";
+         $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 *,UNIX_TIMESTAMP(rdfupdated) AS date ";
+ 
+         $commonsql = "FROM {$_TABLES['blocks']} WHERE name = '"
+                    . $A['name'] . '_' . $lang . "'";
+ 
+         $blocksql['mysql'] .= $commonsql;
+         $blocksql['mssql'] .= $commonsql;
+         $result = DB_query( $blocksql );
+ 
+         if (DB_numRows($result) == 1) {
+             // overwrite with data for language-specific block
+             $A = DB_fetchArray($result);
+         }
+     }
+ 
      if( $A['type'] == 'portal' )
      {




More information about the geeklog-cvs mailing list