| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,91 @@ |
| 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 |
+ |
|
| 32 |
+ |
|
| 33 |
+//make a new TemplatePower object |
|
| 34 |
+if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
|
|
| 35 |
+else $tpl = new TemplatePower("default_tpls/default.tpl");
|
|
| 36 |
+include("includes/pagesetup.php");
|
|
| 37 |
+if(file_exists("languages/".$language."_admin.php")) include_once("languages/".$language."_admin.php");
|
|
| 38 |
+else include_once("languages/en_admin.php");
|
|
| 39 |
+// end basic page setup |
|
| 40 |
+ |
|
| 41 |
+// check that user has permissions to perform this action before going further. Otherwise kick 'em |
|
| 42 |
+ if(!isADMIN) accessDenied( ); |
|
| 43 |
+ $adminquery = dbquery("SELECT categories FROM ".TABLEPREFIX."fanfiction_authorprefs WHERE uid = '".USERUID."' LIMIT 1");
|
|
| 44 |
+ list($admincats) = dbrow($adminquery); |
|
| 45 |
+ if(empty($admincats)) $admincats = "0"; |
|
| 46 |
+ $output = "<div style='text-align: center; margin: 1em;'>"; |
|
| 47 |
+ $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");
|
|
| 48 |
+ if(!dbnumrows($panelquery)) $output .= _FATALERROR; |
|
| 49 |
+ $panellist = array(); |
|
| 50 |
+ while($panel = dbassoc($panelquery)) {
|
|
| 51 |
+ if(!$panel['panel_url']) $panellist[$panel['panel_level']][]= "<a href=\"admin.php?action=".$panel['panel_name']."\">".$panel['panel_title']."</a>"; |
|
| 52 |
+ else $panellist[$panel['panel_level']][] = "<a href=\"".$panel['panel_url']."\">".$panel['panel_title']."</a>"; |
|
| 53 |
+ } |
|
| 54 |
+ foreach($panellist as $accesslevel => $row) {
|
|
| 55 |
+ $output .= implode(" | ", $row)."<br />";
|
|
| 56 |
+ } |
|
| 57 |
+ $output .= "</div>\n"; |
|
| 58 |
+ if($action) {
|
|
| 59 |
+ $panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_name = '$action' AND panel_type = 'A' LIMIT 1");
|
|
| 60 |
+ if(dbnumrows($panelquery)) {
|
|
| 61 |
+ $panel = dbassoc($panelquery); |
|
| 62 |
+ if((isset($panel['panel_level']) ? $panel['panel_level'] : 0) >= uLEVEL) {
|
|
| 63 |
+ if($panel['panel_url'] && file_exists(_BASEDIR.$panel['panel_url'])) require_once(_BASEDIR.$panel['panel_url']); |
|
| 64 |
+ else if (file_exists("admin/{$action}.php")) require_once("admin/{$action}.php");
|
|
| 65 |
+ } |
|
| 66 |
+ else accessDenied( ); |
|
| 67 |
+ } |
|
| 68 |
+ } |
|
| 69 |
+ else {
|
|
| 70 |
+ if (file_exists("install"))
|
|
| 71 |
+ $output .= write_error(_SECURITYDELETE); |
|
| 72 |
+ $adminnotices = ""; |
|
| 73 |
+ $countquery = dbquery("SELECT COUNT(DISTINCT chapid) FROM ".TABLEPREFIX."fanfiction_chapters WHERE validated < 1");
|
|
| 74 |
+ list($count) = dbrow($countquery); |
|
| 75 |
+ if($count) $adminnotices .= write_message(sprintf(_QUEUECOUNT, $count)); |
|
| 76 |
+ $codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'adminnotices'");
|
|
| 77 |
+ while($code = dbassoc($codequery)) {
|
|
| 78 |
+ eval($code['code_text']); |
|
| 79 |
+ } |
|
| 80 |
+ |
|
| 81 |
+ $output .= write_message("Actual time: ". time() );
|
|
| 82 |
+ $output .= write_message("Date format: " . $dateformat);
|
|
| 83 |
+ $output .= write_message(date("$dateformat", time()));
|
|
| 84 |
+ |
|
| 85 |
+ $output .= write_message($adminnotices); |
|
| 86 |
+ $output .= write_message(_RUNNINGVERSION); |
|
| 87 |
+ } |
|
| 88 |
+ $tpl->assign( "output", $output ); |
|
| 89 |
+ $tpl->printToScreen(); |
|
| 90 |
+ dbclose( ); |
|
| 91 |
+?> |
|
| 0 | 92 |
\ No newline at end of file |