From 3e3e0b188ac928448860534d6d505d71283d7f4e Mon Sep 17 00:00:00 2001 From: mrpete Date: Tue, 5 Dec 2006 09:15:08 +0000 Subject: [PATCH] Remove PHP Warnings - various undefined variables and typos --- e107_handlers/shortcode_handler.php | 20 +++++++++++++------- e107_handlers/sitelinks_class.php | 10 +++++----- e107_handlers/theme_handler.php | 23 ++++++++++++----------- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index 38548c8ed..bd94b040d 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $ -| $Revision: 1.2 $ -| $Date: 2006-12-03 07:03:22 $ -| $Author: mcfly_e107 $ +| $Revision: 1.3 $ +| $Date: 2006-12-05 09:15:05 $ +| $Author: mrpete $ +----------------------------------------------------------------------------+ */ @@ -34,7 +34,7 @@ class e_shortcode { { global $pref, $register_sc; - if($pref['shortcode_list'] != '') + if(varset($pref['shortcode_list'],'') != '') { foreach($pref['shortcode_list'] as $path=>$namearray) { @@ -78,7 +78,7 @@ class e_shortcode { function doCode($matches) { - global $pref, $e107cache, $menu_pref, $sc_style, $parm; + global $pref, $e107cache, $menu_pref, $sc_style, $parm, $sql; if(strpos($matches[1], E_NL) !== false) { @@ -96,9 +96,10 @@ class e_shortcode { } $parm = trim($parm); - if (E107_DEBUG_LEVEL) + if (E107_DBG_BBSC) { global $db_debug; + $sql->db_Mark_Time("SC $code"); $db_debug->logCode(2, $code, $parm, ""); } @@ -156,13 +157,16 @@ class e_shortcode { } } } + if (E107_DBG_SC) { + $sql->db_Mark_Time("(SC $code Done)"); + } return $ret; } function parse_scbatch($fname, $type = 'file') { global $e107cache, $eArrayStorage; - $cur_shortcoces = array(); + $cur_shortcodes = array(); if($type == 'file') { $batch_cachefile = "nomd5_".md5($fname); @@ -185,6 +189,7 @@ class e_shortcode { if($sc_batch) { + $cur_sc = ''; foreach($sc_batch as $line) { if (trim($line) == 'SC_END') @@ -198,6 +203,7 @@ class e_shortcode { if (preg_match("#^SC_BEGIN (\w*).*#", $line, $matches)) { $cur_sc = $matches[1]; + $cur_shortcodes[$cur_sc] = varset($cur_shortcodes[$cur_sc],''); } } if($type == 'file') diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 9edbe5818..4f4492a66 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/sitelinks_class.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:33:58 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2006-12-05 09:15:08 $ +| $Author: mrpete $ +---------------------------------------------------------------+ */ @@ -114,7 +114,7 @@ class sitelinks $render_link[$key] = $this->makeLink($link,'', $style, $css_class); - if(!defined("LINKSRENDERONLYMAIN") && $style['linkmainonly']!= TRUE) /* if this is defined in theme.php only main links will be rendered */ + if(!defined("LINKSRENDERONLYMAIN") && !varset($style['linkmainonly'])) /* if this is defined in theme.php only main links will be rendered */ { // if there's a submenu. : @@ -240,7 +240,7 @@ class sitelinks // If its a link.. make a link $_link = ""; $_link .= $accessdigit; - if (!empty($href) && (($style['hilite_nolink'] && $highlighted)!=TRUE)){ + if (!empty($href) && ((varset($style['hilite_nolink']) && $highlighted)!=TRUE)){ $_link .= "".$tp->toHTML($linkInfo['link_name'],"","emotes_off defs no_hook").""; // If its not a link, but has a class or screentip do span: }elseif (!empty($linkadd) || !empty($screentip)){ diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index ccfd7013e..d3347dd33 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -11,9 +11,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $ -| $Revision: 1.1.1.1 $ -| $Date: 2006-12-02 04:33:58 $ -| $Author: mcfly_e107 $ +| $Revision: 1.2 $ +| $Date: 2006-12-05 09:15:08 $ +| $Author: mrpete $ +----------------------------------------------------------------------------+ */ @@ -97,6 +97,7 @@ class themeHandler{ fclose($fp); $nonadmin = preg_match('/\* Non-Admin(.*?)\*\//', $cssContents) ? true : false; preg_match('/\* info:(.*?)\*\//', $cssContents, $match); + $match[1]=varset($match[1],''); $themeArray[$file]['css'][] = array("name" => $file2, "info" => $match[1], "nonadmin" => $nonadmin); if($STYLESHEET) { @@ -113,19 +114,19 @@ class themeHandler{ $themeContents = fread ($fp, filesize(e_THEME.$file."/theme.php")); fclose($fp); preg_match('/themename(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray[$file]['name'] = $match[3]; + $themeArray[$file]['name'] = varset($match[3],''); preg_match('/themeversion(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray[$file]['version'] = $match[3]; + $themeArray[$file]['version'] = varset($match[3],''); preg_match('/themeauthor(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray[$file]['author'] = $match[3]; + $themeArray[$file]['author'] = varset($match[3],''); preg_match('/themeemail(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray[$file]['email'] = $match[3]; + $themeArray[$file]['email'] = varset($match[3],''); preg_match('/themewebsite(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray[$file]['website'] = $match[3]; + $themeArray[$file]['website'] = varset($match[3],''); preg_match('/themedate(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray[$file]['date'] = $match[3]; + $themeArray[$file]['date'] = varset($match[3],''); preg_match('/themeinfo(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray[$file]['info'] = $match[3]; + $themeArray[$file]['info'] = varset($match[3],''); preg_match('/xhtmlcompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); $xhtml = strtolower($match[2]); @@ -306,7 +307,7 @@ class themeHandler{ "; - $itext .= $author ? "".TPVLAN_4.":".$author."" : ""; + $itext = $author ? "".TPVLAN_4.":".$author."" : ""; $itext .= $website ? "".TPVLAN_5.":".$website."" : ""; $itext .= $theme['date'] ? "".TPVLAN_6.":".$theme['date']."" : ""; $itext .= $theme['info'] ? "".TPVLAN_7.":".$theme['info']."" : "";