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
+	if(uLEVEL > 1) accessDenied( );
24
+	$do = $_GET["do"];
25
+	if(isset($_GET["unlock"]) && isNumber($_GET['unlock'])) {
26
+		$output .= "<div id=\"pagetitle\">"._UNLOCK."</div>";
27
+		if($_GET["confirm"] == "yes")
28
+		{
29
+			dbquery("UPDATE ".TABLEPREFIX."fanfiction_authors SET level = '0' WHERE uid = '".$_GET['unlock']."'");
30
+			$output .= "<center>"._ACTIONSUCCESSFUL."</center>";
31
+		}
32
+		else if ($_GET["confirm"] == "no")
33
+		{
34
+			$output .= "<center>"._ACTIONCANCELLED."</center>";
35
+		}
36
+		else
37
+		{
38
+			$output .= "<div id=\"pagetitle\">"._CONFIRMUNLOCK."</div>";
39
+			$output .= "<center>[ <a href=\"admin.php?action=lock&confirm=yes&unlock=".$_GET['unlock']."\">"._YES."</a> | <a href=\"admin.php?action=lock&confirm=no&unlock=".$_GET['unlock']."\">"._NO."</a> ]</center>";
40
+		}
41
+	
42
+	}
43
+
44
+	else if(isset($do)) {
45
+	
46
+		if($_POST['submit'] && isNumber($_POST['uid'])) {
47
+			dbquery("UPDATE ".TABLEPREFIX."fanfiction_authors SET level = '-1' WHERE uid = '".$_POST['uid']."'");
48
+			
49
+			$output .= "<center>"._BACK2ADMIN."</center>";
50
+			return $output;
51
+		}
52
+
53
+		$action = $_GET['action'];
54
+		if(isset($_GET["uid"])) $uid = $_GET["uid"];
55
+		else $uid = $_POST["uid"];
56
+		if(!isNumber($uid)) $uid = 0;
57
+		$output .= "<div id=\"pagetitle\">"._MEMLOCK."</div><form method=\"POST\" name=\"form\" enctype=\"multipart/form-data\" action=\"/admin.php?action=lock&do=$do\">";
58
+		$output .= "<table align=\"center\" width=\"250\" class=\"tblborder\"><tr><td><label for=\"uid\">"._PENNAME.": </label>";
59
+			$query = dbquery("SELECT penname, uid FROM ".TABLEPREFIX."fanfiction_authors WHERE level = '0' ORDER BY penname");
60
+			$output .= "<select name=\"uid\">";
61
+			while($users = dbassoc($query)) {
62
+				$output .= "<option value=\"".$users['uid']."\"".($_GET['uid'] == $users['uid'] ? " selected" : "").">".$users['penname']."</option>";
63
+			}	
64
+		
65
+			$output .= "</select></td></tr><tr align\"center\"><td colspan=\"2\">
66
+			<INPUT type=\"submit\" class=\"button\" value=\""._SUBMIT."\" name=\"submit\">
67
+			</form></td></tr></table>";	
68
+	}
69
+	
70
+	else {
71
+
72
+		if($let == _OTHER) $letter= _PENNAMEFIELD." REGEXP '^[^a-z]'";
73
+		else $letter .= _PENNAMEFIELD." LIKE '".$_GET['let']."%'";
74
+		$output .= "<div class='sectionheader'>"._MEMLOCK."</div>";
75
+		$pagelink = "<a href=\"admin.php?action=lock&let=";
76
+		$countquery = "SELECT count("._UIDFIELD.") FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE ap.level = -1";
77
+		$authorquery = "SELECT "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid, count(stories.uid) as stories FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_stories as stories ON ("._UIDFIELD." = stories.uid) AND "._UIDFIELD." > 0 AND stories.validated > 0 LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE ap.level = -1 GROUP BY "._UIDFIELD;
78
+		include("includes/members_list.php");
79
+
80
+	
81
+		$output .= "<div class=\"respond\"><a href=\"admin.php?action=lock&do=new\">"._LOCKNEW."</a></div>";
82
+	}
83
+
84
+?>
0 85
\ No newline at end of file