Fixed a coupla minor bugs with the template_nodb class wrongly referencing $lang
authorDan
Fri, 18 Jan 2008 22:27:29 -0500
changeset 355 d15e4411ef65
parent 354 979d99a0b00e
child 356 9f8fca26ddb9
Fixed a coupla minor bugs with the template_nodb class wrongly referencing $lang
includes/lang.php
includes/template.php
--- a/includes/lang.php	Fri Jan 18 10:47:24 2008 -0500
+++ b/includes/lang.php	Fri Jan 18 22:27:29 2008 -0500
@@ -546,7 +546,7 @@
       $subs[$key] = strval($value);
       $string = str_replace("%{$key}%", "{$subs[$key]}", $string);
     }
-    return "{$string}*";
+    return $string . '*';
   }
   
 } // class Language
--- a/includes/template.php	Fri Jan 18 10:47:24 2008 -0500
+++ b/includes/template.php	Fri Jan 18 22:27:29 2008 -0500
@@ -1904,7 +1904,7 @@
     $tplvars = $this->extract_vars('elements.tpl');
     $tb = '';
     // Get the "article" button text (depends on namespace)
-    if(defined('IN_ENANO_INSTALL')) $ns = $lang->get('meta_btn_article');
+    if(defined('IN_ENANO_INSTALL') && is_object($lang)) $ns = $lang->get('meta_btn_article');
     else $ns = 'system error page';
     $t = str_replace('{FLAGS}', 'onclick="return false;" title="Hey! A button that doesn\'t do anything. Clever..." accesskey="a"', $tplvars['toolbar_button']);
     $t = str_replace('{HREF}', '#', $t);
@@ -1942,9 +1942,9 @@
     $tpl_strings = Array(
       'PAGE_NAME'=>$this_page,
       'PAGE_URLNAME'=>'Null',
-      'SITE_NAME'=> ( defined('IN_ENANO_INSTALL') ) ? $lang->get('meta_site_name') : 'Critical error',
+      'SITE_NAME'=> ( defined('IN_ENANO_INSTALL') && is_object($lang) ) ? $lang->get('meta_site_name') : 'Critical error',
       'USERNAME'=>'admin',
-      'SITE_DESC'=>( defined('IN_ENANO_INSTALL') ) ? $lang->get('meta_site_desc') : 'This site is experiencing a problem and cannot load.',
+      'SITE_DESC'=>( defined('IN_ENANO_INSTALL') && is_object($lang) ) ? $lang->get('meta_site_desc') : 'This site is experiencing a problem and cannot load.',
       'TOOLBAR'=>$tb,
       'SCRIPTPATH'=>scriptPath,
       'CONTENTPATH'=>contentPath,
@@ -1953,7 +1953,7 @@
       'ADMIN_SID_AMP_HTML'=>'',
       'ADDITIONAL_HEADERS'=>$this->additional_headers,
       'SIDEBAR_EXTRA'=>'',
-      'COPYRIGHT'=>( defined('IN_ENANO_INSTALL') ) ? $lang->get('meta_enano_copyright') : ( defined('ENANO_CONFIG_FETCHED') ? getConfig('copyright_notice') : '' ),
+      'COPYRIGHT'=>( defined('IN_ENANO_INSTALL') && is_object($lang) ) ? $lang->get('meta_enano_copyright') : ( defined('ENANO_CONFIG_FETCHED') ? getConfig('copyright_notice') : '' ),
       'TOOLBAR_EXTRAS'=>'',
       'REQUEST_URI'=>( isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '' ).$_SERVER['REQUEST_URI'],
       'STYLE_LINK'=>$slink,