Browse code

Initial uplad w/ php7 fixes

Rainer Volkrodt authored on 2016/03/12 15:54:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,87 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+
30
+	$output .= "<div id=\"pagetitle\">"._VERSIONCHECK."</div>";
31
+
32
+	// make sure curl is installed
33
+	if (function_exists('curl_init')) {
34
+		$output .= write_message(_RUNNINGVERSION);
35
+	   // initialize a new curl resource
36
+	   $ch = curl_init();
37
+
38
+	   // set the url to fetch
39
+	   curl_setopt($ch, CURLOPT_URL, 'http://www.efiction.org/version.txt');
40
+
41
+	   // don't give me the headers just the content
42
+	   curl_setopt($ch, CURLOPT_HEADER, 0);
43
+
44
+	   // return the value instead of printing the response to browser
45
+	   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
46
+
47
+	   // use a user agent to mimic a browser
48
+	   curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0');
49
+
50
+	   $content = curl_exec($ch);
51
+	   $currentversion = $content;
52
+				$output .= write_message(_CURRENTVERSION. "$currentversion");
53
+
54
+				if ($currentversion != $version) {
55
+				$output .= write_message (_UPDATEVERSION);
56
+				}
57
+				else $output .= write_message (_UPTODATE);
58
+
59
+	   // remember to always close the session and free all resources
60
+	   curl_close($ch);
61
+	}
62
+
63
+	else if(ini_get("allow_url_fopen")) {
64
+		$output .= write_message(_RUNNINGVERSION);
65
+
66
+		$location = fopen ("http://efiction.org/version.txt", "r");
67
+		$buffer = '';
68
+		while (!feof ($location)) {
69
+			$buffer .= fgets($location, 4096);
70
+		}
71
+		fclose ($location);
72
+
73
+		if ($buffer != '') {
74
+			$currentversion = $buffer;
75
+			$output .= write_message(_CURRENTVERSION. "$currentversion");
76
+
77
+			if ($currentversion != $version) {
78
+			$output .= write_message (_UPDATEVERSION);
79
+			}
80
+			else $output .= write_message (_UPTODATE);
81
+		}
82
+	}
83
+	else {	
84
+		$output .= write_message(_VERSIONNOTALLOWED);
85
+	}
86
+
87
+?>
0 88
\ No newline at end of file