OSDN Git Service

Added XHTML5 Support.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Tue, 2 Nov 2010 23:53:21 +0000 (23:53 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Tue, 2 Nov 2010 23:53:21 +0000 (23:53 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@594 2b68903e-0b30-0410-9a39-a2e4f3c5be39

inc/admin/main.php
inc/html5.php
inc/versioninfo.php
setup/mkconfig.php
setup/setup.php

index 25198f9..72ad59e 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: main.php - Last Update: 09/05/2010 SVN 577 - Author: cooldude2k $
+    $FileInfo: main.php - Last Update: 11/02/2010 SVN 594 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="main.php"||$File3Name=="/main.php") {
@@ -619,6 +619,7 @@ while ($gi < $gnum) { ?>
        <option<?php if($Settings['html_type']=="xhtml10") { echo " selected=\"selected\""; } ?> value="xhtml10">XHTML 1.0</option>
        <option<?php if($Settings['html_type']=="xhtml11") { echo " selected=\"selected\""; } ?> value="xhtml11">XHTML 1.1</option>
        <option<?php if($Settings['html_type']=="html5") { echo " selected=\"selected\""; } ?> value="html5">HTML 5</option>
+       <option<?php if($Settings['html_type']=="xhtml5") { echo " selected=\"selected\""; } ?> value="xhtml5">XHTML 5</option>
        </select></td>
 </tr><tr style="text-align: left;">
        <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLLevel">HTML Level only for XHTML 1.0:</label></td>
@@ -783,6 +784,9 @@ $_POST['BoardURL'] = htmlentities($_POST['BoardURL'], ENT_QUOTES, $Settings['cha
 $_POST['BoardURL'] = remove_spaces($_POST['BoardURL']);
 $_POST['WebURL'] = htmlentities($_POST['WebURL'], ENT_QUOTES, $Settings['charset']);
 $_POST['WebURL'] = remove_spaces($_POST['WebURL']);
+if($_POST['HTMLType']=="xhtml11") { $_POST['HTMLLevel'] = "Strict"; }
+if($_POST['HTMLType']=="html5") { $_POST['OutPutType'] = "html"; }
+if($_POST['HTMLType']=="xhtml5") { $_POST['OutPutType'] = "xhtml"; }
 $BoardSettings=$pretext2[0]."\n".
 "\$Settings['sqlhost'] = ".null_string($Settings['sqlhost']).";\n".
 "\$Settings['sqldb'] = ".null_string($Settings['sqldb']).";\n".
index 86104a7..17e19c2 100644 (file)
     Copyright 2004-2010 iDB Support - http://idb.berlios.de/
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: html5.php - Last Update: 09/21/2010 SVN 553 - Author: cooldude2k $
+    $FileInfo: html5.php - Last Update: 11/02/2010 SVN 594 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="xhtml10.php"||$File3Name=="/xhtml10.php") {
        require('index.php');
        exit(); }
-$ccstart = "//<!--"; $ccend = "//-->";
-header("Content-Type: text/html; charset=".$Settings['charset']);
+$XHTML5 = false;
+// 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 = "//-->"; $XHTML5 = false;
+header("Content-Type: text/html; charset=".$Settings['charset']); }
+if($Settings['output_type']=="xhtml") {
+if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
+       $ccstart = "//<![CDATA["; $ccend = "//]]>"; $XHTML5 = true;
+       header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
+       xml_doc_start("1.0",$Settings['charset']); }
+else { if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
+       $ccstart = "//<![CDATA["; $ccend = "//]]>"; $XHTML5 = true;
+   header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
+       xml_doc_start("1.0",$Settings['charset']);
+} else { $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
+       header("Content-Type: text/html; charset=".$Settings['charset']); } } }
+if($Settings['output_type']!="xhtml") {
+       if($Settings['output_type']!="html") {
+               $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
+header("Content-Type: text/html; charset=".$Settings['charset']); } }
 if($checklowview===true&&$_GET['act']=="lowview") { 
    $ThemeSet['CSSType'] = "lowview"; 
    $ThemeSet['ThemeName'] = $OrgName." Low Theme";
@@ -76,13 +96,22 @@ if($Settings['html_level']!="Strict") {
        if($Settings['html_level']!="Transitional") {
                $Settings['html_level'] = "Transitional"; } }
 // HTML Document Starts
+if($XHTML5===false) {
 ?>
 <!DOCTYPE html>
 <?php // HTML meta tags and other html, head tags ?>
 <html lang="en">
+<?php } if($XHTML5===true) { ?>
+<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
+<?php } ?>
 <head>
+<?php if($XHTML5===false) { ?>
 <meta charset="<?php echo $Settings['charset']; ?>">
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>">
+<?php } if($XHTML5===true) { ?>
+<meta charset="<?php echo $Settings['charset']; ?>" />
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>" />
+<?php } ?>
 <base href="<?php echo $BoardURL; ?>" />
 <?php if($Settings['showverinfo']=="on") { ?>
 <meta name="Generator" content="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
index a73ccf9..e835f50 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: 11/02/2010 SVN 593 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 11/02/2010 SVN 594 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -27,7 +27,7 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        return $return_var; }
 // Version number and date stuff. :P
 $VER1[0] = 0; $VER1[1] = 4; $VER1[2] = 2; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 593; $RName = "iDB"; $SFName = "IntDB";
+$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 594; $RName = "iDB"; $SFName = "IntDB";
 $SVNDay[0] = 11; $SVNDay[1] = 02; $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);
index daa5b76..9a69011 100644 (file)
@@ -12,7 +12,7 @@
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
     iDB Installer made by Game Maker 2k - http://idb.berlios.net/
 
-    $FileInfo: mkconfig.php - Last Update: 10/26/2010 SVN 591 - Author: cooldude2k $
+    $FileInfo: mkconfig.php - Last Update: 11/02/2010 SVN 594 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="mkconfig.php"||$File3Name=="/mkconfig.php") {
@@ -85,6 +85,7 @@ if ($_POST['AdminPasswords']!=$_POST['ReaPassword']) { $Error="Yes";
 echo "<br />Your passwords did not match."; }
 if($_POST['HTMLType']=="xhtml11") { $_POST['HTMLLevel'] = "Strict"; }
 if($_POST['HTMLType']=="html5") { $_POST['OutPutType'] = "html"; }
+if($_POST['HTMLType']=="xhtml5") { $_POST['OutPutType'] = "xhtml"; }
 $_POST['BoardURL'] = htmlentities($_POST['BoardURL'], ENT_QUOTES, $Settings['charset']);
 $_POST['BoardURL'] = remove_spaces($_POST['BoardURL']);
 $_POST['BoardURL'] = addslashes($_POST['BoardURL']);
index 3615ab8..8ae4690 100644 (file)
@@ -12,7 +12,7 @@
     Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
     iDB Installer made by Game Maker 2k - http://idb.berlios.net/
 
-    $FileInfo: setup.php - Last Update: 09/05/2010 SVN 573 - Author: cooldude2k $
+    $FileInfo: setup.php - Last Update: 11/02/2010 SVN 594 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="setup.php"||$File3Name=="/setup.php") {
@@ -117,6 +117,7 @@ fclose($fp);
        <option value="xhtml10">XHTML 1.0</option>
        <option value="xhtml11">XHTML 1.1</option>
        <option value="html5">HTML 5</option>
+       <option value="xhtml5">XHTML 5</option>
        </select></td>
 </tr><tr>
        <td style="width: 50%;"><label class="TextBoxLabel" for="HTMLLevel">HTML Level only for XHTML 1.0:</label></td>