OSDN Git Service

Small bug fixes and added some comments.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Tue, 10 Jul 2007 12:32:47 +0000 (12:32 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Tue, 10 Jul 2007 12:32:47 +0000 (12:32 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@39 2b68903e-0b30-0410-9a39-a2e4f3c5be39

inc/categories.php
inc/filename.php
inc/forums.php
inc/function.php
inc/misc/compression.php
inc/misc/functions.php
inc/xhtml10.php
inc/xhtml11.php
mysql.php
rss.php

index 86e96fc..d50fd93 100644 (file)
@@ -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: categories.php - Last Update: 06/18/2007 SVN 26 - Author: cooldude2k $
+    $FileInfo: categories.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="categories.php"||$File3Name=="/categories.php") {
@@ -89,14 +89,10 @@ if($UsersID=="-1") {
 $LastTopic = "User: <span title=\"".$oldusername."\">".$UsersName."</span><br />\nTopic: <a href=\"".url_maker($exfile['topic'],$Settings['file_ext'],"act=view&id=".$TopicID,$Settings['qstr'],$Settings['qsep'],$prexqstr['topic'],$exqstr['topic'])."#post".$ShowReply."\" title=\"".$oldtopicname."\">".$TopicName."</a>"; } }
 @mysql_free_result($gltresult);
 $ForumType = strtolower($ForumType);
-if ($ForumType=="forum") {
-       $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") {
-       $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="subforum") {
-       $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") {
-       $PreForum=$ThemeSet['RedirectIcon']; }
+if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
+if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
+if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
+if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
 ?>
 <tr class="TableRow3" id="Forum<?php echo $ForumID; ?>">
 <td class="TableRow3"><div class="forumicon">
index f0c1d48..03c458e 100644 (file)
@@ -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: 07/07/2007 SVN 38 - Author: cooldude2k $
+    $FileInfo: filename.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="filename.php"||$File3Name=="/filename.php") {
@@ -40,16 +40,17 @@ if($Settings['rssurl']!=null&&$Settings['rssurl']!="") {
    here we make a fake version that always sends false out. :P */
 if(!function_exists('get_magic_quotes_gpc')) {
 function get_magic_quotes_gpc() { return false; } }
-//Version info stuff. :P 
+// Version info stuff. :P 
 function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        $return_var = $proname." ".$reltype." ".$subver.".".$ver.".".$supver;
        if($showsvn==false) { $showsvn = null; }
        if($showsvn==true) { $return_var .= " SVN ".$svnver; }
        if($showsvn!=true&&$showsvn!=null) { $return_var .= " ".$showsvn." ".$svnver; }
        return $return_var; }
+// Version number and date stuff. :P
 $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 = 38; $RName = "iDB"; $SFName = "IntDB";
-$SVNDay[0] = 07; $SVNDay[1] = 07; $SVNDay[2] = 2007; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
+$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 39; $RName = "iDB"; $SFName = "IntDB";
+$SVNDay[0] = 07; $SVNDay[1] = 10; $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);
@@ -57,15 +58,17 @@ $VerInfo['iDB_Full_Ver_SVN'] = version_info($RName,$VER1[0],$VER1[1],$VER1[2],$V
 $VerInfo['iDB_Ver_Show'] = $VerInfo['iDB_Ver_SVN']; $VerInfo['iDB_Full_Ver_Show'] = $VerInfo['iDB_Full_Ver_SVN'];
 if(isset($Settings['showverinfo'])) { $idbmisc['showverinfo'] = $Settings['showverinfo']; }
 if(!isset($Settings['showverinfo'])) { $idbmisc['showverinfo'] = false; }
+// URLs and names and stuff. :P
 $CD2k = "Cool Dude 2k"; $GM2k = "Game Maker 2k";
 $iDB = "Internet Discussion Boards"; $iTB = "Internet Tag Boards"; $DF2k = "Discussion Forums 2k"; $TB2k = "Tag Boards 2k";
 $iDBURL1 = "<a href=\"http://intdb.sourceforge.net/\" onclick=\"window.open(this.href);return false;\">"; $iDBURL2 = $iDBURL1.$iDB."</a>";
 $DF2kURL1 = "<a href=\"http://df2k.berlios.de/\" onclick=\"window.open(this.href);return false;\">"; $DF2kURL2 = $DF2kURL1.$DF2k."</a>";
 $GM2kURL = "<a href=\"http://upload.idb.s1.jcink.com/\" title=\"".$GM2k."\" onclick=\"window.open(this.href);return false;\">".$GM2k."</a>";
 $iDBURL3 = "<a href=\"http://idb.berlios.de/\" title=\"".$iDB."\" onclick=\"window.open(this.href);return false;\">".$iDB."</a>";
-$PHPQA = "PHP-Quick-Arcade"; $PHPV1 = @phpversion(); $PHPV2 = "PHP ".$PHPV1; $OSType = PHP_OS;
+$PHPQA = "PHP-Quick-Arcade"; $PHPV1 = @phpversion(); $PHPV2 = "PHP ".$PHPV1; $OSType = PHP_OS; // Check OS Name
 if($OSType=="WINNT") { $OSType="Windows NT"; } if($OSType=="WIN32") { $OSType="Windows 9x"; }
 $OSType2 = $PHPV2." / ".$OSType; $ZENDV1 = @zend_version(); $ZENDV2 = "Zend engine ".$ZENDV1;
+// Show or hide the version number
 if($idbmisc['showverinfo']==true) {
 @header("X-iDB-Powered-By: ".$VerInfo['iDB_Ver_Show']);
 @header("Generator: ".$VerInfo['iDB_Ver_Show']); }
index 2e1f249..cec4f2a 100644 (file)
@@ -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: forums.php - Last Update: 06/18/2007 SVN 26 - Author: cooldude2k $
+    $FileInfo: forums.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="forums.php"||$File3Name=="/forums.php") {
@@ -87,12 +87,9 @@ $LastTopic = "User: <span title=\"".$oldusername."\">".$UsersName."</span><br />
 if($LastTopic==null) { $LastTopic="&nbsp;<br />&nbsp;"; }
 $ForumType = strtolower($ForumType);
 $PreForum = $ThemeSet['ForumIcon'];
-if ($ForumType=="forum") {
-       $PreForum=$ThemeSet['ForumIcon']; }
-if ($ForumType=="subforum") {
-       $PreForum=$ThemeSet['SubForumIcon']; }
-if ($ForumType=="redirect") {
-       $PreForum=$ThemeSet['RedirectIcon']; }
+if ($ForumType=="forum") { $PreForum=$ThemeSet['ForumIcon']; }
+if ($ForumType=="subforum") { $PreForum=$ThemeSet['SubForumIcon']; }
+if ($ForumType=="redirect") { $PreForum=$ThemeSet['RedirectIcon']; }
 ?>
 <tr class="TableRow3" id="Forum<?php echo $ForumID; ?>">
 <td class="TableRow3"><div class="forumicon">
index c889d41..f207138 100644 (file)
@@ -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: function.php - Last Update: 06/15/2007 SVN 24 - Author: cooldude2k $
+    $FileInfo: function.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="function.php"||$File3Name=="/function.php") {
@@ -27,6 +27,7 @@ if($Settings['use_iniset']==true&&$Settings['qstr']!="/") {
 if(dirname($_SERVER['REQUEST_URI'])!="."||
        dirname($_SERVER['REQUEST_URI'])!=null) {
 $basedir = dirname($_SERVER['REQUEST_URI'])."/"; }*/
+// Get the base dir name
 if(dirname($_SERVER['SCRIPT_NAME'])!="."||
        dirname($_SERVER['SCRIPT_NAME'])!=null) {
 $basedir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
@@ -46,6 +47,7 @@ if(!isset($REFERERurl['host'])) { $REFERERurl['host'] = null; }
 $URL['REFERER'] = $REFERERurl['host'];
 $URL['HOST'] = $_SERVER["SERVER_NAME"];
 $REFERERurl = null; unset($REFERERurl);
+// Make the Query String if we are not useing &=
 function qstring($qstr=";",$qsep="=")
 { $_GET = null; $_GET = array();
 if (!isset($_SERVER['QUERY_STRING'])) {
@@ -70,6 +72,7 @@ $myscript = $_SERVER["SCRIPT_NAME"];
 $myphpath = $_SERVER["PHP_SELF"];
 $mypathinfo = str_replace($myscript, "", $myphpath);
 @putenv("PATH_INFO=".$mypathinfo); } }
+// Change Path info to Get Vars :
 function mrstring() {
 $urlvar = explode('/',$_SERVER['PATH_INFO']);
 $num=count($urlvar); $i=1;
@@ -83,8 +86,8 @@ $urlvar[$i] = str_replace($fix1, $fix2, $urlvar[$i]);
 $urlvar[$i] = killbadvars($urlvar[$i]);
        $_GET[$urlvar[$i]] = $urlvar[$i+1]; }
 ++$i; ++$i; } return true; }
-function redirect($type,$file,$time=0,$url=null,$dbsr=true)
-{
+// Redirect to another file with ether timed or nontimed redirect
+function redirect($type,$file,$time=0,$url=null,$dbsr=true) {
 if($type!="location"&&
        $type!="refresh") {
        $type=="location"; }
@@ -98,6 +101,7 @@ if($type=="location") {
 @session_write_close();
 header("Location: ".$file); }
 return true; }
+// Make a url
 function url_maker($file="index",$ext=".php",$qvarstr=null,$qstr=";",$qsep="=",$prexqstr=null,$exqstr=null,$fixhtml=true) {
 $fileurl = null; if(!isset($ext)) { $ext = null; }
 if($ext==null) { $ext = ".php"; } 
@@ -170,6 +174,7 @@ while ($sandi < $sanum) {
        ++$sandi; } }
 return $fileurl; }
 $thisdir = dirname(realpath("Preindex.php"))."/";
+// Get the Query String
 function GetQueryStr($qstr=";",$qsep="=",$fixhtml=true)
 { $pregqstr = preg_quote($qstr,"/");
 $pregqsep = preg_quote($qsep,"/");
index 5e67fcd..1584acc 100644 (file)
     GZip and Zlib by Jean-loup Gailly (compression) and Mark Adler (decompression) http://www.zlib.net/
        BZip2 and libbzip2 by Julian Seward http://www.bzip.org/
 
-    $FileInfo: compression.php - Last Update: 06/04/2007 SVN 18 - Author: cooldude2k $
+    $FileInfo: compression.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="compression.php"||$File3Name=="/compression.php") {
        require('index.php');
        exit(); }
-
+//Check if zlib is loaded
 if(@extension_loaded("zlib")) {
 function gunzip($infile, $outfile) {
+  $string = null;
   $zp = gzopen($infile, "r");
   while(!gzeof($zp))
        $string .= gzread($zp, 4096);
@@ -37,8 +38,7 @@ function gunzip2($infile, $outfile) {
  fwrite($fp, $string, strlen($string));
  fclose($fp);
 }
-function gzip($infile, $outfile, $param = 5)
-{
+function gzip($infile, $outfile, $param = 5) {
  $fp = fopen($infile, "r");
  $data = fread ($fp, filesize($infile));
  fclose($fp);
@@ -46,10 +46,9 @@ function gzip($infile, $outfile, $param = 5)
  gzwrite($zp, $data);
  gzclose($zp);
 } }
-
+//Check if bz2 is loaded
 if(@extension_loaded("bz2")) {
-function bzip($infile, $outfile)
-{
+function bzip($infile, $outfile) {
  $fp = fopen($infile, "r");
  $data = fread($fp, filesize($infile));
  fclose($fp);
@@ -59,6 +58,7 @@ function bzip($infile, $outfile)
 }
 
 function bunzip($infile, $outfile) {
+  $string = null;
   $zp = bzopen($infile, "r");
   while(!feof($zp))
        $string .= bzread($zp, 4096);
@@ -67,10 +67,10 @@ function bunzip($infile, $outfile) {
   fwrite($fp, $string, strlen($string));
   fclose($fp);
 } }
-
+//Check if zip is loaded
 if(@extension_loaded("zip")) {
 /* Nothing for now... :P */ }
-
+//Check if rar is loaded
 if(@extension_loaded("rar")) {
 /* Nothing for now... :P */ }
 
index 0e5037c..0f76d33 100644 (file)
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: functions.php - Last Update: 07/02/2007 SVN 36 - Author: cooldude2k $
+    $FileInfo: functions.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="functions.php"||$File3Name=="/functions.php") {
        require('index.php');
        exit(); }
+// Check the file names
 function CheckFile($FileName) {
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name==$FileName||$File3Name=="/".$FileName) {
@@ -32,10 +33,12 @@ require($SettDir['misc']."compression.php");
 if ($_GET['act']=="DeleteSession") { @session_destroy(); }
 if ($_GET['act']=="ResetSession") { @session_unset(); }
 if ($_GET['act']=="NewSessionID") { @session_regenerate_id(); }
+/* 
 if ($_GET['act']=="PHPInfo") { @phpinfo(); exit(); }
 if ($_GET['act']=="phpinfo") { @phpinfo(); exit(); }
 if ($_GET['act']=="PHPCredits") { @phpcredits(); exit(); }
-if ($_GET['act']=="phpcredits") { @phpcredits(); exit(); }
+if ($_GET['act']=="phpcredits") { @phpcredits(); exit(); } 
+*/// Connect to mysql database
 function ConnectMysql($sqlhost,$sqluser,$sqlpass,$sqldb) {
 $StatSQL = @mysql_connect($sqlhost,$sqluser,$sqlpass);
 $StatBase = @mysql_select_db($sqldb);
@@ -44,6 +47,7 @@ if (!$StatBase) { return false; }
 return true; }
        $Names['RS'] = "Renee Sabonis";
 define("_renee_", $Names['RS']);
+// Change the title and gzip page
 function change_title($new_title,$use_gzip="off",$gzip_type="gzip") {
 global $Settings;
 if($gzip_type!="gzip") { if($gzip_type!="deflate") { $gzip_type = "gzip"; } }
@@ -62,6 +66,7 @@ if($use_gzip=="on") {
        if($gzip_type=="deflate") {
        $goutput = gzcompress($output); }
        echo $goutput; } }
+// Fix amp => (&) to &amp; and gzip page
 function fix_amp($use_gzip="off",$gzip_type="gzip") {
 global $Settings;
 if($gzip_type!="gzip") { if($gzip_type!="deflate") { $gzip_type = "gzip"; } }
@@ -82,6 +87,7 @@ if($use_gzip=="on") {
 $output = @ob_get_clean();
        $Names['RJ'] = "RenĂ© Johnson";
 define("_rene_", $Names['RJ']);
+// GZip page for faster download
 function gzip_page($use_gzip="off",$gzip_type="gzip") {
 global $Settings;
 if($gzip_type!="gzip") { if($gzip_type!="deflate") { $gzip_type = "gzip"; } }
@@ -95,6 +101,7 @@ if($use_gzip=="on") {
        echo $goutput; } }
 $foo="bar"; $$foo="foo";
 // SafeSQL Lite Source Code by Cool Dude 2k
+// Make SQL Query's safe
 function query($query_string,$query_vars) {
    $query_array = array(array("%i","%I","%F","%S"),array("%d","%d","%f","%s"));
    $query_string = str_replace($query_array[0], $query_array[1], $query_string);
@@ -110,6 +117,7 @@ $query_val[$query_is] = $query_vars[$query_i];
 ++$query_i; }
    $query_val[0] = $query_string;
    return call_user_func_array("sprintf",$query_val); }
+// Kill bad vars for some functions
 function killbadvars($varname) {
 $badphp1 = array('$'); $badphp2 = array(null);
 $varname = str_replace($badphp1, $badphp2, $varname);
@@ -119,6 +127,7 @@ $varname = preg_replace("/(HTTP_SERVER_VARS|HTTP_ENV_VARS)/i", null, $varname);
 $varname = preg_replace("/(HTTP_COOKIE_VARS|HTTP_SESSION_VARS)/i", null, $varname);
 $varname = preg_replace("/(HTTP_GET_VARS|HTTP_POST_VARS|HTTP_POST_FILES)/i", null, $varname);
        return $varname; }
+// Change the text to icons(smileys)
 function text2icons($Text,$sqlt) {
 global $Settings;
 $reneequery="SELECT * FROM ".$sqlt."smileys";
@@ -143,6 +152,7 @@ if($ReplaceType=="yes") {
        $Smile1 = preg_quote($SmileText,"/");
 $Text = preg_replace("/".$Smile1."/i",$Smile2,$Text); }
 ++$renees; } return $Text; }
+// Remove the bad stuff
 function remove_spaces($Text) {
 $Text = preg_replace("/(^\t+|\t+$)/","",$Text);
 $Text = preg_replace("/(^\n+|\n+$)/","",$Text);
@@ -151,6 +161,7 @@ $Text = preg_replace("/(\r|\n|\t)+/"," ",$Text);
 $Text = preg_replace("/\s\s+/"," ",$Text);
 $Text = preg_replace("/(^\s+|\s+$)/","",$Text);
 return $Text; }
+// Fix some chars
 function fixbamps($text) {
 $fixamps1 = array("&amp;copy;","&amp;reg;","&amp;trade;","&amp;quot;","&amp;amp;","&amp;lt;","&amp;gt;","&amp;(a|e|i|o|u|y)acute;","&amp;(a|e|i|o|u)grave;","&amp;(a|e|i|o|u)circ;","&amp;(a|e|i|o|u|y)uml;","&amp;(a|o|n)tilde;","&amp;aring;","&amp;aelig;","&amp;ccedil;","&amp;eth;","&amp;oslash;","&amp;szlig;","&amp;thorn;");
 $fixamps2 = array("&copy;","&reg;","&trade;","&quot;","&amp;","&lt;","&gt;","&\\1acute;","&\\1grave;","&\\1circ;","&\\1uml;","&\\1tilde;","&aring;","&aelig;","&ccedil;","&eth;","&oslash;","&szlig;","&thorn;");
@@ -160,6 +171,7 @@ $text = preg_replace("/".$fixamps1[$ampi]."/i", $fixamps2[$ampi], $text);
 ++$ampi; }
 $text = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $text);
 return $text; }
+// Get next id for stuff
 function getnextid($tablepre,$table) {
    $getnextidq = query("SHOW TABLE STATUS LIKE '".$tablepre.$table."'", array());
    $getnextidr = mysql_query($getnextidq);
@@ -168,6 +180,7 @@ function getnextid($tablepre,$table) {
    @mysql_free_result($getnextidr); }
        $Names['RSA'] = "Rachel Sabonis";
 define("_rachel_", $Names['RSA']);
+// Redirect to another file with ether timed or nontimed redirect
 function redirects($type,$url,$time=0) {
 if($type!="location"&&
        $type!="refresh") {
@@ -177,6 +190,7 @@ header("Refresh: ".$time."; URL=".$url); }
 if($type=="location") {
 header("Location: ".$url); }
 return true; }
+// Start a xml document
 function xml_tag_make($type,$attbs,$retval=false) {
        $renee1 = explode("&",$attbs);
        $reneenum=count($renee1);
@@ -191,11 +205,13 @@ function xml_tag_make($type,$attbs,$retval=false) {
        echo '<?'.$type.$attblist.'?>'."\n"; }
        if($retval==true) {
        return '<?'.$type.$attblist.'?>'."\n"; } }
+// Start a xml document (old version)
 function xml_doc_start($ver,$encode,$retval=false) {
        if($retval==false) {
        echo xml_tag_make('xml','version='.$ver.'&encoding='.$encode,true); }
        if($retval==true) {
        return xml_tag_make('xml','version='.$ver.'&encoding='.$encode,true); } }
+// Change Time Stamp to a readable time
 function GMTimeChange($format,$timestamp,$offset,$minoffset=null,$dst=null) {
 $TCHour = date("H",$timestamp);
 $TCMinute = date("i",$timestamp);
@@ -226,8 +242,10 @@ $TCMinute = $TCMinute + $tsa['minute'];
 return date($format,mktime($TCHour,$TCMinute,$TCSecond,$TCMonth,$TCDay,$TCYear)); }
        $Names['CK'] = "Christine";
 define("_christine_", $Names['CK']);
+// Change Time Stamp to a readable time
 function TimeChange($format,$timestamp,$offset,$minoffset=null,$dst=null) {
 return GMTimeChange($format,$timestamp,$offset,$minoffset,$dst); }
+// Make a GMT Time Stamp
 function GMTimeStamp() {
 $GMTHour = gmdate("H");
 $GMTMinute = gmdate("i");
@@ -260,6 +278,7 @@ if($dst!="on"&&$dst!="off") { $dst = "off"; }
 if($dst=="on") { if($dstake!="done") { 
        $dstake = "done"; $tsa['hour'] = $tsa['hour']+1; } }
 return date($format,mktime(gmdate('h')+$tsa['hour'],gmdate('i')+$tsa['minute'],gmdate('s'),gmdate('n'),gmdate('j'),gmdate('Y'))); }
+// Get Server offset
 function GetSeverZone() {
 $TestHour1 = date("H");
 @putenv("OTZ=".@getenv("TZ"));
@@ -295,6 +314,7 @@ if($gunnum>0){
 $UsersName=mysql_result($gunresult,$gunnum-1,"Name"); }
 @mysql_free_result($gunresult);
 return $UsersName; }
+// hmac hash function
 function hmac($data,$key,$hash='sha1',$blocksize=64) {
   if (strlen($key)>$blocksize) {
   $key=pack('H*',$hash($key)); }
@@ -302,9 +322,11 @@ function hmac($data,$key,$hash='sha1',$blocksize=64) {
   $ipad=str_repeat(chr(0x36),$blocksize);
   $opad=str_repeat(chr(0x5c),$blocksize);
   return $hash(($key^$opad).pack('H*',$hash(($key^$ipad).$data))); }
+// b64hmac hash function
 function b64e_hmac($data,$key,$extdata,$hash='sha1',$blocksize=64) {
        $extdata2 = hexdec($extdata); $key = $key.$extdata2;
   return base64_encode(hmac($data,$key,$hash,$blocksize).$extdata); }
+// salt hmac hash function
 function salt_hmac($size1=4,$size2=6) {
 $hprand = rand(4,6); $i = 0; $hpass = "";
 while ($i < $hprand) {
@@ -317,12 +339,13 @@ if($hspsrand==2) { $hpass .= chr(rand(65,70)); }
 function is_empty($var) {
     if (((is_null($var) || rtrim($var) == "") &&
                $var !== false) || (is_array($var) && empty($var))) {
-        return true; } else {
-        return false; } }
+        return true; } else { return false; } }
+// Hash two times with md5 and sha1
 function PassHash2x($Text) {
 $Text = md5($Text);
 $Text = sha1($Text);
 return $Text; }
+// Hash two times with hmac-md5 and hmac-sha1
 function PassHash2x2($data,$key,$extdata,$blocksize=64) {
 $extdata2 = hexdec($extdata); $key = $key.$extdata2;
 $Text = hmac($data,$key,"md5").$extdata; 
@@ -355,6 +378,7 @@ $search = preg_quote($search, "/");
 $subject = preg_replace("/".$search."/i", $replace, $subject); }
 return $subject; } }
 $foobar="fubar"; $$foobar="foobar";
+// Debug info
 function dump_included_files() {       return var_dump(get_included_files()); }
 function count_included_files() {      return count(get_included_files()); }
 function dump_extensions() {   return var_dump(get_loaded_extensions()); }
index a5002bd..687e565 100644 (file)
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: xhtml10.php - Last Update: 07/07/2007 SVN 38 - Author: cooldude2k $
+    $FileInfo: xhtml10.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="xhtml10.php"||$File3Name=="/xhtml10.php") {
        require('index.php');
        exit(); }
+// Check to see if we serv the file as html or xhtml
+// if we do xhtml we also check to see if user's browser 
+// can dispay if or else fallback to html
 if($Settings['output_type']=="html") {
        $ccstart = "//<!--"; $ccend = "//-->";
 @header("Content-Type: text/html; charset=".$Settings['charset']); }
@@ -54,17 +57,20 @@ $csryear = "2004"; $cryear = date("Y"); if($cryear<=2004) { $cryear = "2005"; }
 $endpagevar = "<div class=\"copyright\">Powered by ".$iDBURL1."iDB</a> &copy; ".$GM2kURL." @ ".$csryear." - ".$cryear." <a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\" title=\"iDB is licensed under the Revised BSD License\">BSDL</a> <br />\n".$ThemeSet['CopyRight'];
 @header("Content-Language: en");
 @header("Vary: Accept");
+// Check if we are on a secure HTTP connection
 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
+// Get the board's url
 if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
        $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$basedir; }
 if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
        $BoardURL = $Settings['idburl']; }
+// Get the html level
 if($Settings['html_level']!="Strict") {
        if($Settings['html_level']!="Transitional") {
                $Settings['html_level'] = "Transitional"; } }
-?>
-<?php if($Settings['html_level']=="Strict") { ?>
+// HTML Document Starts
+if($Settings['html_level']=="Strict") { ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <?php } if($Settings['html_level']=="Transitional") { ?>
@@ -73,7 +79,7 @@ if($Settings['html_level']!="Strict") {
 <?php } if($Settings['html_level']=="Frameset") { ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" 
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<?php } ?>
+<?php } // HTML meta tags and other html, head tags ?>
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
 <meta http-equiv="Content-Language" content="en" />
index 06da292..c27e001 100644 (file)
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: xhtml11.php - Last Update: 07/07/2007 SVN 38 - Author: cooldude2k $
+    $FileInfo: xhtml11.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="xhtml11.php"||$File3Name=="/xhtml11.php") {
        require('index.php');
        exit(); }
+// Check to see if we serv the file as html or xhtml
+// if we do xhtml we also check to see if user's browser 
+// can dispay if or else fallback to html
 if($Settings['output_type']!="xhtml") {
        $Settings['output_type'] = "xhtml"; }
 if($Settings['output_type']=="html") {
@@ -56,13 +59,15 @@ $csryear = "2004"; $cryear = date("Y"); if($cryear<=2004) { $cryear = "2005"; }
 $endpagevar = "<div class=\"copyright\">Powered by ".$iDBURL1."iDB</a> &copy; ".$GM2kURL." @ ".$csryear." - ".$cryear." <a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\" title=\"iDB is licensed under the Revised BSD License\">BSDL</a> <br />\n".$ThemeSet['CopyRight'];
 @header("Content-Language: en");
 @header("Vary: Accept");
+// Check if we are on a secure HTTP connection
 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
+// Get the board's url
 if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
        $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$basedir; }
 if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
        $BoardURL = $Settings['idburl']; }
-?>
+ // HTML Document Starts, HTML meta tags and other html, head tags ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
index 9652af5..a1a0acc 100644 (file)
--- 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: 06/27/2007 SVN 29 - Author: cooldude2k $
+    $FileInfo: mysql.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 @error_reporting(E_ALL ^ E_NOTICE);
 @ini_set('session.use_trans_sid', false);
@@ -27,6 +27,7 @@ require_once('settings.php');
 if($Settings['fixpathinfo']==true) {
        $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
        @putenv("PATH_INFO=".$_SERVER['ORIG_PATH_INFO']); }
+// Check to see if varubles are set
 if(!isset($SettDir['inc'])) { $SettDir['inc'] = "inc/"; }
 if(!isset($SettDir['misc'])) { $SettDir['misc'] = "inc/misc/"; }
 if(!isset($SettDir['admin'])) { $SettDir['admin'] = "inc/admin/"; }
@@ -38,16 +39,11 @@ 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; }
-$_TEG = array(null);
-$_TEG['part'] = preg_replace("/Part(1|2|3|4)/","\\1",$_GET['act']);
-$_GET['act'] = strtolower($_GET['act']);
-if(isset($_TEG['part'])) {
-if($_TEG['part']<=4&&$_TEG['part']>=1) {
-$_GET['act'] = "Part".$_TEG['part']; } }
 require_once($SettDir['inc'].'filename.php');
 require_once($SettDir['inc'].'function.php');
 if($Settings['enable_pathinfo']==true) { 
        mrstring(); /* Change Path info to Get Vars :P */ }
+// Check to see if varubles are set
 require_once($SettDir['misc'].'setcheck.php');
 @ini_set("default_charset",$Settings['charset']);
 $File1Name = dirname($_SERVER['SCRIPT_NAME'])."/";
@@ -57,6 +53,7 @@ if ($File3Name=="mysql.php"||$File3Name=="/mysql.php") {
        require($SettDir['inc'].'forbidden.php');
        exit(); }
 //error_reporting(E_ERROR);
+// Check if gzip is on and if user's browser can accept gzip pages
 if($Settings['use_gzip']=="on") {
 if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'], "gzip")) { 
        $GZipEncode['Type'] = "gzip"; } else { 
@@ -78,6 +75,7 @@ if($GZipEncode['Type']!="gzip") { if($GZipEncode['Type']!="deflate") { $GZipEnco
        @header("Content-Encoding: deflate"); } }
 /* if(eregi("msie",$browser) && !eregi("opera",$browser)){
 @header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"'); } */
+// Some http stuff
 @session_set_cookie_params(0, $basedir);
 @session_cache_limiter("private, must-revalidate");
 @header("Cache-Control: private, must-revalidate"); // IE 6 Fix
@@ -89,9 +87,6 @@ if(CheckFiles("install.php")!=true) {
 @session_name($Settings['sqltable']."sess");
 @session_start(); }
 @output_reset_rewrite_vars();
-if($Settings['hash_type']!="hmac-md5") {
-if($Settings['hash_type']!="hmac-sha1") {
-$Settings['hash_type']="hmac-sha1"; } }
 if($_GET['act']=="bsdl"||$_GET['act']=="BSDL") { $_GET['act']="bsd"; }
 if($_GET['act']=="bsd"||$_GET['act']=="bsd") {
 @header("Content-Type: text/plain; charset=".$Settings['charset']);
diff --git a/rss.php b/rss.php
index fd177b7..d9a8b5f 100644 (file)
--- a/rss.php
+++ b/rss.php
     Copyright 2004-2007 Cool Dude 2k - http://intdb.sourceforge.net/
     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
 
-    $FileInfo: rss.php - Last Update: 06/07/2007 SVN 20 - Author: cooldude2k $
+    $FileInfo: rss.php - Last Update: 07/10/2007 SVN 39 - Author: cooldude2k $
 */
 @error_reporting(E_ALL ^ E_NOTICE);
 if(@ini_get("register_globals")) {
        require_once('inc/misc/killglobals.php'); }
 require_once('mysql.php');
-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/"; }
+// Check to see if varubles are set
+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($Settings['enable_rss']==false) {
 redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
 if($_GET['act']==null) { $_GET['act'] = "rss"; }