OSDN Git Service

b0e4100a62dbb55d3039e6ecb77b429df0213d17
[idb/iDB-Extras.git.git] / vercheck / index.php
1 <?php
2 /*
3     This program is free software; you can redistribute it and/or modify
4     it under the terms of the Revised BSD License.
5
6     This program is distributed in the hope that it will be useful,
7     but WITHOUT ANY WARRANTY; without even the implied warranty of
8     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9     Revised BSD License for more details.
10
11     Copyright 2009-2011 iDB Support - http://idb.berlios.de/
12     Copyright 2009-2011 Game Maker 2k - http://gamemaker2k.org/
13
14     $FileInfo: index.php - Last Update: 07/18/2014 Ver 3.1.2 - Author: cooldude2k $
15 */
16 /* Change to your url. */
17 @ini_set("html_errors", false);
18 @ini_set("track_errors", false);
19 @ini_set("display_errors", false);
20 @ini_set("report_memleaks", false);
21 @ini_set("display_startup_errors", false);
22 //@ini_set("error_log","logs/error.log"); 
23 //@ini_set("log_errors","On"); 
24 @ini_set("docref_ext", "");
25 @ini_set("docref_root", "http://php.net/");
26 @ini_set("date.timezone","UTC"); 
27 @ini_set("default_mimetype","text/html");
28 @error_reporting(E_ALL ^ E_NOTICE);
29 @set_time_limit(30); @ignore_user_abort(true);
30 if(function_exists("date_default_timezone_set")) { 
31         @date_default_timezone_set("UTC"); }
32 function idb_output_handler($buffer) { return $buffer; }
33 @ob_start("idb_output_handler");
34 header("Cache-Control: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
35 header("Pragma: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
36 header("P3P: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
37 header("Date: ".gmdate("D, d M Y H:i:s")." GMT");
38 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
39 header("Expires: ".gmdate("D, d M Y H:i:s")." GMT");
40 output_reset_rewrite_vars();
41 require_once('inc/killglobals.php');
42 $get_content_by = "file_get_contents"; // Can be file_get_contents or curl
43 $site_url = "http://localhost/vercheck/";
44 $agent_site_url = $site_url."?act=vercheck";
45 $site_name = "iDB Version checker";
46 $appname = "iDB VerCheck";
47 $download_url = $site_url."download.php";
48 $site_version = "3.1.2";
49 $ver_exp = explode(".",$site_version);
50 if(!isset($ver_exp[3])) { $ver_exp[3] = null; }
51 $appver = array($ver_exp[0],$ver_exp[1],$ver_exp[2],$ver_exp[3]);//Version of program
52 $csryear = "2004"; $cryear = date("Y"); if($cryear<=2004) { $cryear = "2005"; }
53 $site_useragent = "Mozilla/5.0 (compatible; iDB-VerCheck/".$site_version."; +".$agent_site_url.")";
54 // Programs to check for add to array.
55 // $iDBArray = array("IntDB", "iDB");//IntDB
56 $iDBArray = array("iDB");
57 @ini_set("user_agent", $site_useragent);
58 if(!isset($get_content_by) || ($get_content_by!="file_get_contents" && $get_content_by!="curl")) { 
59    $get_content_by = "file_get_contents"; }
60 @ini_set("user_agent", $site_useragent);
61 if (function_exists("stream_context_create")) {
62 if($get_content_by=="file_get_contents") {
63 $opts = array(
64   'http' => array(
65     'method' => "GET",
66     'header' => "Accept-Language: *\r\n".
67                 "User-Agent: ".$site_useragent."\r\n".
68                 "Accept: */*\r\n".
69                 "Connection: keep-alive\r\n".
70                 "Referer: ".$agent_site_url."\r\n".
71                 "From: ".$agent_site_url."\r\n".
72                 "Via: ".$_SERVER['REMOTE_ADDR']."\r\n".
73                 "Forwarded: ".$_SERVER['REMOTE_ADDR']."\r\n".
74                 "X-Forwarded-For: ".$_SERVER['REMOTE_ADDR']."\r\n".
75                 "Client-IP: ".$_SERVER['REMOTE_ADDR']."\r\n"
76   )
77 );
78 $context = stream_context_create($opts); } }
79 function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
80         $return_var = $proname." ".$reltype." ".$subver.".".$ver.".".$supver;
81         if($showsvn==false) { $showsvn = null; }
82         if($showsvn==true) { $return_var .= " SVN ".$svnver; }
83         if($showsvn!=true&&$showsvn!=null) { $return_var .= " ".$showsvn." ".$svnver; }
84         return $return_var; }
85 $appversion = version_info($appname,$appver[0],$appver[1],$appver[2],$appver[3]." Ver.",null,false);
86 if(!isset($_GET['redirect'])) { $_GET['redirect'] = "off"; }
87     /**
88      * Returns true if $string is valid UTF-8 and false otherwise.
89      *
90      * @since        1.14
91      * @param [mixed] $string     string to be tested
92      * @subpackage
93      */
94     function is_utf8($string) {
95       
96         // From http://w3.org/International/questions/qa-forms-utf-8.html
97         return preg_match('%^(?:
98               [\x09\x0A\x0D\x20-\x7E]            # ASCII
99             | [\xC2-\xDF][\x80-\xBF]             # non-overlong 2-byte
100             |  \xE0[\xA0-\xBF][\x80-\xBF]        # excluding overlongs
101             | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}  # straight 3-byte
102             |  \xED[\x80-\x9F][\x80-\xBF]        # excluding surrogates
103             |  \xF0[\x90-\xBF][\x80-\xBF]{2}     # planes 1-3
104             | [\xF1-\xF3][\x80-\xBF]{3}          # planes 4-15
105             |  \xF4[\x80-\x8F][\x80-\xBF]{2}     # plane 16
106         )*$%xs', $string);
107       
108     } 
109   # Original PHP code by Chirp Internet: www.chirp.com.au
110   # Please acknowledge use of this code by including this header.
111
112   function robots_allowed($url, $useragent=false)
113   {
114         global $context;
115     # parse url to retrieve host and path
116     $parsed = parse_url($url);
117
118     $agents = array(preg_quote('*'));
119     if($useragent) $agents[] = preg_quote($useragent);
120     $agents = implode('|', $agents);
121
122     # location of robots.txt file
123     if (function_exists("stream_context_create")) {
124         if($get_content_by=="file_get_contents") {
125            $robotstxt = file_get_contents("http://{$parsed['host']}/robots.txt",false,$context); }
126     } else {
127         if($get_content_by=="file_get_contents") {
128            $robotstxt = file_get_contents("http://{$parsed['host']}/robots.txt"); }
129     }
130     if($get_content_by=="curl") {
131        $ch = curl_init(); 
132        curl_setopt($ch, CURLOPT_URL, "http://{$parsed['host']}/robots.txt");
133        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: *",
134                                                   "User-Agent: ".$site_useragent,
135                                                   "Accept: */*",
136                                                   "Connection: keep-alive",
137                                                   "Referer: ".$agent_site_url,
138                                                   "From: ".$agent_site_url,
139                                                   "Via: ".$_SERVER['REMOTE_ADDR'],
140                                                   "Forwarded: ".$_SERVER['REMOTE_ADDR'],
141                                                   "X-Forwarded-For: ".$_SERVER['REMOTE_ADDR'],
142                                                   "Client-IP: ".$_SERVER['REMOTE_ADDR']));
143        curl_setopt($ch, CURLOPT_HEADER, 0);
144        curl_setopt($ch, CURLOPT_VERBOSE, 0);
145        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
146        curl_setopt($ch, CURLOPT_USERAGENT, $site_useragent);
147        $robotstxt = curl_exec($ch);
148        curl_close($ch); }
149     if(!$robotstxt) { return true; }
150
151     $rules = array();
152     $ruleapplies = false;
153     foreach($robotstxt as $line) {
154       # skip blank lines
155       if(!$line = trim($line)) continue;
156
157       # following rules only apply if User-agent matches $useragent or '*'
158       if(preg_match('/User-agent: (.*)/i', $line, $match)) {
159         $ruleapplies = preg_match("/($agents)/i", $match[1]);
160       }
161       if($ruleapplies && preg_match('/Disallow:(.*)/i', $line, $regs)) {
162         # an empty rule implies full access - no further tests required
163         if(!$regs[1]) return true;
164         # add rules that apply to array for testing
165         $rules[] = preg_quote(trim($regs[1]), '/');
166       }
167     }
168
169     foreach($rules as $rule) {
170       # check if page is disallowed to us
171       if(preg_match("/^$rule/", $parsed['path'])) return false;
172     }
173
174     # page is not disallowed
175     return true;
176   }
177 if(!isset($_SERVER['HTTP_USER_AGENT'])) {
178         $_SERVER['HTTP_USER_AGENT'] = null; }
179 if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
180         $_SERVER["HTTP_ACCEPT"] = "application/xml"; }
181 if(!isset($_SERVER['HTTP_ACCEPT'])) {
182         $_SERVER['HTTP_ACCEPT'] = null; }
183 if(!isset($_SERVER['PATH_INFO'])) {
184         $_SERVER['PATH_INFO'] = null; }
185 if(!isset($_GET['vercheck'])) { $_GET['vercheck'] = null; }
186 if($_GET['redirect']=="js") {
187 header("Content-Type: application/javascript; charset=UTF-8"); }
188 if($_GET['redirect']=="xml") {
189 if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
190         $_SERVER["HTTP_ACCEPT"] = "application/xml"; }
191 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xml") ) {
192 header("Content-Type: application/xml; charset=UTF-8"); }
193 else { header("Content-Type: text/xml; charset=UTF-8"); } }
194 if(!isset($_GET['act'])) { $_GET['act'] = "vercheck"; }
195 if(isset($_GET['act'])&&$_GET['act']!="update") {
196 if(!isset($_GET['name'])&&!isset($_GET['bid'])) {
197 ?>
198 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
199    "http://www.w3.org/TR/html4/strict.dtd">
200 <html>
201 <head>
202 <title> <?php echo $site_name; ?> </title>
203 <meta http-equiv="content-language" content="en-US">
204 <meta http-equiv="content-type" content="text/html; charset=iso-8859-15">
205 <meta name="Generator" content="EditPlus">
206 <meta name="Author" content="Cool Dude 2k">
207 <meta name="Keywords" content="<?php echo $site_name; ?>">
208 <meta name="Description" content="<?php echo $site_name; ?>">
209 <meta name="ROBOTS" content="Index, FOLLOW">
210 <meta name="revisit-after" content="1 days">
211 <meta name="GOOGLEBOT" content="Index, FOLLOW">
212 <meta name="resource-type" content="document">
213 <meta name="distribution" content="global">
214 <link rel="icon" href="favicon.ico" type="image/icon">
215 <link rel="shortcut icon" href="favicon.ico" type="image/icon">
216 <!-- Katarzyna O_o -->
217 </head>
218
219 <body>
220 <!-- Renee Sabonis ^_^ -->
221 <form method="get" action="?act=vercheck&amp;vercheck=newtype&amp;encoded=false">
222 <div>
223 <input type="hidden" id="act" name="act" value="vercheck" />
224 <label for="bid">Insert board url:</label><br />
225 <input type="text" id="bid" name="bid" /><br />
226 <input type="hidden" id="vercheck" name="vercheck" value="newtype" />
227 <input type="hidden" id="encoded" name="encoded" value="false" />
228 <input type="submit" />
229 </div>
230 </form>
231
232 <div class="copyright"><br />Powered by <a href="http://idb.berlios.de/" title="iDB-VerCheck <?php echo $site_version; ?>" onclick="window.open(this.href);return false;">iDB VerCheck</a> &copy; <a href="http://idb.berlios.de/support/category.php?act=view&amp;id=2" title="Game Maker 2k" onclick="window.open(this.href);return false;">Game Maker 2k</a> @ <?php echo $csryear." - ".$cryear; ?></div>
233 <!-- Stephanie Braun o_O -->
234 </body>
235 </html>
236 <?php exit(); } }
237 if(isset($_GET['bid'])) {
238         if(!isset($_GET['encoded'])) { 
239                 $_GET['encoded'] = "true"; }
240         if($_GET['encoded']=="true") { 
241         $_GET['bid'] = @base64_decode($_GET['bid']); }
242         $_GET['bid'] = @urldecode($_GET['bid']);
243         $_GET['bid'] = @strip_tags($_GET['bid']);
244         if(robots_allowed($_GET['bid'],"iDB-VerCheck")===false) {
245                 echo "Error cannot prase this site. :P ";
246                 /* Then we cant prase this site now*/ exit(); die(); }
247         $ChkURL = parse_url($_GET['bid']);
248         $HostIP = gethostbyname($ChkURL['host']);
249         if($_GET['vercheck']=="newtype") {
250         $actchange = preg_quote("act=view", '/');
251         $_GET['bid'] = preg_replace("/".$actchange."/i", "act=versioninfo", $_GET['bid']);
252     if (function_exists("stream_context_create")) {
253         if($get_content_by=="file_get_contents") {
254            $GetTitle = file_get_contents($_GET['bid'],false,$context); }
255     } else {
256         if($get_content_by=="file_get_contents") {
257            $GetTitle = file_get_contents($_GET['bid']); }
258     } 
259     if($get_content_by=="curl") {
260        $ch = curl_init(); 
261        curl_setopt($ch, CURLOPT_URL, $_GET['bid']);
262        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: *",
263                                                   "User-Agent: ".$site_useragent,
264                                                   "Accept: */*",
265                                                   "Connection: keep-alive",
266                                                   "Referer: ".$agent_site_url,
267                                                   "From: ".$agent_site_url,
268                                                   "Via: ".$_SERVER['REMOTE_ADDR'],
269                                                   "Forwarded: ".$_SERVER['REMOTE_ADDR'],
270                                                   "X-Forwarded-For: ".$_SERVER['REMOTE_ADDR'],
271                                                   "Client-IP: ".$_SERVER['REMOTE_ADDR']));
272        curl_setopt($ch, CURLOPT_HEADER, 0);
273        curl_setopt($ch, CURLOPT_VERBOSE, 0);
274        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
275        curl_setopt($ch, CURLOPT_USERAGENT, $site_useragent);
276        $GetTitle = curl_exec($ch);
277        curl_close($ch); } }
278         if($_GET['vercheck']!="newtype") {
279     if (function_exists("stream_context_create")) {
280         if($get_content_by=="file_get_contents") {
281            $GetTitle = file_get_contents($_GET['bid'],false,$context); }
282     } else {
283         if($get_content_by=="file_get_contents") {
284            $GetTitle = file_get_contents($_GET['bid']); }
285     } 
286     if($get_content_by=="curl") {
287        $ch = curl_init(); 
288        curl_setopt($ch, CURLOPT_URL, $_GET['bid']);
289        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: *",
290                                                   "User-Agent: ".$site_useragent,
291                                                   "Accept: */*",
292                                                   "Connection: keep-alive",
293                                                   "Referer: ".$agent_site_url,
294                                                   "From: ".$agent_site_url,
295                                                   "Via: ".$_SERVER['REMOTE_ADDR'],
296                                                   "Forwarded: ".$_SERVER['REMOTE_ADDR'],
297                                                   "X-Forwarded-For: ".$_SERVER['REMOTE_ADDR'],
298                                                   "Client-IP: ".$_SERVER['REMOTE_ADDR']));
299        curl_setopt($ch, CURLOPT_HEADER, 0);
300        curl_setopt($ch, CURLOPT_VERBOSE, 0);
301        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
302        curl_setopt($ch, CURLOPT_USERAGENT, $site_useragent);
303        $GetTitle = curl_exec($ch);
304        curl_close($ch); } }
305         $_GET['bid'] = htmlspecialchars($_GET['bid']);
306         preg_match_all("/<title>(.*?)<\/title>/i", $GetTitle, $GetFullTitle);
307         $GetConType = $GetTitle;
308         $GetTitle = htmlspecialchars(strip_tags(trim($GetFullTitle[1][0]))); 
309         if($_GET['vercheck']=="newtype") {
310         $prequote1 = preg_quote("<charset>", '/');
311         $prequote2 = preg_quote("</charset>", '/'); }
312         if($_GET['vercheck']!="newtype") {
313         $prequote1 = preg_quote("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=", '/');
314         $prequote2 = preg_quote("\" />", '/'); }
315         preg_match_all("/".$prequote1."(.*?)".$prequote2."/i", $GetConType, $GetCType);
316         $prequote1 = preg_quote("<name>", '/');
317         $prequote2 = preg_quote("</name>", '/');
318         preg_match_all("/".$prequote1."(.*?)".$prequote2."/i", $GetConType, $GetVerNum);
319         if(!isset($GetVerNum[1][0])) { 
320         $prequote1 = preg_quote("<!-- generator=\"", '/');
321         $prequote2 = preg_quote("\" -->", '/');
322         preg_match_all("/".$prequote1."(.*?)".$prequote2."/i", $GetConType, $GetVerNum); }
323         if(!isset($GetVerNum[1][0])) { 
324         $prequote1 = preg_quote("<meta name=\"Generator\" content=\"", '/');
325         $prequote2 = preg_quote("\" />", '/');
326         preg_match_all("/".$prequote1."(.*?)".$prequote2."/i", $GetConType, $GetVerNum); }
327         if(!isset($GetVerNum[1][0])) { 
328         $prequote1 = preg_quote("<a href=\"http://idb.berlios.de/\" title=\"", '/');
329         $prequote2 = preg_quote("\" onclick=\"window.open(this.href);return false;\">", '/');
330         preg_match_all("/".$prequote1."(.*?)".$prequote2."/i", $GetConType, $GetVerNum); }
331         if(!isset($GetVerNum[1][0])) { $GetVerNum[1][0] = null; }
332         $GetVerNum = $GetVerNum[1][0];
333         $GetVerNum = preg_replace("/\s/i", "|", $GetVerNum);
334         if(!isset($_GET['name'])) { $_GET['name'] = $GetVerNum; }
335         if(!isset($GetCType[1][0])) {
336         if(is_utf8($GetTitle)==true) { $GetCType[1][0] = "UTF-8"; }
337         if(is_utf8($GetTitle)==false) { $GetCType[1][0] = "UTF-8"; 
338         $GetTitle = utf8_encode($GetTitle); }
339         $preq1 = preg_quote("&amp;#", '/');
340         $GetTitle = preg_replace("/".$preq1."(.*?);/isU","&#\\1;",$GetTitle);
341         $preq2 = preg_quote("&amp;#x", '/');
342         $GetTitle = preg_replace("/".$preq2."(.*?);/isU","&#x\\1;",$GetTitle);
343         if(!isset($GetCType[1][0])) { $GetCType[1][0] = null; }
344         $BoardLang = $GetCType[1][0];
345         if(isset($BoardLang)) {
346         if($BoardLang!="ISO-8859-15"&&$BoardLang!="ISO-8859-1"&&
347         $BoardLang!="UTF-8"&&$BoardLang!="CP866"&&
348         $BoardLang!="Windows-1251"&&$BoardLang!="Windows-1252"&&
349         $BoardLang!="KOI8-R"&&$BoardLang!="BIG5"&&
350         $BoardLang!="GB2312"&&$BoardLang!="BIG5-HKSCS"&&
351         $BoardLang!="Shift_JIS"&&$BoardLang!="EUC-JP") {
352         $BoardLang = "ISO-8859-15"; } }
353         $GetFullTitle = $GetTitle; } }
354 if(!isset($_GET['bid'])) { $_GET['bid'] = null; }
355 // Make the Query String if we are not useing &=
356 function qstring($qstr=";",$qsep="=")
357 { $_GET = null; $_GET = array();
358 if (!isset($_SERVER['QUERY_STRING'])) {
359 $_SERVER['QUERY_STRING'] = getenv('QUERY_STRING'); }
360 @ini_get("arg_separator.input", $qstr);
361 $_SERVER['QUERY_STRING'] = urldecode($_SERVER['QUERY_STRING']);
362 $preqs = explode($qstr,$_SERVER["QUERY_STRING"]);
363 $qsnum = count($preqs); $qsi = 0;
364 while ($qsi < $qsnum) {
365 $preqst = explode($qsep,$preqs[$qsi],2);
366 $fix1 = array(" ",'$'); $fix2  = array("_","_");
367 $preqst[0] = str_replace($fix1, $fix2, $preqst[0]);
368 $preqst[0] = killbadvars($preqst[0]);
369 if($preqst[0]!=null) {
370 $_GET[$preqst[0]] = $preqst[1]; }
371 ++$qsi; } return true; }
372 if($_SERVER['PATH_INFO']==null) {
373         if(@getenv('PATH_INFO')!=null&&@getenv('PATH_INFO')!="1") {
374 $_SERVER['PATH_INFO'] = @getenv('PATH_INFO'); }
375 if(@getenv('PATH_INFO')==null) {
376 $myscript = $_SERVER["SCRIPT_NAME"];
377 $myphpath = $_SERVER["PHP_SELF"];
378 $mypathinfo = str_replace($myscript, "", $myphpath);
379 @putenv("PATH_INFO=".$mypathinfo); } }
380 // Change Path info to Get Vars :
381 function mrstring() {
382 $urlvar = explode('/',$_SERVER['PATH_INFO']);
383 $num=count($urlvar); $i=1;
384 while ($i < $num) {
385 //$urlvar[$i] = urldecode($urlvar[$i]);
386 if(!isset($_GET[$urlvar[$i]])) { $_GET[$urlvar[$i]] = null; }
387 if(!isset($urlvar[$i])) { $urlvar[$i] = null; }
388 if($_GET[$urlvar[$i]]==null&&$urlvar[$i]!=null) {
389 $fix1 = array(" ",'$'); $fix2  = array("_","_");
390 $urlvar[$i] = str_replace($fix1, $fix2, $urlvar[$i]);
391 $urlvar[$i] = killbadvars($urlvar[$i]);
392         $_GET[$urlvar[$i]] = $urlvar[$i+1]; }
393 ++$i; ++$i; } return true; }
394 // Redirect to another file with ether timed or nontimed redirect
395 function redirect($type,$file,$time=0,$url=null,$dbsr=true) {
396 if($type!="location"&&$type!="refresh") { $type=="location"; }
397 if($url!=null) { $file = $url.$file; }
398 if($dbsr===true) { $file = str_replace("//", "/", $file); }
399 if($type=="refresh") { header("Refresh: ".$time."; URL=".$file); }
400 if($type=="location") { @session_write_close(); 
401 header("Location: ".$file); } return true; }
402 function redirects($type,$url,$time=0) {
403 if($type!="location"&&$type!="refresh") { $type=="location"; }
404 if($type=="refresh") { header("Refresh: ".$time."; URL=".$url); }
405 if($type=="location") { header("Location: ".$url); } return true; }
406 // Make xhtml tags
407 function html_tag_make($name="br",$emptytag=true,$attbvar=null,$attbval=null,$extratest=null) {
408         $var_num = count($attbvar); $value_num = count($attbval);
409         if($var_num!=$value_num) { 
410                 echo "Erorr Number of Var and Values dont match!";
411         return false; } $i = 0;
412         while ($i < $var_num) {
413         if($i==0) { $mytag = "<".$name." ".$attbvar[$i]."=\"".$attbval[$i]."\""; }
414         if($i>=1) { $mytag = $mytag." ".$attbvar[$i]."=\"".$attbval[$i]."\""; }
415         if($i==$var_num-1) { 
416         if($emptytag===false) { $mytag = $mytag.">"; }
417         if($emptytag===true) { $mytag = $mytag." />"; } }       ++$i; }
418         if($attbvar==null&&$attbval==null) { $mytag = "<".$name;
419         if($emptytag===true) { $mytag = $mytag." />"; }
420         if($emptytag===false) { $mytag = $mytag.">"; } }
421         if($emptytag===false&&$extratest!=null) { 
422         $mytag = $mytag.$extratest; $mytag = $mytag."</".$name.">"; } 
423         return $mytag; }
424 // Start a xml document
425 function xml_tag_make($type,$attbs,$retval=false) {
426         $renee1 = explode("&",$attbs);
427         $reneenum=count($renee1);
428         $reneei=0; $attblist = null;
429         while ($reneei < $reneenum) {
430         $renee2 = explode("=",$renee1[$reneei]);
431         if($renee2[0]!=null||$renee2[1]!=null) {
432         $attblist = $attblist.' '.$renee2[0].'="'.$renee2[1].'"'; }
433         ++$reneei; }
434         if($retval!==false&&$retval!==true) { $retval=false; }
435         if($retval===false) {
436         echo '<?'.$type.$attblist.'?>'."\n"; }
437         if($retval===true) {
438         return '<?'.$type.$attblist.'?>'."\n"; } }
439 // Start a xml document (old version)
440 function xml_doc_start($ver,$encode,$retval=false) {
441         if($retval===false) {
442         echo xml_tag_make('xml','version='.$ver.'&encoding='.$encode,true); }
443         if($retval===true) {
444         return xml_tag_make('xml','version='.$ver.'&encoding='.$encode,true); } }
445 if($_GET['redirect']!="on"&&$_GET['redirect']!="xml"&&$_GET['redirect']!="js") {
446 ?>
447 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
448    "http://www.w3.org/TR/html4/strict.dtd">
449 <html>
450 <head>
451 <?php if(isset($GetFullTitle)) { ?>
452 <title> <?php echo $site_name; ?> - Checking <?php echo $GetFullTitle; ?> </title>
453 <?php } if(!isset($GetFullTitle)) { ?>
454 <title> <?php echo $site_name; ?> </title>
455 <?php } ?>
456 <meta http-equiv="content-language" content="en-US">
457 <?php if(isset($BoardLang)) { ?>
458 <meta http-equiv="content-type" content="text/html; charset=<?php echo $BoardLang; ?>">
459 <?php } if(!isset($BoardLang)) { ?>
460 <meta http-equiv="content-type" content="text/html; charset=iso-8859-15">
461 <?php } ?>
462 <meta name="Generator" content="EditPlus">
463 <meta name="Author" content="Cool Dude 2k">
464 <meta name="Keywords" content="<?php echo $site_name; ?>">
465 <meta name="Description" content="<?php echo $site_name; ?>">
466 <meta name="ROBOTS" content="Index, FOLLOW">
467 <meta name="revisit-after" content="1 days">
468 <meta name="GOOGLEBOT" content="Index, FOLLOW">
469 <meta name="resource-type" content="document">
470 <meta name="distribution" content="global">
471 <link rel="icon" href="favicon.ico" type="image/icon">
472 <link rel="shortcut icon" href="favicon.ico" type="image/icon">
473 <!-- Katarzyna O_o -->
474 </head>
475
476 <body>
477 <!-- Renee Sabonis ^_^ -->
478 <?php }
479 if(!isset($_GET['act'])) { $_GET['act'] = null; }
480 if(!isset($_GET['redirect'])) { $_GET['redirect'] = null; }
481 if(isset($_GET['act'])&&$_GET['act']=="update") {
482 if (function_exists("stream_context_create")) {
483     if($get_content_by=="file_get_contents") {
484        $GetNewVersion = file_get_contents("http://sourceforge.jp/projects/idb/releases/",false,$context); }
485 } else {
486     if($get_content_by=="file_get_contents") {
487        $GetNewVersion = file_get_contents("http://sourceforge.jp/projects/idb/releases/"); }
488 }
489 if($get_content_by=="curl") {
490    $ch = curl_init(); 
491    curl_setopt($ch, CURLOPT_URL, "http://sourceforge.jp/projects/idb/releases/");
492    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: *",
493                                               "User-Agent: ".$site_useragent,
494                                               "Accept: */*",
495                                               "Connection: keep-alive",
496                                               "Referer: ".$agent_site_url,
497                                               "From: ".$agent_site_url,
498                                               "Via: ".$_SERVER['REMOTE_ADDR'],
499                                               "Forwarded: ".$_SERVER['REMOTE_ADDR'],
500                                               "X-Forwarded-For: ".$_SERVER['REMOTE_ADDR'],
501                                               "Client-IP: ".$_SERVER['REMOTE_ADDR']));
502    curl_setopt($ch, CURLOPT_HEADER, 0);
503    curl_setopt($ch, CURLOPT_VERBOSE, 0);
504    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
505    curl_setopt($ch, CURLOPT_USERAGENT, $site_useragent);
506    $GetNewVersion = curl_exec($ch);
507    curl_close($ch); }
508 preg_match_all("/([0-9])\.([0-9])\.([0-9]) ([A-Za-z]+) SVN ([0-9]+)/is", $GetNewVersion, $NewVersionPart);
509 $NewSVNPart = $NewVersionPart[5][0];
510 if (function_exists("stream_context_create")) {
511     if($get_content_by=="file_get_contents") {
512        $GetSVNVersion = file_get_contents("http://sourceforge.net/p/intdb/svn/".$NewSVNPart."/tree/trunk/inc/versioninfo.php?format=raw",false,$context); }
513 } else {
514     if($get_content_by=="file_get_contents") {
515        $GetSVNVersion = file_get_contents("http://sourceforge.net/p/intdb/svn/".$NewSVNPart."/tree/trunk/inc/versioninfo.php?format=raw"); }
516
517 if($get_content_by=="curl") {
518    $ch = curl_init(); 
519    curl_setopt($ch, CURLOPT_URL, "http://sourceforge.net/p/intdb/svn/".$NewSVNPart."/tree/trunk/inc/versioninfo.php?format=raw");
520    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: *",
521                                               "User-Agent: ".$site_useragent,
522                                               "Accept: */*",
523                                               "Connection: keep-alive",
524                                               "Referer: ".$agent_site_url,
525                                               "From: ".$agent_site_url,
526                                               "Via: ".$_SERVER['REMOTE_ADDR'],
527                                               "Forwarded: ".$_SERVER['REMOTE_ADDR'],
528                                               "X-Forwarded-For: ".$_SERVER['REMOTE_ADDR'],
529                                              "Client-IP: ".$_SERVER['REMOTE_ADDR']));
530    curl_setopt($ch, CURLOPT_HEADER, 0);
531    curl_setopt($ch, CURLOPT_VERBOSE, 0);
532    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
533    curl_setopt($ch, CURLOPT_USERAGENT, $site_useragent);
534    $GetNewVersion = curl_exec($ch);
535    curl_close($ch); }
536 $newver['subver'] = $NewSVNPart;
537 $prepreg1 = preg_quote("\$VER1[0] = ","/"); 
538 $prepreg2 = preg_quote(";","/");
539 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $GetSVNVersion, $GetVer0);
540 $GetVer0 = $GetVer0[1][0];
541 $prepreg1 = preg_quote("\$VER1[1] = ","/"); 
542 $prepreg2 = preg_quote(";","/");
543 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $GetSVNVersion, $GetVer1);
544 $GetVer1 = $GetVer1[1][0];
545 $prepreg1 = preg_quote("\$VER1[2] = ","/"); 
546 $prepreg2 = preg_quote(";","/");
547 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $GetSVNVersion, $GetVer2);
548 $GetVer2 = $GetVer2[1][0];
549 $newver['ver'] = $GetVer0.".".$GetVer1.".".$GetVer2;
550 $prepreg1 = preg_quote("\$VER2[0] = \"","/"); 
551 $prepreg2 = preg_quote("\";","/");
552 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $GetSVNVersion, $GetFullVerType);
553 $newver['fullreltype'] = $GetFullVerType[1][0];
554 $prepreg1 = preg_quote("\$VER2[1] = \"","/"); 
555 $prepreg2 = preg_quote("\";","/");
556 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $GetSVNVersion, $GetVerType);
557 $newver['reltype'] = $GetVerType[1][0];
558 $prepreg1 = preg_quote("\$VER2[2] = \"","/"); 
559 $prepreg2 = preg_quote("\";","/");
560 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $GetSVNVersion, $GetVerSubType);
561 $newver['subtype'] = $GetVerSubType[1][0];
562 echo "Sorry need more info to check version.";
563 $VersionXML = xml_doc_start("1.0","UTF-8",true);
564 $VersionXML .= xml_tag_make("xml-stylesheet","type=text/xsl&href=version.xsl",true)."\n";
565 $VersionXML .= "<!DOCTYPE versioninfo [\n";
566 $VersionXML .= "<!ELEMENT versioninfo (version*)>\n";
567 $VersionXML .= "<!ELEMENT version (relname,reltype,reltypename,relnum,subtype,relsvnum,fullrel,fullname)>\n";
568 $VersionXML .= "<!ELEMENT relname (#PCDATA)>\n";
569 $VersionXML .= "<!ELEMENT reltype (#PCDATA)>\n";
570 $VersionXML .= "<!ELEMENT reltypename (#PCDATA)>\n";
571 $VersionXML .= "<!ELEMENT relnum (#PCDATA)>\n";
572 $VersionXML .= "<!ELEMENT subtype (#PCDATA)>\n";
573 $VersionXML .= "<!ELEMENT relsvnum (#PCDATA)>\n";
574 $VersionXML .= "<!ELEMENT fullrel (#PCDATA)>\n";
575 $VersionXML .= "<!ELEMENT fullname (#PCDATA)>\n";
576 $VersionXML .= "]>\n\n";
577 $VersionXML .= "<versioninfo>\n\n";
578 $VersionXML .= "<version>\n";
579 $VersionXML .= "<relname>iDB</relname>\n";
580 $VersionXML .= "<reltype>".$newver['reltype']."</reltype>\n";
581 $VersionXML .= "<reltypename>".$newver['fullreltype']."</reltypename>\n";
582 $VersionXML .= "<relnum>".$newver['ver']."</relnum>\n";
583 $VersionXML .= "<subtype>".$newver['subtype']."</subtype>\n";
584 $VersionXML .= "<relsvnum>".$newver['subver']."</relsvnum>\n";
585 $VersionXML .= "<fullrel>iDB ".$newver['reltype']." ".$newver['ver']."</fullrel>\n";
586 $VersionXML .= "<fullname>iDB ".$newver['reltype']." ".$newver['ver']." ".$newver['subtype']." ".$newver['subver']."</fullname>\n";
587 $VersionXML .= "</version>\n\n";
588 $VersionXML .= "</versioninfo>\n";
589 $fp = fopen("./inc/version.xml","w+");
590 fwrite($fp, $VersionXML);
591 fclose($fp); }
592
593 if($_GET['act']!="update") {
594 $VersionFile = file_get_contents("inc/version.xml");
595 if(!isset($iDBArray)) {
596 $iDBArray = array("iDB"); }
597 $NamePart = explode("|", $_GET['name']);
598 if(count($NamePart)>=5) { 
599 $_GET['name'] = $NamePart[0];
600 if(!isset($_GET['reltype'])&&isset($NamePart[1])) {
601         $_GET['reltype'] = $NamePart[1]; }
602 if(!isset($_GET['ver'])&&isset($NamePart[2])) {
603         $_GET['ver'] = $NamePart[2]; }
604 if(!isset($_GET['subtype'])&&isset($NamePart[3])) {
605         $_GET['subtype'] = $NamePart[3]; }
606 if(!isset($_GET['subver'])&&isset($NamePart[4])) {
607         $_GET['subver'] = $NamePart[4]; } }
608 if(count($NamePart)<5&&count($NamePart)!=1) { 
609 if(!isset($_GET['name'])||!isset($_GET['reltype'])||!isset($_GET['ver'])||
610         !isset($_GET['subtype'])||!isset($_GET['subver'])) {
611         echo "Sorry need more info to check version."; ?>
612
613 <div class="copyright"><br />Powered by <a href="http://idb.berlios.de/" title="iDB-VerCheck <?php echo $site_version; ?>" onclick="window.open(this.href);return false;">iDB VerCheck</a> &copy; <a href="http://idb.berlios.de/support/category.php?act=view&amp;id=2" title="Game Maker 2k" onclick="window.open(this.href);return false;">Game Maker 2k</a> @ <?php echo $csryear." - ".$cryear; ?></div>
614 <!-- Stephanie Braun o_O -->
615 </body>
616 </html>
617 <?php exit(); } }
618 if(!isset($_GET['name'])||!isset($_GET['reltype'])||!isset($_GET['ver'])||
619         !isset($_GET['subtype'])||!isset($_GET['subver'])) {
620         echo "Sorry need more info to check version."; ?>
621 <?php exit(); }
622 if(count($NamePart)==1) { $_GET['name'] = $NamePart[0]; }
623 if(!in_array($_GET['name'],$iDBArray)) { echo "Sorry cound not find ".$_GET['name']."."; ?>
624
625 <div class="copyright"><br />Powered by <a href="http://idb.berlios.de/" title="iDB-VerCheck <?php echo $site_version; ?>" onclick="window.open(this.href);return false;">iDB VerCheck</a> &copy; <a href="http://idb.berlios.de/support/category.php?act=view&amp;id=2" title="Game Maker 2k" onclick="window.open(this.href);return false;">Game Maker 2k</a> @ <?php echo $csryear." - ".$cryear; ?></div>
626 </body>
627 </html>
628 <?php exit(); }
629 $VerSplit = explode(".", $_GET['ver']);
630 if(count($VerSplit)>3||count($VerSplit)<3) { 
631 echo "Sorry version number is not formated right"; exit(); }
632 preg_match_all("/([a-zA-Z]+)([0-9]+)/i", $_GET['reltype'], $reltypeChCk);
633 if(isset($reltypeChCk[0][0])) {
634 $_GET['reltype'] = $reltypeChCk[1][0];
635 $uvercheck['reltypex'] = $reltypeChCk[2][0]; }
636 if(!isset($reltypeChCk[0][0])) {
637 preg_match_all("/([a-zA-Z]+)/i", $_GET['reltype'], $reltypeChCk); 
638 $_GET['reltype'] = $reltypeChCk[1][0];
639 $uvercheck['reltypex'] = "0"; }
640 /*
641 PA (Pre-Alpha) = 100
642 A - Al (Alpha) = 200
643 PB (Pre-Beta) = 300
644 B - Be (Beta) = 400
645 G - Ga (Gamma) = 500
646 D - De (Delta) = 600
647 O - Om (Omega) = 700
648 Z - Ze (Zenith) = 800
649 R - RC (Release Candidate) = 900
650 F - FR (Final Release) = 950
651 */
652 // Pre-Alpha
653 if($_GET['reltype']=="PA") {
654         $uvercheck['reltypenum'] = 100 + $uvercheck['reltypex']; }
655 // Alpha
656 if($_GET['reltype']=="A"||
657         $_GET['reltype']=="Al") {
658         $uvercheck['reltypenum'] = 200 + $uvercheck['reltypex']; }
659 // Pre-Beta
660 if($_GET['reltype']=="PB") {
661         $uvercheck['reltypenum'] = 300 + $uvercheck['reltypex']; }
662 // Beta
663 if($_GET['reltype']=="B"||
664         $_GET['reltype']=="Be") {
665         $uvercheck['reltypenum'] = 400 + $uvercheck['reltypex']; }
666 // Gamma
667 if($_GET['reltype']=="G"||
668         $_GET['reltype']=="Ga") {
669         $uvercheck['reltypenum'] = 500 + $uvercheck['reltypex']; }
670 // Delta
671 if($_GET['reltype']=="D"||
672         $_GET['reltype']=="De") {
673         $uvercheck['reltypenum'] = 600 + $uvercheck['reltypex']; }
674 // Omega
675 if($_GET['reltype']=="O"||
676         $_GET['reltype']=="Om") {
677         $uvercheck['reltypenum'] = 700 + $uvercheck['reltypex']; }
678 // Zenith
679 if($_GET['reltype']=="Z"||
680         $_GET['reltype']=="Ze") {
681         $uvercheck['reltypenum'] = 800 + $uvercheck['reltypex']; }
682 // Release Candidate
683 if($_GET['reltype']=="R"||
684         $_GET['reltype']=="RC") {
685         $uvercheck['reltypenum'] = 900 + $uvercheck['reltypex']; }
686 // Final Release
687 if($_GET['reltype']=="F"||
688         $_GET['reltype']=="FR") {
689         $uvercheck['reltypenum'] = 950 + $uvercheck['reltypex']; }
690 if($uvercheck['reltypex']!=0) {
691         $_GET['reltype'] = $_GET['reltype'].$uvercheck['reltypex']; }
692 $FullRelNum = $VerSplit[0].$VerSplit[1].$VerSplit[2].".".$uvercheck['reltypenum'].$_GET['subver'];
693 $prepreg1 = preg_quote("<version>\n<relname>".$_GET['name']."</relname>","/"); 
694 $prepreg2 = preg_quote("</version>","/");
695 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $VersionFile, $VersionPart);
696 $VersionPart = $VersionPart[0][0];
697 $prepreg1 = preg_quote("<relname>","/"); 
698 $prepreg2 = preg_quote("</relname>","/");
699 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $VersionPart, $NamePart);
700 $vercheck['name'] = $NamePart[1][0];
701 $prepreg1 = preg_quote("<reltype>","/"); 
702 $prepreg2 = preg_quote("</reltype>","/");
703 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $VersionPart, $RelTypePart);
704 $vercheck['reltype'] = $RelTypePart[1][0];
705 preg_match_all("/([a-zA-Z]+)([0-9]+)/i", $vercheck['reltype'], $reltypeChCk);
706 if(isset($reltypeChCk[0][0])) {
707 $vercheck['reltype'] = $reltypeChCk[1][0];
708 $vercheck['reltypex'] = $reltypeChCk[2][0]; }
709 if(!isset($reltypeChCk[0][0])) {
710 preg_match_all("/([a-zA-Z]+)/i", $vercheck['reltype'], $reltypeChCk); 
711 $vercheck['reltype'] = $reltypeChCk[1][0];
712 $vercheck['reltypex'] = "0"; }
713 /*
714 PA (Pre-Alpha) = 100
715 A - Al (Alpha) = 200
716 PB (Pre-Beta) = 300
717 B - Be (Beta) = 400
718 G - Ga (Gamma) = 500
719 D - De (Delta) = 600
720 O - Om (Omega) = 700
721 Z - Ze (Zenith) = 800
722 R - RC (Release Candidate) = 900
723 F - FR (Final Release) = 950
724 */
725 // Pre-Alpha
726 if($vercheck['reltype']=="PA") {
727         $vercheck['reltypenum'] = 100 + $vercheck['reltypex']; }
728 // Alpha
729 if($vercheck['reltype']=="A"||
730         $vercheck['reltype']=="Al") {
731         $vercheck['reltypenum'] = 200 + $vercheck['reltypex']; }
732 // Pre-Beta
733 if($vercheck['reltype']=="PB") {
734         $vercheck['reltypenum'] = 300 + $vercheck['reltypex']; }
735 // Beta
736 if($vercheck['reltype']=="B"||
737         $vercheck['reltype']=="Be") {
738         $vercheck['reltypenum'] = 400 + $vercheck['reltypex']; }
739 // Gamma
740 if($vercheck['reltype']=="G"||
741         $vercheck['reltype']=="Ga") {
742         $vercheck['reltypenum'] = 500 + $vercheck['reltypex']; }
743 // Delta
744 if($vercheck['reltype']=="D"||
745         $vercheck['reltype']=="De") {
746         $vercheck['reltypenum'] = 600 + $vercheck['reltypex']; }
747 // Omega
748 if($vercheck['reltype']=="O"||
749         $vercheck['reltype']=="Om") {
750         $vercheck['reltypenum'] = 700 + $vercheck['reltypex']; }
751 // Zenith
752 if($vercheck['reltype']=="Z"||
753         $vercheck['reltype']=="Ze") {
754         $vercheck['reltypenum'] = 800 + $vercheck['reltypex']; }
755 // Release Candidate
756 if($vercheck['reltype']=="R"||
757         $vercheck['reltype']=="RC") {
758         $vercheck['reltypenum'] = 900 + $vercheck['reltypex']; }
759 // Final Release
760 if($vercheck['reltype']=="F"||
761         $vercheck['reltype']=="FR") {
762         $vercheck['reltypenum'] = 950 + $vercheck['reltypex']; }
763 if($vercheck['reltypex']!=0) {
764         $vercheck['reltype'] = $vercheck['reltype'].$vercheck['reltypex']; }
765 $prepreg1 = preg_quote("<relnum>","/"); 
766 $prepreg2 = preg_quote("</relnum>","/");
767 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $VersionPart, $RelNumPart);
768 $vercheck['ver'] = $RelNumPart[1][0];
769 $MyVerSplit = explode(".", $vercheck['ver']);
770 $prepreg1 = preg_quote("<subtype>","/"); 
771 $prepreg2 = preg_quote("</subtype>","/");
772 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $VersionPart, $SubTypePart);
773 $vercheck['subtype'] = $SubTypePart[1][0];
774 $prepreg1 = preg_quote("<relsvnum>","/"); 
775 $prepreg2 = preg_quote("</relsvnum>","/");
776 preg_match_all("/".$prepreg1."(.*)".$prepreg2."{1}/isU", $VersionPart, $RelSVNumPart);
777 $vercheck['subver'] = $RelSVNumPart[1][0];
778 $MyFullRelNum = $MyVerSplit[0].$MyVerSplit[1].$MyVerSplit[2].".".$vercheck['reltypenum'].$vercheck['subver'];
779 $DownloadLink = "<a href=\"".$download_url."\">".$download_url."</a>";
780 if($_GET['redirect']!="on"&&$_GET['redirect']!="xml"&&$_GET['redirect']!="js") {
781 echo "<div>"; }
782 $actchange = preg_quote("act=versioninfo", '/');
783 $_GET['bid'] = preg_replace("/".$actchange."/i", "act=view", $_GET['bid']);
784 if($_GET['redirect']=="xml") {
785 $VersionXML = xml_doc_start("1.0","UTF-8",true);
786 $VersionXML .= "<!DOCTYPE versioninfo [\n";
787 $VersionXML .= "<!ELEMENT versioninfo (version*)>\n";
788 $VersionXML .= "<!ELEMENT version (reltype,relnum,subtype,relsvnum,results)>\n";
789 $VersionXML .= "<!ELEMENT reltype (#PCDATA)>\n";
790 $VersionXML .= "<!ELEMENT relnum (#PCDATA)>\n";
791 $VersionXML .= "<!ELEMENT subtype (#PCDATA)>\n";
792 $VersionXML .= "<!ELEMENT relsvnum (#PCDATA)>\n";
793 $VersionXML .= "<!ELEMENT results (#PCDATA)>\n";
794 $VersionXML .= "<!ENTITY nbsp \" \">\n";
795 $VersionXML .= "]>\n\n";
796 $VersionXML .= "<versioninfo>\n\n";
797 $VersionXML .= "<version>\n";
798 $VersionXML .= "<reltype>".$vercheck['reltype']."</reltype>\n";
799 $VersionXML .= "<relnum>".$vercheck['ver']."</relnum>\n";
800 $VersionXML .= "<subtype>".$vercheck['subtype']."</subtype>\n";
801 $VersionXML .= "<relsvnum>".$vercheck['subver']."</relsvnum>\n";
802 if($FullRelNum<$MyFullRelNum) {
803 $VersionXML .= "<results><![CDATA[\n<img src=\"".$site_url."inc/pics/old.png\" alt=\"You seem to be using a old version.\" title=\"You seem to be using a old version.\" />&nbsp;Warning: A new version is available. <a href=\"".$download_url."\">Click Here</a>\n]]></results>\n"; }
804 if($FullRelNum==$MyFullRelNum) {
805 $VersionXML .= "<results><![CDATA[\n<img src=\"".$site_url."inc/pics/new.png\" alt=\"Congratulations you have the newest version. ^_^ \" title=\"Congratulations you have the newest version. ^_^ \" />&nbsp;Congratulates: You have the latest version.\n]]></results>\n"; }
806 if($FullRelNum>$MyFullRelNum) {
807 $VersionXML .= "<results><![CDATA[\n<img src=\"".$site_url."inc/pics/beta.png\" alt=\"You seem to be using a nightly version.\" title=\"You seem to be using a nightly version.\" />&nbsp;Warning: You seem to be using a nightly version. <a href=\"".$download_url."\">Click Here</a> for latest version.\n]]></results>\n"; }
808 $VersionXML .= "</version>\n\n";
809 $VersionXML .= "</versioninfo>"; 
810 echo $VersionXML; }
811 if($_GET['redirect']=="js") {
812 $VersionJS = "function idbvercheck() \n{ \n";
813 $VersionJS .= "document.getElementById('iverinfo').style.display = '';\n";
814 $VersionJS .= "var vercheckinfo = 'Version Check info below: <br />';\n";
815 $VersionJS .= "var yourverinfo = 'Your Version: ".$_GET['name']." ".$_GET['reltype']." ".$_GET['ver']." ".$_GET['subtype']." ".$_GET['subver']."';\n";
816 $VersionJS .= "var myverinfo = 'Current Version: ".$vercheck['name']." ".$vercheck['reltype']." ".$vercheck['ver']." ".$vercheck['subtype']." ".$vercheck['subver']."<br />';\n";
817 $VersionJS .= "var ourverinfo = yourverinfo+'<br />'+myverinfo;\n";
818 if($_GET['bid']!==null) {
819 $VersionJS .= "var checkingsite = 'Checking board: <a href=\"".$_GET['bid']."\" title=\"".$GetTitle."\">".$GetTitle."<\/a><br />';\n"; }
820 if($_GET['bid']===null) {
821 $VersionJS .= "var checkingsite = '';\n"; }
822 $VersionJS .= "var copyright = '<br \/>Powered by <a href=\"http://idb.berlios.de/\" title=\"iDB-VerCheck ".$site_version."\" onclick=\"window.open(this.href);return false;\">iDB VerCheck</a> &#169; <a href=\"http://idb.berlios.de/support/category.php?act=view&amp;id=2\" title=\"Game Maker 2k\" onclick=\"window.open(this.href);return false;\">Game Maker 2k<\/a> @ ".$csryear." - ".$cryear."';\n";
823 if($FullRelNum<$MyFullRelNum) {
824 $VersionJS .= "document.getElementById('iverinfo').innerHTML = vercheckinfo+'<img src=\"".$site_url."inc/pics/old.png\" alt=\"You seem to be using a old version.\" title=\"You seem to be using a old version.\" />&#160;Warning: A new version is available. <a href=\"".$download_url."\">Click Here<\/a><br />'+ourverinfo+checkingsite+'<br />';"; }
825 if($FullRelNum==$MyFullRelNum) {
826 $VersionJS .= "document.getElementById('iverinfo').innerHTML = vercheckinfo+'<img src=\"".$site_url."inc/pics/new.png\" alt=\"Congratulations you have the newest version. ^_^ \" title=\"Congratulations you have the newest version. ^_^ \" />&#160;Congratulates: You have the latest version.<br />'+ourverinfo+checkingsite+copyright+'<br />';"; }
827 if($FullRelNum>$MyFullRelNum) {
828 $VersionJS .= "document.getElementById('iverinfo').innerHTML = vercheckinfo+'<img src=\"".$site_url."inc/pics/beta.png\" alt=\"You seem to be using a nightly version.\" title=\"You seem to be using a nightly version.\" \/>&#160;Warning: You seem to be using a nightly version. <br /><a href=\"".$download_url."\">Click Here</a> for latest version.<br \/>'+ourverinfo+checkingsite+copyright+'<br />';"; }
829 $VersionJS .= "\n} ";
830 echo $VersionJS; }
831 if($_GET['redirect']=="on") { 
832 if($FullRelNum<$MyFullRelNum) {
833 redirect("location","old.png",FALSE,$site_url."inc/pics/",FALSE); }
834 if($FullRelNum==$MyFullRelNum) {
835 redirect("location","new.png",FALSE,$site_url."inc/pics/",FALSE); }
836 if($FullRelNum>$MyFullRelNum) {
837 redirect("location","beta.png",FALSE,$site_url."inc/pics/",FALSE); } }
838 if($_GET['redirect']!="on"&&$_GET['redirect']!="xml"&&$_GET['redirect']!="js") {
839 if($FullRelNum<$MyFullRelNum) { echo "You seem to be using a old version.\n<br />Goto link below to download new version.\n<br />".$DownloadLink; }
840 if($FullRelNum==$MyFullRelNum) { echo "Congratulations you have the newest version. ^_^ \n<br />You dont need to do anything for now."; }
841 if($FullRelNum>$MyFullRelNum) { echo "You seem to be using a nightly version.\n<br />Rember these version are not as stable as the Current Version.\n<br />"; 
842 echo "Goto link below to download latest version.\n<br />".$DownloadLink; }
843 echo "\n<br />\n<br />";
844 echo "Your Version: ".$_GET['name']." ".$_GET['reltype']." ".$_GET['ver']." ".$_GET['subtype']." ".$_GET['subver'];
845 echo "\n<br />";
846 echo "Current Version: ".$vercheck['name']." ".$vercheck['reltype']." ".$vercheck['ver']." ".$vercheck['subtype']." ".$vercheck['subver'];
847 if($_GET['bid']!=null) {
848 echo "\n<br />Checking board: <a href=\"".$_GET['bid']."\" title=\"".$GetTitle."\">".$GetTitle."</a>"; }
849 echo "</div>"; } }
850 if($_GET['redirect']!="on"&&$_GET['redirect']!="xml"&&$_GET['redirect']!="js") {
851 ?>
852
853 <div class="copyright"><br />Powered by <a href="http://idb.berlios.de/" title="iDB-VerCheck <?php echo $site_version; ?>" onclick="window.open(this.href);return false;">iDB VerCheck</a> &copy; <a href="http://idb.berlios.de/support/category.php?act=view&amp;id=2" title="Game Maker 2k" onclick="window.open(this.href);return false;">Game Maker 2k</a> @ <?php echo $csryear." - ".$cryear; ?></div>
854 <!-- Stephanie Braun o_O -->
855 </body>
856 </html>
857 <?php } ?>