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,90 @@
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
+if($_GET['action'] == "list") {
25
+	$current = "members";
26
+	$list = "members";
27
+}
28
+else if($_GET["list"] == "authors") $current = "authors";
29
+else $current = "members";
30
+
31
+include ("header.php");
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
+
38
+// end basic page setup
39
+
40
+$pagetitle = "<div id=\"pagetitle\">";
41
+if(isset($_GET['list'])) $list = $_GET['list'];
42
+else $list = "members";
43
+if(!$let) {
44
+	$let = false;
45
+	$ptitle = "</div>";
46
+}
47
+else {
48
+	$ptitle = " -- $let</div>";
49
+	if($let == _OTHER) {
50
+		$letter = _PENNAMEFIELD." REGEXP '^[^a-z]'";
51
+	}
52
+	else{
53
+		$letter = _PENNAMEFIELD." LIKE '$let%'";
54
+	}
55
+}
56
+
57
+$listOpts = ""; $countquery = "";
58
+	if($list == "authors") {
59
+		$pagetitle .= _AUTHORS;
60
+		$authorquery = "SELECT "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid, ap.stories FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE ap.stories > 0 ".(isset($letter) ? " AND $letter" : "")." GROUP BY "._UIDFIELD;
61
+		$countquery = "SELECT count("._UIDFIELD.") FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON "._UIDFIELD." = ap.uid WHERE ap.stories > 0 ".(isset($letter) ? " AND $letter" : "");
62
+	}
63
+	else if($list == "admins") {
64
+		$pagetitle .= _SITEADMINS;
65
+		$countquery = _MEMBERCOUNT." WHERE ap.level > 0 AND ap.level < 4".(isset($letter) ? " AND $letter" : "");
66
+		$authorquery = _MEMBERLIST." WHERE ap.level > 0 AND ap.level < 4".(isset($letter) ? " AND $letter" : "")." GROUP BY "._UIDFIELD;
67
+	}
68
+	$codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'membersList'");
69
+	while($code = dbassoc($codequery)) {
70
+		eval($code['code_text']);
71
+	}
72
+	if(empty($countquery)) {
73
+		$pagetitle .= _MEMBERS;
74
+		$countquery = _MEMBERCOUNT.(isset($letter) ? " WHERE $letter" : "");
75
+		$authorquery = _MEMBERLIST.(isset($letter) ? " WHERE $letter" : "")." GROUP BY "._UIDFIELD;
76
+	}
77
+
78
+	$output .= $pagetitle.$ptitle;
79
+	$output .= "<div style=\"text-align: center;\"><form name=\"list\" action=\"\"><select name=\"list\" onchange=\"if(this.selectedIndex.value != 'false') document.location = document.list.list.options[document.list.list.selectedIndex].value\">";
80
+	$output .= "<option value=\"authors.php?".($let ? "let=$let&amp;" : "")."list=members\"".(empty($list) || $list == "members" ? " selected" : "").">"._ALLMEMBERS."</option>
81
+		<option value=\"authors.php?".($let ? "let=$let&amp;" : "")."list=authors\"".($list == "authors" ? " selected" : "").">"._AUTHORS."</option>
82
+		<option value=\"authors.php?".($let ? "let=$let&amp;" : "")."list=admins\"".($list == "admins" ? " selected" : "").">"._SITEADMINS."</option>$listOpts
83
+		</select></form></div>";
84
+	$pagelink="authors.php?list=".($list ? $list : "members")."&amp;".($let ? "let=$let&amp;" : "");
85
+	include("includes/members_list.php");
86
+
87
+	$tpl->assign( "output", $output );
88
+	$tpl->printToScreen();
89
+	dbclose( );
90
+?>
0 91
\ No newline at end of file