OSDN Git Service

Small change to iDB version checker.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Thu, 21 Jan 2010 01:53:44 +0000 (01:53 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Thu, 21 Jan 2010 01:53:44 +0000 (01:53 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@442 2b68903e-0b30-0410-9a39-a2e4f3c5be39

inc/versioninfo.php
sql.php

index f585eb7..4ada126 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2010 iDB Support - http://idb.berlios.de/
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: versioninfo.php - Last Update: 01/19/2010 SVN 441 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 01/20/2010 SVN 442 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -27,8 +27,8 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        return $return_var; }
 // Version number and date stuff. :P
 $VER1[0] = 0; $VER1[1] = 3; $VER1[2] = 6; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 441; $RName = "iDB"; $SFName = "IntDB";
-$SVNDay[0] = 01; $SVNDay[1] = 19; $SVNDay[2] = 2010; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
+$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 442; $RName = "iDB"; $SFName = "IntDB";
+$SVNDay[0] = 01; $SVNDay[1] = 20; $SVNDay[2] = 2010; $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/sql.php b/sql.php
index 9a33df5..69d16dc 100644 (file)
--- a/sql.php
+++ b/sql.php
@@ -11,7 +11,7 @@
     Copyright 2004-2010 iDB Support - http://idb.berlios.de/
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: sql.php - Last Update: 01/01/2010 SVN 438 - Author: cooldude2k $
+    $FileInfo: sql.php - Last Update: 01/20/2010 SVN 442 - Author: cooldude2k $
 */
 /* Some ini setting changes uncomment if you need them. 
    Display PHP Errors */
@@ -111,26 +111,6 @@ if(!isset($_POST['License'])) { $_POST['License'] = null; }
 if(!isset($_SERVER['HTTPS'])) { $_SERVER['HTTPS'] = "off"; }
 require_once($SettDir['misc'].'utf8.php');
 require_once($SettDir['inc'].'filename.php');
-$iDBVerName = "iDB|".$VER2[1]."|".$VER1[0].".".$VER1[1].".".$VER1[2]."|".$VER2[2]."|".$SubVerN;
-/* 
-This way checks iDB version by sending the iDBVerName to the iDB Version Checker.
-$Settings['vercheck'] = 1; 
-This way checks iDB version by sending the board url to the iDB Version Checker.
-$Settings['vercheck'] = 2;
-*/
-if(!isset($Settings['vercheck'])) { 
-       $Settings['vercheck'] = 2; }
-if($Settings['vercheck']!=1&&
-       $Settings['vercheck']!=2) {
-       $Settings['vercheck'] = 2; }
-if($Settings['vercheck']===2) {
-if($_GET['act']=="versioninfo") { header("Content-Type: text/plain; charset=UTF-8"); ?>
-<charset><?php echo $Settings['charset']; ?></charset> 
-<title><?php echo $Settings['board_name']; ?></title> 
-<?php echo "<name>".$iDBVerName."</name>"; die(); } }
-if($Settings['vercheck']===1) {
-if($_GET['act']=="versioninfo") { header("Content-Type: text/plain; charset=UTF-8");
-header("Location: ".$VerCheckURL."&name=".urlencode($iDBVerName)); die(); } }
 if(!isset($Settings['use_hashtype'])) {
        $Settings['use_hashtype'] = "sha256"; }
 if(!function_exists('hash')||!function_exists('hash_algos')) {
@@ -152,6 +132,69 @@ if($Settings['use_hashtype']!="md2"&&
 // Check to see if variables are set
 require_once($SettDir['misc'].'setcheck.php');
 require_once($SettDir['inc'].'function.php');
+$iDBVerName = "iDB|".$VER2[1]."|".$VER1[0].".".$VER1[1].".".$VER1[2]."|".$VER2[2]."|".$SubVerN;
+/* 
+This way checks iDB version by sending the iDBVerName to the iDB Version Checker.
+$Settings['vercheck'] = 1; 
+This way checks iDB version by sending the board url to the iDB Version Checker.
+$Settings['vercheck'] = 2;
+*/
+if(!isset($Settings['vercheck'])) { 
+       $Settings['vercheck'] = 2; }
+if($Settings['vercheck']!=1&&
+       $Settings['vercheck']!=2) {
+       $Settings['vercheck'] = 2; }
+if($Settings['vercheck']===2) {
+if($_GET['act']=="vercheckxsl") {
+if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
+header("Content-Type: application/xml; charset=UTF-8"); }
+else { header("Content-Type: text/xml; charset=UTF-8"); }
+echo '<?xml version="1.0" encoding="UTF-8"?>';
+echo "\n"; ?>
+
+<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
+  <body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE">
+    <xsl:for-each select="versioninfo/version">
+      <div style="background-color:teal;color:white;padding:4px">
+        <span style="font-weight:bold">iDB Version Checker</span>
+      </div>
+      <div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
+        <span style="font-style:italic">
+          Board Name: <xsl:value-of select="title"/>
+        </span>
+      </div>
+    </xsl:for-each>
+  </body>
+</html>
+<?php die(); } if($_GET['act']=="versioninfo") {
+if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
+header("Content-Type: application/xml; charset=UTF-8"); }
+else { header("Content-Type: text/xml; charset=UTF-8"); }
+echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
+echo '<?xml-stylesheet type="text/xsl" href="'.url_maker($exfile['index'],$Settings['file_ext'],"act=vercheckxsl",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']).'"?>';
+echo "\n"; ?>
+
+<!DOCTYPE versioninfo [
+<!ELEMENT versioninfo (version*)>
+<!ELEMENT version (charset,title,name)>
+<!ELEMENT charset (#PCDATA)>
+<!ELEMENT title (#PCDATA)>
+<!ELEMENT name (#PCDATA)>
+]>
+
+<versioninfo>
+
+<version>
+<charset><?php echo $Settings['charset']; ?></charset> 
+<title><?php echo $Settings['board_name']; ?></title> 
+<?php echo "<name>".$iDBVerName."</name>\n"; ?>
+</version>
+
+</versioninfo>
+<?php die(); } }
+if($Settings['vercheck']===1) {
+if($_GET['act']=="versioninfo") { header("Content-Type: text/plain; charset=UTF-8");
+header("Location: ".$VerCheckURL."&name=".urlencode($iDBVerName)); die(); } }
 if($Settings['enable_pathinfo']=="on") { 
        mrstring(); /* Change Path info to Get Vars :P */ }
 // Check to see if variables are set