Browse code

3.5.6 efiction version

Jimako authored on 2024/03/09 16:09:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,58 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// Copyright (c) 2007 by Tammy Keefer
4
+// Valid HTML 4.01 Transitional
5
+// Based on eFiction 1.1
6
+// Copyright (C) 2003 by Rebecca Smallwood.
7
+// http://efiction.sourceforge.net/
8
+// ----------------------------------------------------------------------
9
+// LICENSE
10
+//
11
+// This program is free software; you can redistribute it and/or
12
+// modify it under the terms of the GNU General Public License (GPL)
13
+// as published by the Free Software Foundation; either version 2
14
+// of the License, or (at your option) any later version.
15
+//
16
+// This program is distributed in the hope that it will be useful,
17
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
+// GNU General Public License for more details.
20
+//
21
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
22
+// ----------------------------------------------------------------------
23
+
24
+$current = "betareader";
25
+include ("../../header.php");
26
+
27
+//make a new TemplatePower object
28
+if(file_exists( "$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl" );
29
+else $tpl = new TemplatePower(_BASEDIR."default_tpls/default.tpl");
30
+$tpl->assignInclude( "header", "$skindir/header.tpl" );
31
+$tpl->assignInclude( "footer", "$skindir/footer.tpl" );
32
+include(_BASEDIR."includes/pagesetup.php");
33
+if(file_exists(_BASEDIR."languages/".$language."_admin.php")) include_once(_BASEDIR."languages/".$language."_admin.php");
34
+else include_once(_BASEDIR."languages/en_admin.php");
35
+if(file_exists(_BASEDIR."languages/".$language.".php")) include_once(_BASEDIR."languages/".$language.".php");
36
+else include_once(_BASEDIR."languages/en.php");
37
+if(!isADMIN) accessDenied( );
38
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
39
+include("version.php");
40
+list($currentVersion) = dbrow(dbquery("SELECT version FROM ".TABLEPREFIX."fanfiction_modules WHERE name = '$moduleName' LIMIT 1"));
41
+$installed = dbnumrows(dbquery("SELECT COUNT(code_module) FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_module = 'betareader'"));
42
+if(empty($currentVersion) || $currentVersion < "1.4" || !$installed) {
43
+if($confirm == "yes") {
44
+	dbquery("UPDATE ".TABLEPREFIX."fanfiction_modules SET version = '1.4' WHERE name = '$moduleName' LIMIT 1");
45
+	if($currentVersion < "1.2") dbquery("INSERT INTO `".TABLEPREFIX."fanfiction_codeblocks` (`code_text`, `code_type`, `code_module`) VALUES ( 'include(_BASEDIR.\"modules/betareader/stats.php\");', 'sitestats', 'betareader');");
46
+	$output = write_message(_ACTIONSUCCESSFUL);
47
+}
48
+else if($confirm == "no") {
49
+	$output = write_message(_ACTIONCANCELLED);
50
+}
51
+else {
52
+	$output = write_message(_CONFIRMUPDATE."<br /><a href='update.php?confirm=yes'>"._YES."</a> "._OR." <a href='update.php?confirm=no'>"._NO."</a>");
53
+}
54
+}
55
+else $output .= write_message(_ALREADYUPDATED);
56
+$tpl->assign("output", $output);
57
+$tpl->printToScreen( );
58
+?>
0 59
\ No newline at end of file