Browse code

forgotten date changes

Jimako authored on 2024/06/21 02:05:54
Showing 1 changed files
... ...
@@ -166,7 +166,7 @@ $confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
166 166
 		}
167 167
 		else if (isset($_POST['submit'])) {
168 168
 			if(preg_match("!^[a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
169
-				dbquery("INSERT INTO ".substr(_AUTHORTABLE, 0, strpos(_AUTHORTABLE, "as author"))."(penname, realname, email, admincreated, date) VALUES ('".escapestring(descript($_POST['penname']))."', '".escapestring(descript($_POST['realname']))."', '".escapestring(descript($_POST['email']))."', '1', now())");
169
+				dbquery("INSERT INTO ".substr(_AUTHORTABLE, 0, strpos(_AUTHORTABLE, "as author"))."(penname, realname, email, admincreated, date) VALUES ('".escapestring(descript($_POST['penname']))."', '".escapestring(descript($_POST['realname']))."', '".escapestring(descript($_POST['email']))."', '1', '" . time() . "')");
170 170
 				$newuid = dbinsertid( );
171 171
 				if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_ADMIN_REG, descript($_POST['penname']), $newuid, USERPENNAME, USERUID, $_SERVER['REMOTE_ADDR']))."', '".USERUID. "', INET6_ATON('".$_SERVER['REMOTE_ADDR']."'), 'RG', " . time() . ")");
172 172
 				if(!$skin) {
Browse code

version 3.5.7

Jimako authored on 2024/04/08 12:21:57
Showing 1 changed files
... ...
@@ -168,7 +168,7 @@ $confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
168 168
 			if(preg_match("!^[a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
169 169
 				dbquery("INSERT INTO ".substr(_AUTHORTABLE, 0, strpos(_AUTHORTABLE, "as author"))."(penname, realname, email, admincreated, date) VALUES ('".escapestring(descript($_POST['penname']))."', '".escapestring(descript($_POST['realname']))."', '".escapestring(descript($_POST['email']))."', '1', now())");
170 170
 				$newuid = dbinsertid( );
171
-				if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_ADMIN_REG, descript($_POST['penname']), $newuid, USERPENNAME, USERUID, $_SERVER['REMOTE_ADDR']))."', '".USERUID."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'RG', " . time() . ")");
171
+				if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_ADMIN_REG, descript($_POST['penname']), $newuid, USERPENNAME, USERUID, $_SERVER['REMOTE_ADDR']))."', '".USERUID. "', INET6_ATON('".$_SERVER['REMOTE_ADDR']."'), 'RG', " . time() . ")");
172 172
 				if(!$skin) {
173 173
 					$skinquery = dbquery("SELECT skin FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
174 174
 					list($skin) = dbrow($skinquery);
... ...
@@ -269,4 +269,4 @@ $confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
269 269
 		else $output .= write_message("<a href=\"admin.php?action=members&do=add\">"._ADDAUTHOR."</a>");
270 270
 		if(isset($message)) $output .= $message;
271 271
 	}
272
-?>
273 272
\ No newline at end of file
273
+?>
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,272 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+function random_char($string)
29
+{
30
+	$length = strlen($string);
31
+	$position = mt_rand(0, $length - 1);
32
+	return($string[$position]);
33
+}
34
+
35
+function random_string ($charset_string, $length)
36
+{
37
+	$return_string = random_char($charset_string);
38
+	for ($x = 1; $x < $length; $x++)
39
+	$return_string .= random_char($charset_string);
40
+	return($return_string);
41
+}
42
+
43
+unset($countquery, $authorquery);
44
+$confirm = isset($_GET['confirm']) ? $_GET['confirm'] : false;
45
+	if(isset($_GET['lock']) && isNumber($_GET['lock'])) {
46
+		$output .= "<div class='sectionheader'>"._LOCKMEM."</div>";
47
+		if($confirm == "yes") {
48
+			if(check_prefs($_GET['lock'])) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET level = '-1' WHERE uid = '".$_GET['lock']."'");
49
+			else dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(`uid`, `level`) VALUES('".$_GET['lock']."', '-1')");
50
+			$output .= write_message(_ACTIONSUCCESSFUL);
51
+		}
52
+		else if ($confirm == "no") {
53
+			$output .= write_message(_ACTIONCANCELLED);
54
+		}
55
+		else {
56
+			$output .= write_message(_LOCKCONFIRM."<br /><br />
57
+						[ <a href=\"admin.php?action=members&confirm=yes&lock=".$_GET['lock']."\">"._YES."</a> | <a href=\"admin.php?action=members&confirm=no&lock=".$_GET['lock']."\">"._NO."</a> ]");
58
+		}
59
+	}
60
+	else if(isset($_GET["unlock"]) && isNumber($_GET["unlock"])) {
61
+		$output .= "<div class='sectionheader'>"._UNLOCK."</div>";
62
+		if($confirm == "yes")
63
+		{
64
+			dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET level = '0' WHERE uid = '".$_GET['unlock']."'");
65
+			$output .= write_message(_ACTIONSUCCESSFUL);
66
+		}
67
+		else if ($confirm == "no")
68
+		{
69
+			$output .= write_message(_ACTIONCANCELLED);
70
+		}
71
+		else
72
+		{
73
+			$output .= write_message(_CONFIRMUNLOCK."<br /><br />
74
+						[ <a href=\"admin.php?action=members&confirm=yes&unlock=".$_GET['unlock']."\">"._YES."</a> | <a href=\"admin.php?action=members&confirm=no&unlock=".$_GET['unlock']."\">"._NO."</a> ]");
75
+		}
76
+	
77
+	}
78
+	else if(isset($_GET["release"]) && isNumber($_GET['release'])) {
79
+		$output .= "<div class='sectionheader'>"._RELEASED."</div>";
80
+		if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") $output .= write_message("<br />"._FOREIGNAUTHORTABLE);
81
+		if($confirm == "yes")
82
+		{
83
+			include("includes/emailer.php");
84
+			dbquery("UPDATE "._AUTHORTABLE." SET admincreated = '0' WHERE "._UIDFIELD." = '".$_GET['release']."'");
85
+			$emailquery = dbquery("SELECT "._EMAILFIELD." as email, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." WHERE uid = '".$_GET['release']."'");
86
+			$email = dbassoc($emailquery);
87
+			mt_srand((double)microtime() * 1000000);
88
+			$charset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ';
89
+			$pass = random_string($charset, 10);
90
+			$encryppass = md5($pass);
91
+			//$headers = "From: $sitename\n";
92
+			dbquery("UPDATE "._AUTHORTABLE." SET "._PASSWORDFIELD." = '$encryppass' WHERE uid = '".$_GET['release']."'");
93
+			
94
+			$subject = _SIGNUPSUBJECT;
95
+			
96
+			$letter = sprintf(_RELEASEMESSAGE, $email['penname'], $pass);
97
+
98
+			$mailresult = sendemail($email['penname'], $email['email'], $sitename, $siteemail, $subject, $letter);
99
+			if($mailresult) $output .= write_message(_AUTHORRELEASED);
100
+			else $output .= write_error(_EMAILFAILED);
101
+		}
102
+		else if ($confirm == "no")
103
+		{
104
+			$output .= write_message(_ACTIONCANCELLED);
105
+		}
106
+		else {
107
+			$output .= write_message(_CONFIRMAUTHORRELEASE."<br /><br />
108
+						[ <a href=\"admin.php?action=members&confirm=yes&release=$_GET[release]\">"._YES."</a> | <a href=\"admin.php?action=members&confirm=no&release=$_GET[release]\">"._NO."</a> ]");
109
+		}
110
+	}	
111
+	else if(isset($_GET["revoke"]) && isNumber($_GET["revoke"])) {
112
+		$output .= "<div class='sectionheader'>"._REVOKEVAL."</div>";
113
+		if($confirm == "yes")
114
+		{
115
+			dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET validated = '0' WHERE uid = '$_GET[revoke]'");
116
+			$output .= write_message(_ACTIONSUCCESSFUL);
117
+		}
118
+		else if ($confirm == "no")
119
+		{
120
+			$output .= write_message(_ACTIONCANCELLED);
121
+		}
122
+		else
123
+		{
124
+			$output .= write_message(_CONFIRMVALREVOKE."<br /><br />
125
+						[ <a href=\"admin.php?action=members&amp;confirm=yes&amp;revoke=$_GET[revoke]\">"._YES."</a> | <a href=\"admin.php?action=members&amp;confirm=no&amp;revoke=$_GET[revoke]\">"._NO."</a> ]");
126
+		}
127
+	}
128
+	else if(isset($_GET["delete"]) && isNumber($_GET["delete"])) {
129
+		$output .= "<div class='sectionheader'>"._DELETEUSER."</div>";
130
+		if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") $output .= write_message("<br />"._FOREIGNAUTHORTABLE);
131
+		else if($confirm == "yes") {
132
+			include("includes/deletefunctions.php");
133
+			$output .= deleteUser($_GET['delete']);
134
+		}
135
+		else if ($confirm == "no") {
136
+			$output .= write_message(_ACTIONCANCELLED);
137
+		}
138
+		else {
139
+			$output .= write_message(_CONFIRMDELETE."<br /><br />
140
+						[ <a href=\"admin.php?action=members&confirm=yes&delete=$_GET[delete]\">"._YES."</a> | <a href=\"admin.php?action=members&confirm=no&delete=$_GET[delete]\">"._NO."</a> ]");
141
+		}
142
+	}
143
+	else if(isset($_GET["validate"]) && isNumber($_GET["validate"])) {
144
+		$output .= "<div class='sectionheader'>"._NONVALMEMBERS."</div>";
145
+		if($confirm == "yes") {
146
+			if(check_prefs($_GET['validate'])) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET validated = '1' WHERE uid = '".$_GET['validate']."'");
147
+			else dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(`uid`, `validated`) VALUES('".$_GET['validate']."', '1')");
148
+			$output .= write_message(_ACTIONSUCCESSFUL);
149
+		}
150
+		else if ($confirm == "no") {
151
+			$output .= write_message(_ACTIONCANCELLED);
152
+		}
153
+		else {
154
+			$output .= write_message(_CONFIRMVALIDATE."<br /><br />
155
+						[ <a href=\"admin.php?action=members&amp;confirm=yes&amp;validate=".$_GET['validate']."\">"._YES."</a> | <a href=\"admin.php?action=members&confirm=no&amp;validate=".$_GET['validate']."\">"._NO."</a> ]");
156
+		}
157
+	}
158
+	else if(isset($_GET["do"]) && $_GET['do'] == "add") {
159
+		if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") $output .= write_message("<br />"._FOREIGNAUTHORTABLE);
160
+		$output .= "<form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=members\"><table align=\"center\"><tr><td colspan=\"2\">
161
+			<div style='text-align: center; font-weight: bold;'>"._ADDAUTHOR." <A HREF=\"javascript:n_window('docs/adminhints.htm#addauthor');\">[?]</A></div></td></tr>
162
+			<tr><td><label for=\"penname\">"._PENNAME.":</label></td><td><INPUT  type=\"text\" class=\"textbox=\" name=\"penname\"></td></tr>
163
+			<tr><td><label for=\"realname\">"._REALNAME.":</label></td><td><INPUT  type=\"text\" class=\"textbox=\" name=\"realname\"></td></tr>
164
+			<tr><td><label for=\"email\">"._EMAIL.":</label></td><td><INPUT  type=\"text\" class=\"textbox=\" name=\"email\"></td></tr>
165
+			<tr><td colspan=\"2\"><INPUT type=\"submit\" class=\"button\" value=\""._SUBMIT."\" name=\"submit\"></form></td></tr></table>";
166
+		}
167
+		else if (isset($_POST['submit'])) {
168
+			if(preg_match("!^[a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
169
+				dbquery("INSERT INTO ".substr(_AUTHORTABLE, 0, strpos(_AUTHORTABLE, "as author"))."(penname, realname, email, admincreated, date) VALUES ('".escapestring(descript($_POST['penname']))."', '".escapestring(descript($_POST['realname']))."', '".escapestring(descript($_POST['email']))."', '1', now())");
170
+				$newuid = dbinsertid( );
171
+				if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`, `log_timestamp`) VALUES('".escapestring(sprintf(_LOG_ADMIN_REG, descript($_POST['penname']), $newuid, USERPENNAME, USERUID, $_SERVER['REMOTE_ADDR']))."', '".USERUID."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'RG', " . time() . ")");
172
+				if(!$skin) {
173
+					$skinquery = dbquery("SELECT skin FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
174
+					list($skin) = dbrow($skinquery);
175
+				}
176
+				dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(uid, userskin, storyindex, sortby) VALUES('$newuid', '$skin', '$displayindex', '$defaultsort')");
177
+				
178
+				$output .= write_message(_ACTIONSUCCESSFUL);
179
+			}
180
+		else $output .= write_error(_BADUSERNAME);
181
+	}
182
+	else {
183
+		$output .= "<div class='sectionheader'>";
184
+		if(isset($_GET['list'])) $list = $_GET['list'];
185
+		else $list = false;
186
+		$where = "";
187
+
188
+		if($list  == "admincreated") {
189
+			if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") {
190
+				$fieldtest = dbquery("SHOW COLUMNS FROM ".substr(_AUTHORTABLE, 0, strlen(_AUTHORTABLE) - 9)." LIKE 'admincreated'");
191
+			}
192
+			if(isset($fieldtest) && !dbnumrows($fieldtest)) {
193
+				$where = "";
194
+				$output .= write_message(_FUNCTIONDISABLED);
195
+				$tpl->assign("output", $output);
196
+				$tpl->printToScreen( );
197
+				dbclose( );
198
+				exit();
199
+			}
200
+			else {
201
+				$where = " WHERE author.admincreated = '1'";
202
+				$do = "release";
203
+				$output .= _INPUTBYADMIN;
204
+				$message = write_message(_RELEASEAUTHORS);
205
+			}
206
+		}
207
+		else if($list == "admins") {
208
+			$where = " WHERE ap.level > 0";
209
+			$do = false;
210
+			$authorlink = "<a href=\"admin.php?action=admins&amp;do=edit&amp;uid=";
211
+			$output .= _ADMINS;
212
+		}
213
+		else if($list == "noval") {
214
+			$where = " WHERE  ap.validated IS NULL OR ap.validated = '0'";
215
+			$do = "validate";
216
+			$output .= _NONVALMEMBERS;
217
+		}
218
+		else if($list == "validated") {
219
+			$where = " WHERE ap.validated = '1'";
220
+			$do = "revoke";
221
+			$output .= _VALMEMBERS;
222
+		}
223
+		else if($list == "locked") {
224
+			$where = " WHERE ap.level = -1";
225
+			$do = "unlock";
226
+			$output .= _LOCKMEM;
227
+		}
228
+		else if($list == "unlocked") {
229
+			$where = " WHERE (ap.level IS NULL OR ap.level > -1) ";
230
+			$do = "lock";
231
+			$output .= _UNLOCKMEMBERS;
232
+			$message = write_message(_LOCKMEMBERS);
233
+		}
234
+		else if($list == "authors") {
235
+			$where = " WHERE ap.stories > 0";
236
+			$authorlink = "<a href=\"user.php?action=editbio&amp;uid=";
237
+			$output .= _AUTHORS;
238
+		}
239
+		else {
240
+			$where = "";
241
+			$do = "members";
242
+			$authorlink = "<a href=\"user.php?action=editbio&amp;uid=";
243
+			$output .= _MEMBERS;
244
+		}
245
+		if($let == _OTHER) {
246
+			$where .= (empty($where) ? " WHERE " : " AND ")._PENNAMEFIELD." REGEXP '^[^a-z]'";
247
+			$output .= " - "._OTHER;
248
+		}
249
+		else if($let){
250
+			$where .= (empty($where) ? " WHERE " : " AND ")._PENNAMEFIELD." LIKE '$let%'";
251
+			$output .= " - $let";
252
+		}
253
+		$list = $list;
254
+		if(!$list) $list = "members";
255
+		$output .= "</div>";
256
+		if(!isset($authorlink)) $authorlink = "<a href=\"admin.php?action=members&amp;do=list&amp;$do=";
257
+		if(!isset($countquery)) $countquery = _MEMBERCOUNT." $where";
258
+		if(!isset($authorquery)) $authorquery = _MEMBERLIST." $where GROUP BY "._UIDFIELD;
259
+		$output .= "<p align=\"center\">
260
+			<a href=\"admin.php?action=members\">"._ALLMEMBERS."</a> | <a href=\"admin.php?action=members&amp;do=list&amp;list=admins\">"._ADMINS."</a> |  <a href=\"admin.php?action=members&amp;do=list&amp;list=authors\">"._AUTHORS."</a> | <a href=\"admin.php?action=members&amp;do=list&amp;list=admincreated\">"._INPUTBYADMIN."</a> <br />
261
+			<a href=\"admin.php?action=members&amp;do=list&amp;list=noval\">"._NONVALMEMBERS."</a> | <a href=\"admin.php?action=members&amp;do=list&amp;list=validated\">"._VALMEMBERS."</a> | <a href=\"admin.php?action=members&amp;do=list&amp;list=locked\">"._LOCKMEMLIST."</a> | <a href=\"admin.php?action=members&amp;do=list&amp;list=unlocked\">"._UNLOCKMEMBERS."</a></p>";
262
+		$pagelink = "admin.php?action=members&amp;do=list&amp;list=$list&amp;".($let ? "let=$let&amp;" :"");
263
+
264
+		include("includes/members_list.php");
265
+		if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors as author") {
266
+			$fieldtest = dbquery("SHOW COLUMNS FROM ".substr(_AUTHORTABLE, 0, strlen(_AUTHORTABLE) - 9)." LIKE 'admincreated'");
267
+			if(dbnumrows($fieldtest)) $output .= write_message("<a href=\"admin.php?action=members&do=add\">"._ADDAUTHOR."</a>");
268
+		}
269
+		else $output .= write_message("<a href=\"admin.php?action=members&do=add\">"._ADDAUTHOR."</a>");
270
+		if(isset($message)) $output .= $message;
271
+	}
272
+?>
0 273
\ No newline at end of file