[Scummvm-cvs-logs] scummvm-web old-design -> 8cc6d23bb9d4becb0c3a0d5463581e3508b8883f

sev- sev at scummvm.org
Sat Apr 9 14:52:28 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
8cc6d23bb9 WEB: Fix PHP incompatibilities on the old website


Commit: 8cc6d23bb9d4becb0c3a0d5463581e3508b8883f
    https://github.com/scummvm/scummvm-web/commit/8cc6d23bb9d4becb0c3a0d5463581e3508b8883f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-04-09T14:52:04+02:00

Commit Message:
WEB: Fix PHP incompatibilities on the old website

Changed paths:
    compatibility.php
    compatibility_stable.php
    documentation.php
    include/html.php
    index.php
    screenshots.php



diff --git a/compatibility.php b/compatibility.php
index 9985021..abbc057 100644
--- a/compatibility.php
+++ b/compatibility.php
@@ -362,7 +362,7 @@ if ($details) {
 		{
 			if ($c % 2 == 0) { $color = "color2"; } else { $color = "color0"; }
 			echo html_frame_tr(
-						html_frame_td(html_ahref($name, $PHP_SELF."?details=".$array[0])).
+						html_frame_td(html_ahref($name, $_SERVER["PHP_SELF"]."?details=".$array[0])).
 						html_frame_td($array[0]).
 						html_frame_td($array[1]."%", 'align="center" class="pct'.($array[1] - ($array[1]%5)).'"'),
 						$color
@@ -387,7 +387,7 @@ if ($details) {
 echo html_frame_end(" ");
 
 if ($details)
-    echo html_p(),html_back_link(1,$PHP_SELF);
+    echo html_p(),html_back_link(1,$_SERVER["PHP_SELF"]);
 
 echo html_p();
 echo html_round_frame_end(" ");
diff --git a/compatibility_stable.php b/compatibility_stable.php
index 1611c91..d071bcd 100644
--- a/compatibility_stable.php
+++ b/compatibility_stable.php
@@ -362,7 +362,7 @@ if ($details) {
 		{
 			if ($c % 2 == 0) { $color = "color2"; } else { $color = "color0"; }
 			echo html_frame_tr(
-						html_frame_td(html_ahref($name, $PHP_SELF."?details=".$array[0])).
+						html_frame_td(html_ahref($name, $_SERVER["PHP_SELF"]."?details=".$array[0])).
 						html_frame_td($array[0]).
 						html_frame_td($array[1]."%", 'align="center" class="pct'.($array[1] - ($array[1]%5)).'"'),
 						$color
@@ -387,7 +387,7 @@ if ($details) {
 echo html_frame_end(" ");
 
 if ($details)
-    echo html_p(),html_back_link(1,$PHP_SELF);
+    echo html_p(),html_back_link(1,$_SERVER["PHP_SELF"]);
 
 echo html_p();
 echo html_round_frame_end(" ");
diff --git a/documentation.php b/documentation.php
index 212f4af..94d4a5f 100644
--- a/documentation.php
+++ b/documentation.php
@@ -61,7 +61,7 @@ else
         list($file,$ext) = split("\.",$item,2);
         echo html_frame_tr(
                     html_frame_td(
-                                  html_ahref(display_xml($file_root."/docs/".$item,'NAME'),"$PHP_SELF?view=$file").html_br().
+                                  html_ahref(display_xml($file_root."/docs/".$item,'NAME'),$_SERVER["PHP_SELF"]."?view=$file").html_br().
                                   display_xml($file_root."/docs/".$item,'DESC').html_br(2)."\n"
                                  )
                           );
diff --git a/include/html.php b/include/html.php
index 1cba830..e50ab7b 100644
--- a/include/html.php
+++ b/include/html.php
@@ -248,8 +248,7 @@ function html_form_submit ($value = "")
 
 function html_form_js_button ($url = null)
 {
-	global $PHP_SELF;
-	if (!$url) { $url = $PHP_SELF; }
+	if (!$url) { $url = $_SERVER["PHP_SELF"]; }
 	$str = '<input type=button value=" << Back " name="jsback" onClick="javascript:self.location=\''.$url.'\';">'."\n";
 	return $str;
 }
diff --git a/index.php b/index.php
index 1d284ad..891e77b 100644
--- a/index.php
+++ b/index.php
@@ -17,7 +17,7 @@ require($file_root."/include/"."screenshots.php");
 html_header("ScummVM", '<script src="'.$file_root.'/screenshots.js" type="text/javascript"></script>');
 sidebar_start();
 
-$shownews = $_GET['shownews'];
+$shownews = empty($_GET['shownews']) ? 0 : 1;
 
 // display welcome table
 // don't show this if we are in news mode
diff --git a/screenshots.php b/screenshots.php
index b24c8fe..28cc483 100644
--- a/screenshots.php
+++ b/screenshots.php
@@ -24,8 +24,8 @@ echo html_round_frame_start("Screenshots","");
 
 <?php
 
-$view = $_GET['view'];
-$offset = $_GET['offset'];
+$view = empty($_GET['view']) ? "" : $_GET['view'];
+$offset = empty($_GET['offset']) ? 0 : $_GET['offset'];
 
 // if in single view
 if ($view != "")
@@ -79,7 +79,7 @@ $where = 0;
 		// display image
 		echo html_frame_td(
 				   '<table cellpadding="0" cellspacing="0"><tr><td align="center">'.
-				   '<a href="'.$PHP_SELF."?view=".$c.'&offset='.$offset.'">'.
+				   '<a href="'.$_SERVER["PHP_SELF"]."?view=".$c.'&offset='.$offset.'">'.
 				   '<img src="'.screenshot_thumb_path($c).'" '.
 				   'width="'.$thumb_w.'" height="'.$thumb_h.'" alt="Screenshot '.$c.'"></a>'.
 				   '</td></tr><tr><td align="center">'.
@@ -114,7 +114,7 @@ $where = 0;
 	if ($offset)
 	{
 		$prev = $offset - 4;
-		$prevLink = html_ahref("<< Prev 4 Images",$PHP_SELF."?offset=".$prev,"style='color: white;'");
+		$prevLink = html_ahref("<< Prev 4 Images",$_SERVER["PHP_SELF"]."?offset=".$prev,"style='color: white;'");
 
 	}
 
@@ -122,7 +122,7 @@ $where = 0;
 	if (($offset + 4) < $screenshots_count)
 	{
 		$next = $where + 1;
-		$nextLink = html_ahref("Next 4 Images >>",$PHP_SELF."?offset=".$next,"style='color: white;'");
+		$nextLink = html_ahref("Next 4 Images >>",$_SERVER["PHP_SELF"]."?offset=".$next,"style='color: white;'");
 	}
 
 	echo html_frame_tr(






More information about the Scummvm-git-logs mailing list