OSDN Git Service

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