Ticket #8785: compatibility.php

File compatibility.php, 4.9 KB (added by jvprat, 16 years ago)

Updated compatibility page

Line 
1<?
2
3/*
4 * ScummVM Compatibility Page
5 *
6 */
7
8// set this for position of this file relative
9$file_root = ".";
10
11// load libraries
12require($file_root."/include/"."incl.php");
13
14// Load the compatibility information for the requested version
15if (isset($_GET['version']) && file_exists($file_root."/compat-".$_GET['version'].".inc")) {
16 $version = $_GET['version'];
17} else {
18 $version = "SVN";
19}
20include($file_root."/compat-".$version.".inc");
21
22// start of html
23html_page_header('ScummVM :: Compatibility - '.$version);
24
25html_content_begin($version.' Compatibility');
26
27if (isset($_GET['details'])) {
28 $details = $_GET['details'];
29}
30
31?>
32 <div class="par-item">
33
34<?php
35
36if ($details) {
37
38 echo '<div class="par-content">';
39
40}
41else {
42?>
43 <div class="par-intro">
44<br>
45 This page lists the progress of ScummVM as it relates to individual game compatibility.<br>
46 Click on the game name to view the complete notes of a game.
47
48 <br><br>Please note this list applies to the English versions of games. We attempt to test many versions of games, however there are occasionally problems with other languages.
49<?
50if ($version == "SVN") {
51?>
52 This is the compatibility of the current WIP SVN version, <B>not of a stable release</B>
53 (Please see one of the following for the Compatibility charts of the stable releases:
54<?
55
56// List the available versions of compatibility information
57$versions = array();
58if ($dir = opendir($file_root)) {
59 while (($compatfile = readdir($dir)) !== false) {
60 if (substr($compatfile, 0, 7) == "compat-" && substr($compatfile, -4) == ".inc") {
61 $ver = substr($compatfile, 7, strlen($compatfile) - 11);
62 if ($ver != "SVN")
63 $versions[] = $ver;
64 }
65 }
66 closedir($dir);
67}
68
69// Sort by version number
70natsort($versions);
71
72// Latest version first
73$versions = array_reverse($versions);
74
75foreach ($versions as $ver)
76 echo " <a href=\"compatibility.php?version=".$ver."\">".$ver."</a>";
77
78?>).<br><br>
79 As this is the status of the Work In Progress version, occasional temporary bugs
80 may be introduced with new changes, thus this list refects the 'best case' scenario.
81 It is highly recommended to use the latest stable release, where possible.
82<?
83} else {
84?>
85 Also, this is the compatibility of the <? echo $version; ?> stable release, <B>not
86 of SVN snapshots/daily builds</B>. The status of these can be found on the <a href="compatibility.php">SVN Compatibility</A> chart.
87<?
88}
89?>
90 <br><br>
91 <small>Last Updated: <? echo date("F d, Y",getlastmod()); ?></small>
92<br>
93<br>
94 </div>
95<br>
96 <div class="par-content">
97
98<?
99 // Display the Color Key Table
100 echo html_frame_start("Color Key","85%",1,1,"color4");
101 $pcts = array(0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100);
102 while (list($key,$num) = each($pcts))
103 {
104 $keyTD .= html_frame_td($num,'align=center class="pct'.$num.'"');
105 }
106 echo html_frame_tr($keyTD);
107 echo html_frame_end(),html_br();
108}
109
110// render the compatibility chart
111
112if ($details) {
113 // 'Details' mode -- information about a specific game
114 echo html_frame_start("Game Compatibility Chart","90%",2,1,"color4");
115 echo html_frame_tr(
116 html_frame_td("Game Full Name").
117 html_frame_td("Game Short Name").
118 html_frame_td("% Completed"),
119 "color4"
120
121 );
122
123 $arrayt = array();
124 foreach($gamesCompanies as $ar) {
125 $arrayt = array_merge($arrayt, $ar);
126 }
127 while (list($name,$array) = each($arrayt))
128 {
129
130 if ($array[0] == $details) {
131 $color = "color0";
132 echo html_frame_tr(
133 html_frame_td($name).
134 html_frame_td($array[0]).
135 html_frame_td($array[1]."%", 'align="center" class="pct'.($array[1] - ($array[1]%5)).'"'),
136 $color
137 );
138 echo html_frame_tr(html_frame_td(
139 html_br().
140 html_blockquote($notes{$details}).
141 html_br(),
142 "colspan=4")
143 );
144 }
145 }
146} else {
147 // List mode -- show all games
148 function displayGameList($title, $games) {
149 global $version;
150
151 echo html_frame_start("$title Game Compatibility Chart","95%",2,1,"color4");
152 echo html_frame_tr(
153 html_frame_td("Game Full Name").
154 html_frame_td("Game Short Name").
155 html_frame_td("% Completed"),
156 "color4"
157 );
158 $c = 0;
159 while (list($name,$array) = each($games))
160 {
161 if ($c % 2 == 0) { $color = "color2"; } else { $color = "color0"; }
162 echo html_frame_tr(
163 html_frame_td(html_ahref($name, $PHP_SELF."?version=".$version."&amp;details=".$array[0])).
164 html_frame_td($array[0]).
165 html_frame_td($array[1]."%", 'align="center" class="pct'.($array[1] - ($array[1]%5)).'"'),
166 $color
167 );
168 $c++;
169 }
170 }
171
172 $i = 0;
173 while (list($name,$games) = each($gamesCompanies))
174 {
175 if ($i != 0) {
176 echo html_frame_end("&nbsp;");
177 echo html_p();
178 }
179
180 displayGameList($name, $games);
181
182 $i++;
183 }
184
185}
186
187echo html_frame_end("&nbsp;");
188
189if ($details)
190 echo '<p class="bottom-link"><a href="javascript:history.back(1)">&lt;&lt;Back</a></p>'."\n";
191
192echo " <br>";
193echo " </div>\n";
194echo "</div>\n";
195
196html_content_end();
197html_page_footer();
198
199?>