Skip to content

Commit

Permalink
OLDWEB: Fix PHP incompatibilities
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Apr 9, 2016
1 parent 411e65b commit 3fb736c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions compatibility.php
Expand Up @@ -362,7 +362,7 @@ function displayGameList($title, $games) {
{
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
Expand All @@ -387,7 +387,7 @@ function displayGameList($title, $games) {
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(" ");
Expand Down
4 changes: 2 additions & 2 deletions compatibility_stable.php
Expand Up @@ -362,7 +362,7 @@ function displayGameList($title, $games) {
{
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
Expand All @@ -387,7 +387,7 @@ function displayGameList($title, $games) {
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(" ");
Expand Down
2 changes: 1 addition & 1 deletion documentation.php
Expand Up @@ -61,7 +61,7 @@
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"
)
);
Expand Down
3 changes: 1 addition & 2 deletions include/html.php
Expand Up @@ -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=" &lt;&lt; Back " name="jsback" onClick="javascript:self.location=\''.$url.'\';">'."\n";
return $str;
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -17,7 +17,7 @@
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
Expand Down
10 changes: 5 additions & 5 deletions screenshots.php
Expand Up @@ -24,8 +24,8 @@

<?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 != "")
Expand Down Expand Up @@ -79,7 +79,7 @@
// display image
echo html_frame_td(
'<table cellpadding="0" cellspacing="0"><tr><td align="center">'.
'<a href="'.$PHP_SELF."?view=".$c.'&amp;offset='.$offset.'">'.
'<a href="'.$_SERVER["PHP_SELF"]."?view=".$c.'&amp;offset='.$offset.'">'.
'<img src="'.screenshot_thumb_path($c).'" '.
'width="'.$thumb_w.'" height="'.$thumb_h.'" alt="Screenshot '.$c.'"></a>'.
'</td></tr><tr><td align="center">'.
Expand Down Expand Up @@ -114,15 +114,15 @@
if ($offset)
{
$prev = $offset - 4;
$prevLink = html_ahref("&lt;&lt; Prev 4 Images",$PHP_SELF."?offset=".$prev,"style='color: white;'");
$prevLink = html_ahref("&lt;&lt; Prev 4 Images",$_SERVER["PHP_SELF"]."?offset=".$prev,"style='color: white;'");

}

// display next link
if (($offset + 4) < $screenshots_count)
{
$next = $where + 1;
$nextLink = html_ahref("Next 4 Images &gt;&gt;",$PHP_SELF."?offset=".$next,"style='color: white;'");
$nextLink = html_ahref("Next 4 Images &gt;&gt;",$_SERVER["PHP_SELF"]."?offset=".$next,"style='color: white;'");
}

echo html_frame_tr(
Expand Down

0 comments on commit 3fb736c

Please sign in to comment.