1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Remove PHP Warnings - various undefined variables and typos

This commit is contained in:
mrpete 2006-12-05 09:15:08 +00:00
parent dd1eebf89c
commit 3e3e0b188a
3 changed files with 30 additions and 23 deletions

View File

@ -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')

View File

@ -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 .= "<a".$linkadd.$screentip.$href.$link_append.$accesskey.">".$tp->toHTML($linkInfo['link_name'],"","emotes_off defs no_hook")."</a>";
// If its not a link, but has a class or screentip do span:
}elseif (!empty($linkadd) || !empty($screentip)){

View File

@ -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{
</td>
<td class='forumheader3' style='vertical-align:top'>";
$itext .= $author ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_4."</b>:</td><td style='vertical-align:top'>".$author."</td></tr>" : "";
$itext = $author ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_4."</b>:</td><td style='vertical-align:top'>".$author."</td></tr>" : "";
$itext .= $website ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_5."</b>:</td><td style='vertical-align:top'>".$website."</td></tr>" : "";
$itext .= $theme['date'] ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_6."</b>:</td><td style='vertical-align:top'>".$theme['date']."</td></tr>" : "";
$itext .= $theme['info'] ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_7."</b>:</td><td style='vertical-align:top'>".$theme['info']."</td></tr>" : "";