From: Kazuki Przyborowski Date: Wed, 6 Jun 2007 08:19:35 +0000 (+0000) Subject: Fixed many runtime errors. (PHP Notice errors) X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d2b155c3d4fc9ba58814ee394d0aca3bee51a7ad;p=idb%2FiDB.git.git Fixed many runtime errors. (PHP Notice errors) git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@19 2b68903e-0b30-0410-9a39-a2e4f3c5be39 --- diff --git a/inc/calendars.php b/inc/calendars.php index 61c31fb..bd92888 100644 --- a/inc/calendars.php +++ b/inc/calendars.php @@ -11,12 +11,13 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: calendars.php - Last Update: 05/26/2007 SVN 15 - Author: cooldude2k $ + $FileInfo: calendars.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="calendars.php"||$File3Name=="/calendars.php") { require('index.php'); exit(); } +if(!isset($_GET['HighligtDay'])) { $_GET['HighligtDay'] = null; } // Count the Days in this month $MyTimeStamp = GMTimeStamp(); $CountDays = GMTimeGet("t",$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']); @@ -93,6 +94,7 @@ $Extra = 'CalTableRow1'; } else { $Extra = 'CalTableRow2'; } if ($Day_i != $_GET['HighligtDay']) { +if(!isset($EventsName[$Day_i])) { $EventsName[$Day_i] = null; } if($EventsName[$Day_i]!=null) { $EventsName[$Day_i] = " ( ".$EventsName[$Day_i]." )"; } if ($Day_i != $MyDay) { $WeekDays .= '' . $Day_i . $EventsName[$Day_i] . ''."\r\n"; } } diff --git a/inc/filename.php b/inc/filename.php index 9b3510c..aa3047f 100644 --- a/inc/filename.php +++ b/inc/filename.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: filename.php - Last Update: 06/04/2007 SVN 18 - Author: cooldude2k $ + $FileInfo: filename.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="filename.php"||$File3Name=="/filename.php") { @@ -27,6 +27,7 @@ $basedir = str_replace("//", "/", $basedir); if($Settings['fixbasedir']!=null&&$Settings['fixbasedir']!="") { $basedir = $Settings['fixbasedir']; } $BaseURL = $basedir; +if(!isset($_SERVER['HTTPS'])) { $_SERVER['HTTPS'] = 'off'; } if($_SERVER['HTTPS']=="on") { $prehost = "https://"; } if($_SERVER['HTTPS']!="on") { $prehost = "http://"; } if($Settings['idburl']=="localhost"||$Settings['idburl']==null) { @@ -43,8 +44,8 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) { if($showsvn!=true&&$showsvn!=null) { $return_var .= " ".$showsvn." ".$svnver; } return $return_var; } $VER1[0] = 0; $VER1[1] = 1; $VER1[2] = 5; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2]; -$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 18; $RName = "iDB"; $SFName = "IntDB"; -$SVNDay[0] = 6; $SVNDay[1] = 04; $SVNDay[2] = 2007; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; +$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 19; $RName = "iDB"; $SFName = "IntDB"; +$SVNDay[0] = 6; $SVNDay[1] = 06; $SVNDay[2] = 2007; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2]; $VerInfo['iDB_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,false); $VerInfo['iDB_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[1],$SubVerN,true); $VerInfo['iDB_Full_Ver'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$VER2[0],$SubVerN,false); diff --git a/inc/function.php b/inc/function.php index 7619902..ad2669e 100644 --- a/inc/function.php +++ b/inc/function.php @@ -11,20 +11,20 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: function.php - Last Update: 05/26/2007 SVN 15 - Author: cooldude2k $ + $FileInfo: function.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="function.php"||$File3Name=="/function.php") { require('index.php'); exit(); } require_once($SettDir['misc'].'functions.php'); -/* Change Some PHP Settings Fix the & to & */ +/* Change Some PHP Settings Fix the & to & if($Settings['use_iniset']==true&&$Settings['qstr']!="/") { @ini_set("arg_separator.output",htmlentities($Settings['qstr'], ENT_QUOTES)); @ini_set("arg_separator.input",$Settings['qstr']); @ini_set("arg_separator",htmlentities($Settings['qstr'], ENT_QUOTES)); } //$basepath = pathinfo($_SERVER['REQUEST_URI']); -/*if(dirname($_SERVER['REQUEST_URI'])!="."|| +if(dirname($_SERVER['REQUEST_URI'])!="."|| dirname($_SERVER['REQUEST_URI'])!=null) { $basedir = dirname($_SERVER['REQUEST_URI'])."/"; }*/ if(dirname($_SERVER['SCRIPT_NAME'])!="."|| @@ -40,7 +40,9 @@ if($Settings['fixbasedir']!=null&&$Settings['fixbasedir']!="") { $basedir = $Settings['fixbasedir']; } $BaseURL = $basedir; // Get our Host Name and Referer URL's Host Name +if(!isset($_SERVER['HTTP_REFERER'])) { $_SERVER['HTTP_REFERER'] = null; } $REFERERurl = parse_url($_SERVER['HTTP_REFERER']); +if(!isset($REFERERurl['host'])) { $REFERERurl['host'] = null; } $URL['REFERER'] = $REFERERurl['host']; $URL['HOST'] = $_SERVER["SERVER_NAME"]; $REFERERurl = null; unset($REFERERurl); @@ -95,6 +97,7 @@ if($type=="location") { header("Location: ".$file); } return true; } function url_maker($file,$ext,$qvarstr=null,$qstr=";",$qsep="=",$prexqstr=null,$exqstr=null,$fixhtml=true) { +$fileurl = null; if($ext==null) { $ext = ".php"; } if($ext=="noext"||$ext=="no ext"||$ext=="no+ext") { $ext = null; } $file = $file.$ext; diff --git a/inc/members.php b/inc/members.php index 35bc3b0..d1c223e 100644 --- a/inc/members.php +++ b/inc/members.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: members.php - Last Update: 05/26/2007 SVN 15 - Author: cooldude2k $ + $FileInfo: members.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="members.php"||$File3Name=="/members.php") { @@ -20,6 +20,13 @@ if ($File3Name=="members.php"||$File3Name=="/members.php") { if($_GET['act']=="list") { $orderlist = null; $orderlist = "order by `ID` asc"; +if(!isset($_GET['orderby'])) { $_GET['orderby'] = null; } +if(!isset($_GET['sorttype'])) { $_GET['sorttype'] = null; } +if(!isset($_GET['ordertype'])) { $_GET['ordertype'] = null; } +if(!isset($_GET['orderby'])) { $_GET['orderby'] = null; } +if(!isset($_GET['sortby'])) { $_GET['sortby'] = null; } +if(!isset($_GET['gid'])) { $_GET['gid'] = null; } +if(!isset($_GET['groupid'])) { $_GET['groupid'] = null; } if($_GET['orderby']==null) { if($_GET['sortby']!=null) { $_GET['orderby'] = $_GET['sortby']; } } @@ -514,6 +521,8 @@ $REFERERurl = parse_url($_SERVER['HTTP_REFERER']); $URL['REFERER'] = $REFERERurl['host']; $URL['HOST'] = $_SERVER["SERVER_NAME"]; $REFERERurl = null; unset($REFERERurl); +if(!isset($_POST['username'])) { $_POST['username'] = null; } +if(!isset($_POST['TOS'])) { $_POST['TOS'] = null; } ?>
diff --git a/inc/misc/setcheck.php b/inc/misc/setcheck.php index 6d54866..f97ee4a 100644 --- a/inc/misc/setcheck.php +++ b/inc/misc/setcheck.php @@ -11,13 +11,19 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: setcheck.php - Last Update: 05/26/2007 SVN 15 - Author: cooldude2k $ + $FileInfo: setcheck.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="setcheck.php"||$File3Name=="/setcheck.php") { require('index.php'); exit(); } - +if(!isset($_GET['debug'])) { $_GET['debug'] = false; } +if(!isset($GZipEncode)) { $GZipEncode = 'none'; } +if(!isset($preact)) { $preact = null; } +if(!isset($Settings['hash_type'])) { $Settings['hash_type'] = null; } +if(!isset($Error)) { $Error = null; } +if(!isset($passright)) { $passright = null; } +$oldusername = null; $oldtopicname = null; $ext = null; if($Settings['DefaultTheme']==null) { $Settings['DefaultTheme'] = "iDB"; } if($Settings['DefaultTimeZone']==null) { @@ -90,6 +96,12 @@ if($Settings['html_type']=="html4") { $Settings['html_type'] = "html10"; } /*if($_GET['debug']=="true"||$_GET['debug']=="on") { output_add_rewrite_var("amp;debug",$_GET['debug']); }*/ +if (!isset($_GET['action'])) { $_GET['action'] = null; } +if (!isset($_GET['activity'])) { $_GET['activity'] = null; } +if (!isset($_GET['function'])) { $_GET['function'] = null; } +if (!isset($_GET['mode'])) { $_GET['mode'] = null; } +if (!isset($_GET['show'])) { $_GET['show'] = null; } +if (!isset($_GET['do'])) { $_GET['do'] = null; } if ($_GET['act']==null&&$_GET['action']!=null) { $_GET['act']=$_GET['action']; } if ($_GET['act']==null&&$_GET['activity']!=null) { $_GET['act']=$_GET['activity']; } if ($_GET['act']==null&&$_GET['function']!=null) { $_GET['act']=$_GET['function']; } diff --git a/inc/pm.php b/inc/pm.php index 7d32fca..1b9f8d6 100644 --- a/inc/pm.php +++ b/inc/pm.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: pm.php - Last Update: 05/27/2007 SVN 16 - Author: cooldude2k $ + $FileInfo: pm.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="pm.php"||$File3Name=="/pm.php") { @@ -178,7 +178,7 @@ $MessageName=mysql_result($result,$is,"MessageTitle"); $DateSend=mysql_result($result,$is,"DateSend"); $DateSend=GMTimeChange("F j, Y, g:i a",$DateSend,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']); $MessageText=mysql_result($result,$is,"MessageText"); -$MessageDesc=mysql_result($result,$i,"Description"); +$MessageDesc=mysql_result($result,$is,"Description"); $requery = query("select * from ".$Settings['sqltable']."members where ID=%i", array($SenderID)); $reresult=mysql_query($requery); $renum=mysql_num_rows($reresult); diff --git a/inc/profilemain.php b/inc/profilemain.php index f5f1c11..5a4888f 100644 --- a/inc/profilemain.php +++ b/inc/profilemain.php @@ -11,12 +11,13 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: profilemain.php - Last Update: 05/26/2007 SVN 15 - Author: cooldude2k $ + $FileInfo: profilemain.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="profilemain.php"||$File3Name=="/profilemain.php") { require('index.php'); exit(); } +if(!isset($_POST['update'])) { $_POST['update'] = null; } ?>
@@ -81,7 +82,7 @@ $i=0; $YourID=mysql_result($result,$i,"id"); $Notes=mysql_result($result,$i,"Notes"); $noteact = url_maker($exfile['profile'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['profile'],$exqstr['profile']); -$profiletitle = " ".$ThemeSet['TitleDivider']." NotePad"; +$notepadact = $noteact; $profiletitle = " ".$ThemeSet['TitleDivider']." NotePad"; ?>
@@ -521,13 +522,13 @@ if($OldHashType=="iDBH"&&$UpdateHash!=true) { $YourPassword = b64e_hmac($_POST['OldPass'],$OldJoined,$OldSalt,"sha1"); $NewPassword = b64e_hmac($_POST['Password'],$OldJoined,$NewSalt,"sha1"); } if($YourPassword!=$OldPassword) { $Error="Yes"; ?> -
Your old Password did not match.
 
+
Your old Password did not match.
 
-
Your password is too big.
 
+
Your password is too big.
 
-
Your old password is too big.
 
+
Your old password is too big.
 
-
Your passwords did not match.
 
+
Your passwords did not match.
 
 "; -if($ThemeSet['EnableToggle']==true) { -$toggle = "toggletag('Stats1'),toggletag('Stats2'),toggletag('Stats3');return false;"; -$togglecode = "".$ThemeSet['Toggle']."".$ThemeSet['ToggleExt'].""; } -if($ThemeSet['EnableToggle']==false) { $toggle = null; -$togglecode = " "; } +if($_GET['act']=="view"||$_GET['act']=="stats") { $ntquery = query("select * from ".$Settings['sqltable']."topics", array(null)); $ntresult = mysql_query($ntquery); $numtopics = mysql_num_rows($ntresult); @@ -42,7 +36,7 @@ if($guest_check > 0) { $nummembers = $nummembers - 1; } + "; ?> diff --git a/mysql.php b/mysql.php index 49894f1..5f18c27 100644 --- a/mysql.php +++ b/mysql.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: mysql.php - Last Update: 05/26/2007 SVN 15 - Author: cooldude2k $ + $FileInfo: mysql.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ @error_reporting(E_ALL ^ E_NOTICE); @ini_set('session.use_trans_sid', false); @@ -27,11 +27,17 @@ require_once('settings.php'); if($Settings['fixpathinfo']==true) { $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; @putenv("PATH_INFO=".$_SERVER['ORIG_PATH_INFO']); } -if($SettDir['inc']==null) { $SettDir['inc'] = "inc/"; } -if($SettDir['misc']==null) { $SettDir['misc'] = "inc/misc/"; } -if($SettDir['admin']==null) { $SettDir['admin'] = "inc/admin/"; } -if($SettDir['mod']==null) { $SettDir['mod'] = "inc/mod/"; } -if($SettDir['themes']==null) { $SettDir['themes'] = "themes/"; } +if(!isset($SettDir['inc'])) { $SettDir['inc'] = "inc/"; } +if(!isset($SettDir['misc'])) { $SettDir['misc'] = "inc/misc/"; } +if(!isset($SettDir['admin'])) { $SettDir['admin'] = "inc/admin/"; } +if(!isset($SettDir['mod'])) { $SettDir['mod'] = "inc/mod/"; } +if(!isset($SettDir['themes'])) { $SettDir['themes'] = "themes/"; } +if(!isset($Settings['use_iniset'])) { $Settings['use_iniset'] = null; } +if(!isset($_SERVER['PATH_INFO'])) { $_SERVER['PATH_INFO'] = null; } +if(!isset($_GET['page'])) { $_GET['page'] = null; } +if(!isset($_GET['act'])) { $_GET['act'] = null; } +if(!isset($_POST['act'])) { $_POST['act'] = null; } +if(!isset($_GET['id'])) { $_GET['id'] = null; } require_once($SettDir['inc'].'filename.php'); require_once($SettDir['inc'].'function.php'); @mrstring(); // Change Path info to Get Vars :P @@ -101,13 +107,16 @@ if(CheckFiles("install.php")!=true) { @ConnectMysql($Settings['sqlhost'],$Settings['sqluser'],$Settings['sqlpass'],$Settings['sqldb']); } if(CheckFiles("install.php")==true) { $Settings['board_name'] = "Installing iDB"; } +if(isset($_SESSION['CheckCookie'])) { if($_SESSION['CheckCookie']!="done") { if($_COOKIE['SessPass']!=null&& $_COOKIE['MemberName']!=null) { -require('inc/prelogin.php'); } } +require('inc/prelogin.php'); } } } +if(!isset($_SESSION['UserGroup'])) { $_SESSION['UserGroup'] = null; } if($_SESSION['UserGroup']==null) { $_SESSION['UserGroup']=$Settings['GuestGroup']; } //Time Zone Set +if(!isset($_SESSION['UserTimeZone'])) { $_SESSION['UserTimeZone'] = null; } if($_SESSION['UserTimeZone']==null|| !is_numeric($_SESSION['UserTimeZone'])) { if($Settings['DefaultTimeZone']!=null&& @@ -117,12 +126,22 @@ if($_SESSION['UserTimeZone']==null|| $_SESSION['UserTimeZone'] = SeverOffSet(); } if(!is_numeric($Settings['DefaultTimeZone'])) { $_SESSION['UserTimeZone'] = SeverOffSet(); } } +if(!isset($_SESSION['UserDST'])) { $_SESSION['UserDST'] = null; } if($_SESSION['UserDST']==null) { if($Settings['DefaultDST']=="off") { $_SESSION['UserDST'] = "off"; } if($Settings['DefaultDST']=="on") { $_SESSION['UserDST'] = "on"; } } // Skin Stuff +if(!isset($_SESSION['Theme'])) { $_SESSION['Theme'] = null; } +if(!isset($_GET['theme'])) { $_GET['theme'] = null; } +if(!isset($_POST['theme'])) { $_POST['theme'] = null; } +if(!isset($_GET['skin'])) { $_GET['skin'] = null; } +if(!isset($_POST['skin'])) { $_POST['skin'] = null; } +if(!isset($_GET['style'])) { $_GET['style'] = null; } +if(!isset($_POST['style'])) { $_POST['style'] = null; } +if(!isset($_GET['css'])) { $_GET['css'] = null; } +if(!isset($_POST['css'])) { $_POST['css'] = null; } if($_GET['theme']==null) { if($_POST['theme']!=null) { $_GET['theme'] = $_POST['theme']; } @@ -161,6 +180,7 @@ $_GET['theme']=$Settings['DefaultTheme']; } } $PreSkin['skindir1'] = $_SESSION['Theme']; $PreSkin['skindir2'] = $SettDir['themes'].$_SESSION['Theme']; require($SettDir['themes'].$_GET['theme']."/settings.php"); +if(!isset($_SESSION['DBName'])) { $_SESSION['DBName'] = null; } if($_SESSION['DBName']==null) { $_SESSION['DBName'] = $Settings['sqldb']; } if($_SESSION['DBName']!=null) { diff --git a/preindex.php b/preindex.php index 4456126..16d922c 100644 --- a/preindex.php +++ b/preindex.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: preindex.php - Last Update: 05/26/2007 SVN 15 - Author: cooldude2k $ + $FileInfo: preindex.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ $File3Name = basename($_SERVER['SCRIPT_NAME']); if ($File3Name=="preindex.php"||$File3Name=="/preindex.php") { @@ -19,6 +19,7 @@ if ($File3Name=="preindex.php"||$File3Name=="/preindex.php") { exit(); } require('mysql.php'); if($Settings['enable_rss']==true) { +if(!isset($_GET['feed'])) { $_GET['feed'] = null; } if($_GET['feed']=="rss"||$_GET['act']=="Feed"||$_GET['feed']=="atom") { require($SettDir['inc'].'rssfeed.php'); } } if($Settings['output_type']=="htm") { diff --git a/search.php b/search.php index bab61d1..c343750 100644 --- a/search.php +++ b/search.php @@ -11,7 +11,7 @@ Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/ Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/ - $FileInfo: search.php - Last Update: 05/26/2007 SVN 15 - Author: cooldude2k $ + $FileInfo: search.php - Last Update: 06/06/2007 SVN 19 - Author: cooldude2k $ */ require('preindex.php'); $usefileext = $Settings['file_ext']; @@ -24,12 +24,17 @@ $filewpath = $exfile['search'].$usefileext.$_SERVER['PATH_INFO'];
#bstats">Board Statistics -
Board Stats