OSDN Git Service

Small bug fixes.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sun, 15 Nov 2009 20:33:35 +0000 (20:33 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sun, 15 Nov 2009 20:33:35 +0000 (20:33 +0000)
updated iDB to (iDB Alpha 0.3.2).

git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@350 2b68903e-0b30-0410-9a39-a2e4f3c5be39

admin.php
inc/admin/main.php
inc/admin/table.php
inc/function.php
inc/misc/functions.php
inc/versioninfo.php

index 8c517d7..35bc87f 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -11,7 +11,7 @@
     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: admin.php - Last Update: 11/14/2009 SVN 346 - Author: cooldude2k $
+    $FileInfo: admin.php - Last Update: 11/15/2009 SVN 350 - Author: cooldude2k $
 */
 if(@ini_get("register_globals")) {
 require_once('inc/misc/killglobals.php'); }
@@ -55,6 +55,7 @@ require($SettDir['admin'].'main.php'); }
 if($_GET['act']=="settings"||
        $_GET['act']=="mysql"||
        $_GET['act']=="info"||
+       $_GET['act']=="optimize"||
        $_GET['act']=="delsessions")
 { $AdminMenu = "main";
 require($SettDir['admin'].'main.php'); }
index a29c6b1..ee2d8d1 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: main.php - Last Update: 11/14/2009 SVN 347 - Author: cooldude2k $
+    $FileInfo: main.php - Last Update: 11/15/2009 SVN 350 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="main.php"||$File3Name=="/main.php") {
@@ -31,6 +31,7 @@ gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @session_write_close(); di
 if(!isset($_POST['update'])) { $_POST['update'] = null; }
 $iDBRDate = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
 $iDBRSVN = $VER2[2]." ".$SubVerN;
+$OutPutLog = null;
 $LastUpdateS = "Last Update: ".$iDBRDate." ".$iDBRSVN;
 $pretext = "<?php\n/*\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    Revised BSD License for more details.\n\n    Copyright 2004-".$SVNDay[2]." iDB Support - http://idb.berlios.de/\n    Copyright 2004-".$SVNDay[2]." Game Maker 2k - http://gamemaker2k.org/\n    iDB Installer made by Game Maker 2k - http://idb.berlios.net/\n\n    \$FileInfo: settings.php & settingsbak.php - ".$LastUpdateS." - Author: cooldude2k \$\n*/\n";
 $pretext2 = array("/*   Board Setting Section Begins   */\n\$Settings = array();","/*   Board Setting Section Ends  \n     Board Info Section Begins   */\n\$SettInfo = array();","/*   Board Setting Section Ends   \n     Board Dir Section Begins   */\n\$SettDir = array();","/*   Board Dir Section Ends   */");
@@ -77,6 +78,26 @@ $time = GMTimeStamp() - ini_get("session.gc_maxlifetime");
 $sqlgc = query('DELETE FROM `'.$Settings['sqltable'].'sessions` WHERE `expires` < %i', array($time));
 exec_query($sqlgc);
 $_POST['update'] = "now"; $_GET['act'] = "view"; }
+if($_GET['act']=="optimize"&&$GroupInfo['ViewDBInfo']=="yes") {
+$TablePreFix = $Settings['sqltable'];
+function add_prefix($tarray) {
+global $TablePreFix;
+return $TablePreFix.$tarray; }
+$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "members", "messenger", "permissions", "posts", "restrictedwords", "sessions", "smileys", "topics", "wordfilter");
+$TableChCk = array_map("add_prefix",$TableChCk);
+$tcount = count($TableChCk); $ti = 0;
+$TblOptimized = 0;
+while ($ti < $tcount) {
+if(isset($OptimizeAr["Msg_text"])) { unset($OptimizeAr["Msg_text"]); }
+if(isset($OptimizeAr[3])) { unset($OptimizeAr[3]); }
+$OptimizeTea = exec_query(query("OPTIMIZE TABLE `".$TableChCk[$ti]."`", array(null))); 
+$OptimizeAr = mysql_fetch_array($OptimizeTea);
+if(!isset($OptimizeAr["Msg_text"])&&
+       isset($OptimizeAr[3])) { $OptimizeAr["Msg_text"] = $OptimizeAr[3]; }
+if($OptimizeAr["Msg_text"]=="OK") { 
+       ++$TblOptimized; } ++$ti; }
+$OutPutLog = "MySQL Output: ".$TblOptimized." Tables optimized.";
+$_POST['update'] = "now"; $_GET['act'] = "view"; }
 ?>
 </td>
        <td style="width: 85%; vertical-align: top;">
@@ -103,6 +124,7 @@ $admincptitle = " ".$ThemeSet['TitleDivider']." Updating Settings";
 <tr class="TableMenuRow3" id="ProfileUpdate">
 <td class="TableMenuColumn3">
 <div style="text-align: center;">
+<?php if(isset($OutPutLog)) { echo "<br />".$OutPutLog; } ?>
 <br />Settings have been updated <a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=".$_GET['act']."&menu=main",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">click here</a> to go back. ^_^<br />&nbsp;</div>
 <?php } if($_GET['act']=="view"&&$_POST['update']!="now") {
 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_SESSION['UserID']));
index 850151b..80805d0 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: table.php - Last Update: 11/14/2009 SVN 346 - Author: cooldude2k $
+    $FileInfo: table.php - Last Update: 11/15/2009 SVN 350 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="table.php"||$File3Name=="/table.php") {
@@ -66,6 +66,8 @@ if ($File3Name=="table.php"||$File3Name=="/table.php") {
 <td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=sqldumper",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">SQL Dumper</a></td>
 </tr><tr class="TableSMenuRow3">
 <td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=delsessions",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Clean Sessions</a></td>
+</tr><tr class="TableSMenuRow3">
+<td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=optimize",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Optimize Tables</a></td>
 <?php } ?>
 </tr><tr class="TableSMenuRow3">
 <td class="TableSMenuColumn3"><a href="<?php echo url_maker($exfile['admin'],$Settings['file_ext'],"act=info",$Settings['qstr'],$Settings['qsep'],$prexqstr['admin'],$exqstr['admin']); ?>">Edit Board Info</a></td>
index 6d83838..a185ef8 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: function.php - Last Update: 10/29/2009 SVN 329 - Author: cooldude2k $
+    $FileInfo: function.php - Last Update: 11/15/2009 SVN 350 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="function.php"||$File3Name=="/function.php") {
@@ -152,7 +152,7 @@ if($type=="location") { header("Location: ".$url); } return true; }
 function html_tag_make($name="br",$emptytag=true,$attbvar=null,$attbval=null,$extratest=null) {
        $var_num = count($attbvar); $value_num = count($attbval);
        if($var_num!=$value_num) { 
-               echo "Erorr Number of Var and Values dont match!";
+               trigger_error("Erorr Number of Var and Values dont match!",E_USER_ERROR);
        return false; } $i = 0;
        while ($i < $var_num) {
        if($i==0) { $mytag = "<".$name." ".$attbvar[$i]."=\"".$attbval[$i]."\""; }
index 8821cdf..02731fa 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: functions.php - Last Update: 11/15/2009 SVN 349 - Author: cooldude2k $
+    $FileInfo: functions.php - Last Update: 11/15/2009 SVN 350 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="functions.php"||$File3Name=="/functions.php") {
@@ -111,7 +111,7 @@ if(isset($link_identifier)) {
 if(!isset($link_identifier)) {
        $result = mysql_query($query); }
 if (!$result) {
-    echo "Invalid query: ".mysql_error(); 
+    trigger_error("Invalid query: ".mysql_error(),E_USER_ERROR);
        return false; }
 if ($result) {
        ++$NumQueries;
@@ -472,8 +472,12 @@ if (!function_exists('mysql_set_charset')) {
 //       by Kazuki Przyborowski - Cool Dude 2k      */
 function http_set_cookie($name,$value=null,$expire=null,$path=null,$domain=null,$secure=false,$httponly=false) {
        $mkcookie = null; $expireGMT = null;
-       if(!isset($name)) { echo "Error: You need to enter a name for cookie."; return false; }
-       if(!isset($expire)) { echo "Error: You need to enter a time for cookie to expire."; return false; }
+       if(!isset($name)) { 
+       trigger_error("Error: You need to enter a name for cookie.",E_USER_ERROR); 
+       return false; }
+       if(!isset($expire)) { 
+       trigger_error("Error: You need to enter a time for cookie to expire.",E_USER_ERROR); 
+       return false; }
        $expireGMT = gmdate("D, d-M-Y H:i:s \G\M\T", $expire);
        if(!isset($value)) { $value = null; }
        if(!isset($httponly)||$httponly==false) {
index 65f38b5..59b5006 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2009 iDB Support - http://idb.berlios.de/
     Copyright 2004-2009 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: versioninfo.php - Last Update: 11/15/2009 SVN 349 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 11/15/2009 SVN 350 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -26,8 +26,8 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        if($showsvn!==true&&$showsvn!=null) { $return_var .= " ".$showsvn." ".$svnver; }
        return $return_var; }
 // Version number and date stuff. :P
-$VER1[0] = 0; $VER1[1] = 3; $VER1[2] = 1; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Pre-Alpha"; $VER2[1] = "PA"; $VER2[2] = "SVN"; $SubVerN = 349; $RName = "iDB"; $SFName = "IntDB";
+$VER1[0] = 0; $VER1[1] = 3; $VER1[2] = 2; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
+$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 350; $RName = "iDB"; $SFName = "IntDB";
 $SVNDay[0] = 11; $SVNDay[1] = 15; $SVNDay[2] = 2009; $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);