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,84 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// Copyright (c) 2007 by Tammy Keefer
4
+// Based on eFiction 1.1
5
+// Copyright (C) 2003 by Rebecca Smallwood.
6
+// http://efiction.sourceforge.net/
7
+// ----------------------------------------------------------------------
8
+// LICENSE
9
+//
10
+// This program is free software; you can redistribute it and/or
11
+// modify it under the terms of the GNU General Public License (GPL)
12
+// as published by the Free Software Foundation; either version 2
13
+// of the License, or (at your option) any later version.
14
+//
15
+// This program is distributed in the hope that it will be useful,
16
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+// GNU General Public License for more details.
19
+//
20
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
21
+// ----------------------------------------------------------------------
22
+
23
+$current = "adminarea";
24
+
25
+if(isset($_GET['action']) && ($_GET['action'] == "categories" || $_GET['action'] == "admins")) $displayform = 1;
26
+
27
+$disableTiny = true;
28
+
29
+include ("header.php");
30
+
31
+//make a new TemplatePower object
32
+if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
33
+else $tpl = new TemplatePower("default_tpls/default.tpl");
34
+include("includes/pagesetup.php");
35
+if(file_exists("languages/".$language."_admin.php")) include_once("languages/".$language."_admin.php");
36
+else include_once("languages/en_admin.php");
37
+// end basic page setup
38
+
39
+// check that user has permissions to perform this action before going further.  Otherwise kick 'em
40
+	if(!isADMIN) accessDenied( );
41
+	$adminquery = dbquery("SELECT categories FROM ".TABLEPREFIX."fanfiction_authorprefs WHERE uid = '".USERUID."' LIMIT 1");
42
+	list($admincats) = dbrow($adminquery);
43
+	if(empty($admincats)) $admincats = "0";
44
+	$output = "<div style='text-align: center; margin: 1em;'>";
45
+	$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden != '1' AND panel_type = 'A' AND panel_level >= ".uLEVEL." ORDER BY panel_level DESC, panel_order ASC, panel_title ASC");
46
+	if(!dbnumrows($panelquery)) $output .= _FATALERROR;
47
+	$panellist = array();
48
+	while($panel = dbassoc($panelquery)) {
49
+		if(!$panel['panel_url']) $panellist[$panel['panel_level']][]= "<a href=\"admin.php?action=".$panel['panel_name']."\">".$panel['panel_title']."</a>";
50
+		else $panellist[$panel['panel_level']][] = "<a href=\"".$panel['panel_url']."\">".$panel['panel_title']."</a>";
51
+	}
52
+	foreach($panellist as $accesslevel => $row) {
53
+		$output .= implode(" | ", $row)."<br />";
54
+	}
55
+	$output .= "</div>\n";
56
+	if($action) {
57
+		$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_name = '$action' AND panel_type = 'A' LIMIT 1");
58
+		if(dbnumrows($panelquery)) {
59
+			$panel = dbassoc($panelquery);
60
+			if((isset($panel['panel_level']) ? $panel['panel_level'] : 0) >= uLEVEL) {
61
+				if($panel['panel_url'] && file_exists(_BASEDIR.$panel['panel_url'])) require_once(_BASEDIR.$panel['panel_url']);
62
+				else if (file_exists("admin/{$action}.php")) require_once("admin/{$action}.php");
63
+			}
64
+			else accessDenied( );
65
+		}
66
+	}
67
+	else {
68
+		if (file_exists("install"))
69
+			$output .= write_error(_SECURITYDELETE);
70
+		$adminnotices = "";
71
+		$countquery = dbquery("SELECT COUNT(DISTINCT chapid) FROM ".TABLEPREFIX."fanfiction_chapters WHERE validated < 1");
72
+		list($count) = dbrow($countquery);
73
+		if($count) $adminnotices .= write_message(sprintf(_QUEUECOUNT, $count));
74
+		$codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'adminnotices'");
75
+		while($code = dbassoc($codequery)) {
76
+			eval($code['code_text']);
77
+		}
78
+		$output .= write_message($adminnotices);
79
+		$output .= write_message(_RUNNINGVERSION);
80
+	}	
81
+	$tpl->assign( "output", $output );
82
+	$tpl->printToScreen();
83
+	dbclose( );
84
+?>
0 85
\ No newline at end of file