Browse code

admin/settings.php: Do not parse the mailer directory in Language selection drop-down

Clarissa Walker authored on 2026/09/10 13:15:16
Showing 1 changed files
... ...
@@ -347,7 +347,7 @@ else if(isset($_POST['submit'])) {
347 347
 				<td><label for='newlanguage'>"._LANGUAGE.":</label></td><td><select name='newlanguage'>";
348 348
 		$directory = opendir(_BASEDIR."languages");
349 349
 			while($filename = readdir($directory)) {
350
-				if($filename=="." || $filename==".." || substr($filename, 2) == "_admin.php") continue;
350
+				if($filename=="." || $filename==".." || $filename=="mailer" || substr($filename, 2) == "_admin.php") continue;
351 351
 				$output .= "<option value='".substr($filename, 0, 2)."'".
352 352
 					($language == substr($filename, 0, strpos($filename, ".php")) ? " selected" : "").">
353 353
 				".substr($filename, 0, strpos($filename, ".php"))."</option>";
Browse code

Add tinyMCE 5.3.2 support - Clean up init.php for tinyMCE 6

Clarissa Walker authored on 2026/09/06 02:25:52
Showing 1 changed files
... ...
@@ -233,7 +233,7 @@ else if(isset($_POST['submit'])) {
233 233
 
234 234
 	}
235 235
 	else if($sect == "sitesettings") {
236
-		$tinyMCE = ($_POST['newtinyMCE'] == 1  OR $_POST['newtinyMCE'] == 2 OR $_POST['newtinyMCE'] == 3 OR $_POST['newtinyMCE'] == 4) ? $_POST['newtinyMCE'] : 0;
236
+		$tinyMCE = ($_POST['newtinyMCE'] == 1  OR $_POST['newtinyMCE'] == 2 OR $_POST['newtinyMCE'] == 3 OR $_POST['newtinyMCE'] == 4 OR $_POST['newtinyMCE'] == 5) ? $_POST['newtinyMCE'] : 0;
237 237
 		$allowed_tags = $_POST['newallowed_tags'];
238 238
 		$favorites = $_POST['newfavorites'] == 1 ? 1 : 0;
239 239
 		$multiplecats = $_POST['newmultiplecats'] == 1 ? 1 : 0;
... ...
@@ -419,7 +419,8 @@ else if(isset($_POST['submit'])) {
419 419
 		<table class='acp' style='margin: 0 auto;'>
420 420
 			<tr>
421 421
 				<td><label for='newtinyMCE'>"._USETINYMCE. ": </label></td><td><select name='newtinyMCE'>
422
-				<option value=\"4\"" . ($tinyMCE == 4 ? " selected" : "") . ">tinyMCE 6</option>
422
+				<option value=\"5\"" . ($tinyMCE == 5 ? " selected" : "") . ">tinyMCE 6</option>
423
+				<option value=\"4\"" . ($tinyMCE == 4 ? " selected" : "") . ">tinyMCE 5</option>
423 424
 				<option value=\"3\"" . ($tinyMCE == 3 ? " selected" : "") . ">tinyMCE 4</option>
424 425
 				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">tinyMCE 3</option>
425 426
 				<option value=\"1\"" . ($tinyMCE == 1 ? " selected" : "") . ">tinyMCE 2</option>
Browse code

Fix forgotten spacing on SMTP connection test button during formatting change

Clarissa Walker authored on 2026/08/23 13:38:49
Showing 1 changed files
... ...
@@ -636,6 +636,7 @@ else if(isset($_POST['submit'])) {
636 636
 	if($sect == "email") {
637 637
 		$output .= "<div class='sectionheader'>"._TESTSMTP_HEADER."</div>
638 638
 		<div align='center'>
639
+			<p>
639 640
 				<form method='POST' action='admin.php?action=settings&amp;sect=email' style='display:inline'>
640 641
 					<input type='submit' class='button' name='testsmtp' value='"._TESTSMTP."'>
641 642
 				</form>
Browse code

General cleanup - layout and consistency changes

Clarissa Walker authored on 2026/08/18 18:02:49
Showing 1 changed files
... ...
@@ -410,7 +410,7 @@ else if(isset($_POST['submit'])) {
410 410
 				<td><label for='newstoriespath'>"._STORIESPATH.":</label></td><td><input type='text' class='textbox=' name='newstoriespath' value='$storiespath'> <a href='#' class='pophelp'>[?]<span>"._HELP_STORIESPATH."</span></a></td>
411 411
 			</tr>
412 412
 			<tr>
413
-				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend>
413
+				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS." <a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend>
414 414
 				<label for='newminwords'>"._MIN.":</label> <span style='padding-left: 38.44%;'> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
415 415
 				<label for='newmaxwords'>"._MAX.":</label> <span style='padding-left: 37.7%;'> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
416 416
 	}
... ...
@@ -433,7 +433,7 @@ else if(isset($_POST['submit'])) {
433 433
 				<td><label for='newfavorites'>"._FAVORITES.": </label></td><td><select name='newfavorites'>
434 434
 				<option value='1'".($favorites == "1" ? " selected" : "").">"._YES."</option>
435 435
 				<option value='0'".($favorites == "0" ? " selected" : "").">"._NO."</option>
436
-				</select><a href='#' class='pophelp'>[?]<span>"._HELP_FAVORITES."</span></a></td>
436
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_FAVORITES."</span></a></td>
437 437
 			</tr>
438 438
 			<tr>
439 439
 				<td><label for='newmultiplecats'>"._NUMCATS.": </label></td><td><select name='newmultiplecats'>
... ...
@@ -475,7 +475,7 @@ else if(isset($_POST['submit'])) {
475 475
 				<td><label for='newcaptcha'>"._CAPTCHA.": </label></td><td><select name='newcaptcha'>
476 476
 				<option value='1'".($captcha == "1" ? " selected" : "").">"._YES."</option>
477 477
 				<option value='0'".(!isset($captcha) || $captcha == "0" ? " selected" : "").">"._NO."</option>
478
-				</select><a href='#' class='pophelp'>[?]<span>"._HELP_CAPTCHA."</span></a></td></tr>";
478
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_CAPTCHA."</span></a></td></tr>";
479 479
 	}
480 480
 	else if($sect == "display") {
481 481
 		$settings = dbquery("SELECT defaultsort, displayindex FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
Browse code

Fix very old typo for 'multiplecats'

Clarissa Walker authored on 2026/08/18 03:00:47
Showing 1 changed files
... ...
@@ -436,7 +436,7 @@ else if(isset($_POST['submit'])) {
436 436
 				</select><a href='#' class='pophelp'>[?]<span>"._HELP_FAVORITES."</span></a></td>
437 437
 			</tr>
438 438
 			<tr>
439
-				<td><label for='newmultplecats'>"._NUMCATS.": </label></td><td><select name='newmultiplecats'>
439
+				<td><label for='newmultiplecats'>"._NUMCATS.": </label></td><td><select name='newmultiplecats'>
440 440
 				<option value='1'".($multiplecats == "1" ? "selected" : "").">"._MORETHANONE."</option>
441 441
 				<option value='0'".($multiplecats == "0" ? "selected" : "").">"._ONLYONE."</option>
442 442
 				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_NUMCATS."</span></a></td>
Browse code

Add site setting to enable or disable new user registrations

Clarissa Walker authored on 2026/08/18 01:56:03
Showing 1 changed files
... ...
@@ -237,12 +237,13 @@ else if(isset($_POST['submit'])) {
237 237
 		$allowed_tags = $_POST['newallowed_tags'];
238 238
 		$favorites = $_POST['newfavorites'] == 1 ? 1 : 0;
239 239
 		$multiplecats = $_POST['newmultiplecats'] == 1 ? 1 : 0;
240
+		$setreg = $_POST['newsetreg'] == 1 ? 1 : 0;
240 241
 		$newscomments = $_POST['newnewscomments'] == 1 ? 1 : 0;
241 242
 		$logging = $_POST['newlogging'] == 1 ? 1 : 0;
242 243
 		$maintenance = $_POST['newmaint'] == 1 ? 1 : 0;
243 244
 		$debug = $_POST['newdebug'] == 1 ? 1 : 0;
244 245
 		$captcha = $_POST['newcaptcha'] == 1 ? 1 : 0;
245
-		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET tinyMCE = '$tinyMCE', favorites = '$favorites', multiplecats = '$multiplecats', allowed_tags = '$allowed_tags', newscomments = '$newscomments', logging = '$logging', maintenance = '$maintenance', debug = '$debug', captcha = '$captcha' WHERE sitekey ='".SITEKEY."'");
246
+		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET tinyMCE = '$tinyMCE', favorites = '$favorites', multiplecats = '$multiplecats', setreg = '$setreg', allowed_tags = '$allowed_tags', newscomments = '$newscomments', logging = '$logging', maintenance = '$maintenance', debug = '$debug', captcha = '$captcha' WHERE sitekey ='".SITEKEY."'");
246 247
 	}
247 248
 	else if($sect == "display") {
248 249
 		$dateformat = $_POST['newdateformat'] ? descript(strip_tags($_POST['newdateformat'])) : descript(strip_tags($_POST['customdateformat']));
... ...
@@ -418,7 +419,7 @@ else if(isset($_POST['submit'])) {
418 419
 		<table class='acp' style='margin: 0 auto;'>
419 420
 			<tr>
420 421
 				<td><label for='newtinyMCE'>"._USETINYMCE. ": </label></td><td><select name='newtinyMCE'>
421
-				<option value=\"4\"" . ($tinyMCE == 4 ? " selected" : "") . ">tinyMCE 4</option>
422
+				<option value=\"4\"" . ($tinyMCE == 4 ? " selected" : "") . ">tinyMCE 6</option>
422 423
 				<option value=\"3\"" . ($tinyMCE == 3 ? " selected" : "") . ">tinyMCE 4</option>
423 424
 				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">tinyMCE 3</option>
424 425
 				<option value=\"1\"" . ($tinyMCE == 1 ? " selected" : "") . ">tinyMCE 2</option>
... ...
@@ -440,6 +441,12 @@ else if(isset($_POST['submit'])) {
440 441
 				<option value='0'".($multiplecats == "0" ? "selected" : "").">"._ONLYONE."</option>
441 442
 				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_NUMCATS."</span></a></td>
442 443
 			</tr>
444
+			<tr>
445
+				<td><label for='newsetreg'>"._SETREG.": </label></td><td><select name='newsetreg'>
446
+				<option value='1'".($setreg == "1" ? "selected" : "").">"._YES."</option>
447
+				<option value='0'".($setreg == "0" ? "selected" : "").">"._NO."</option>
448
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_SETREG."</span></a></td>
449
+			</tr>
443 450
 			<tr>
444 451
 				<td><label for='newnewscomments'>"._NEWSCOMMENTS.": </label></td><td><select name='newnewscomments'>
445 452
 				<option value='1'".($newscomments == "1" ? " selected" : "").">"._YES."</option>
Browse code

Add tinyMCE 6.8.6 - README.md updated

Clarissa Walker authored on 2026/08/17 21:23:43
Showing 1 changed files
... ...
@@ -233,7 +233,7 @@ else if(isset($_POST['submit'])) {
233 233
 
234 234
 	}
235 235
 	else if($sect == "sitesettings") {
236
-		$tinyMCE = ($_POST['newtinyMCE'] == 1  OR $_POST['newtinyMCE'] == 2 OR $_POST['newtinyMCE'] == 3) ? $_POST['newtinyMCE'] : 0;
236
+		$tinyMCE = ($_POST['newtinyMCE'] == 1  OR $_POST['newtinyMCE'] == 2 OR $_POST['newtinyMCE'] == 3 OR $_POST['newtinyMCE'] == 4) ? $_POST['newtinyMCE'] : 0;
237 237
 		$allowed_tags = $_POST['newallowed_tags'];
238 238
 		$favorites = $_POST['newfavorites'] == 1 ? 1 : 0;
239 239
 		$multiplecats = $_POST['newmultiplecats'] == 1 ? 1 : 0;
... ...
@@ -418,6 +418,7 @@ else if(isset($_POST['submit'])) {
418 418
 		<table class='acp' style='margin: 0 auto;'>
419 419
 			<tr>
420 420
 				<td><label for='newtinyMCE'>"._USETINYMCE. ": </label></td><td><select name='newtinyMCE'>
421
+				<option value=\"4\"" . ($tinyMCE == 4 ? " selected" : "") . ">tinyMCE 4</option>
421 422
 				<option value=\"3\"" . ($tinyMCE == 3 ? " selected" : "") . ">tinyMCE 4</option>
422 423
 				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">tinyMCE 3</option>
423 424
 				<option value=\"1\"" . ($tinyMCE == 1 ? " selected" : "") . ">tinyMCE 2</option>
Browse code

Installer layout fixed - Previous layout behavior restored to site settings

Clarissa Walker authored on 2026/07/27 17:42:50
Showing 1 changed files
... ...
@@ -396,8 +396,8 @@ else if(isset($_POST['submit'])) {
396 396
 			</tr>
397 397
 			<tr>
398 398
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._IMAGESIZE." <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGESIZE."</span></a></legend>
399
-				<label for='newimageheight'>"._MAXHEIGHT.":</label> <span style='padding-left: 19.3%;'> <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
-				<label for='newimagewidth'>"._MAXWIDTH.":</label> <span style='padding-left: 20.3%;'> <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
399
+				<label for='newimageheight'>"._MAXHEIGHT.":</label> <span style='padding-left: 24.3%;'> <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
+				<label for='newimagewidth'>"._MAXWIDTH.":</label> <span style='padding-left: 25.3%;'> <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
401 401
 			</tr>
402 402
 			<tr>
403 403
 				<td><label for='newstore'>"._HOWSTORE.":</label></td><td><select name='newstore' onChange='if (this.disabled) this.selectedIndex=0' disabled>
... ...
@@ -410,8 +410,8 @@ else if(isset($_POST['submit'])) {
410 410
 			</tr>
411 411
 			<tr>
412 412
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend>
413
-				<label for='newminwords'>"._MIN.":</label> <span style='padding-left: 33.44%;'> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414
-				<label for='newmaxwords'>"._MAX.":</label> <span style='padding-left: 32.7%;'> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
413
+				<label for='newminwords'>"._MIN.":</label> <span style='padding-left: 38.44%;'> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414
+				<label for='newmaxwords'>"._MAX.":</label> <span style='padding-left: 37.7%;'> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
415 415
 	}
416 416
 	else if($sect == "sitesettings") {
417 417
 		$output .= "<div class='sectionheader'>"._SITESETTINGS."</div>
Browse code

TinyMCE version directories relocated to /tinymce/ directory, each with its own version numbers: 2, 3, 4 - Slight naming tweak to TinyMCE dropdown in site settings

Clarissa Walker authored on 2026/07/27 13:46:03
Showing 1 changed files
... ...
@@ -326,13 +326,13 @@ else if(isset($_POST['submit'])) {
326 326
 			<tr>
327 327
 				<td><label for='newurl'>"._SITEURL.":</label></td><td><input type='text' class='textbox' name='newsiteurl' value='$url'> <a href='#' class='pophelp'>[?]<span>"._HELP_URL."</span></a></td>
328 328
 			</tr>
329
-			<tr>				
329
+			<tr>
330 330
 				<td><label for='newtableprefix'>"._TABLEPREFIX.":</label></td><td><input type='text' class='textbox' name='newtableprefix' value='".TABLEPREFIX."'> <a href='#' class='pophelp'>[?]<span>"._HELP_TABLEPREFIX."</span></a></td>
331 331
 			</tr>
332
-			<tr>				
332
+			<tr>
333 333
 				<td><label for='newsiteemail'>"._ADMINEMAIL.":</label></td><td><input type='text' class='textbox' name='newsiteemail' value='$siteemail'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEEMAIL."</span></a></td>
334 334
 			</tr>
335
-			<tr>				
335
+			<tr>
336 336
 				<td><label for='newsiteskin'>"._DEFAULTSKIN.":</label></td><td><select name='newskin'>";
337 337
 		$directory = opendir(_BASEDIR."skins");
338 338
 		while($filename = readdir($directory)) {
... ...
@@ -418,9 +418,9 @@ else if(isset($_POST['submit'])) {
418 418
 		<table class='acp' style='margin: 0 auto;'>
419 419
 			<tr>
420 420
 				<td><label for='newtinyMCE'>"._USETINYMCE. ": </label></td><td><select name='newtinyMCE'>
421
-				<option value=\"3\"" . ($tinyMCE == 3 ? " selected" : "") . ">TinyMce4</option>
422
-				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">TinyMce3</option>
423
-				<option value=\"1\"" . ($tinyMCE == 1 ? " selected" : "") . ">TinyMce2</option>
421
+				<option value=\"3\"" . ($tinyMCE == 3 ? " selected" : "") . ">tinyMCE 4</option>
422
+				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">tinyMCE 3</option>
423
+				<option value=\"1\"" . ($tinyMCE == 1 ? " selected" : "") . ">tinyMCE 2</option>
424 424
 				<option value=\"0\"" . (!$tinyMCE ? " selected" : "") . ">" . _NO . "</option>
425 425
 				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_TINYMCE." "._TINYMCENOTE."</span></a></td>
426 426
 			</tr>
Browse code

Re-add TinyMCE 2.0.1 to the site settings list - TinyMCE directoy names changed - installer submission settings layout dirty fix

Clarissa Walker authored on 2026/07/27 11:20:38
Showing 1 changed files
... ...
@@ -233,7 +233,7 @@ else if(isset($_POST['submit'])) {
233 233
 
234 234
 	}
235 235
 	else if($sect == "sitesettings") {
236
-		$tinyMCE = ($_POST['newtinyMCE'] == 1  OR $_POST['newtinyMCE'] == 2) ? $_POST['newtinyMCE'] : 0;
236
+		$tinyMCE = ($_POST['newtinyMCE'] == 1  OR $_POST['newtinyMCE'] == 2 OR $_POST['newtinyMCE'] == 3) ? $_POST['newtinyMCE'] : 0;
237 237
 		$allowed_tags = $_POST['newallowed_tags'];
238 238
 		$favorites = $_POST['newfavorites'] == 1 ? 1 : 0;
239 239
 		$multiplecats = $_POST['newmultiplecats'] == 1 ? 1 : 0;
... ...
@@ -396,8 +396,8 @@ else if(isset($_POST['submit'])) {
396 396
 			</tr>
397 397
 			<tr>
398 398
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._IMAGESIZE." <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGESIZE."</span></a></legend>
399
-				<label for='newimageheight'>"._MAXHEIGHT.":</label> <span style='padding-left: 24.3%;'> <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
-				<label for='newimagewidth'>"._MAXWIDTH.":</label> <span style='padding-left: 25.3%;'> <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
399
+				<label for='newimageheight'>"._MAXHEIGHT.":</label> <span style='padding-left: 19.3%;'> <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
+				<label for='newimagewidth'>"._MAXWIDTH.":</label> <span style='padding-left: 20.3%;'> <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
401 401
 			</tr>
402 402
 			<tr>
403 403
 				<td><label for='newstore'>"._HOWSTORE.":</label></td><td><select name='newstore' onChange='if (this.disabled) this.selectedIndex=0' disabled>
... ...
@@ -410,16 +410,17 @@ else if(isset($_POST['submit'])) {
410 410
 			</tr>
411 411
 			<tr>
412 412
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend>
413
-				<label for='newminwords'>"._MIN.":</label> <span style='padding-left: 38.44%;'> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414
-				<label for='newmaxwords'>"._MAX.":</label> <span style='padding-left: 37.7%;'> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
413
+				<label for='newminwords'>"._MIN.":</label> <span style='padding-left: 33.44%;'> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414
+				<label for='newmaxwords'>"._MAX.":</label> <span style='padding-left: 32.7%;'> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
415 415
 	}
416 416
 	else if($sect == "sitesettings") {
417 417
 		$output .= "<div class='sectionheader'>"._SITESETTINGS."</div>
418 418
 		<table class='acp' style='margin: 0 auto;'>
419 419
 			<tr>
420 420
 				<td><label for='newtinyMCE'>"._USETINYMCE. ": </label></td><td><select name='newtinyMCE'>
421
-				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">TinyMce4</option>
422
-				<option value=\"1\"" . ($tinyMCE == 1 ? " selected" : "") . ">TinyMce3</option>
421
+				<option value=\"3\"" . ($tinyMCE == 3 ? " selected" : "") . ">TinyMce4</option>
422
+				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">TinyMce3</option>
423
+				<option value=\"1\"" . ($tinyMCE == 1 ? " selected" : "") . ">TinyMce2</option>
423 424
 				<option value=\"0\"" . (!$tinyMCE ? " selected" : "") . ">" . _NO . "</option>
424 425
 				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_TINYMCE." "._TINYMCENOTE."</span></a></td>
425 426
 			</tr>
Browse code

admin/settings.php: Slight layout tweak

Clarissa Walker authored on 2026/07/26 22:51:38
Showing 1 changed files
... ...
@@ -410,7 +410,7 @@ else if(isset($_POST['submit'])) {
410 410
 			</tr>
411 411
 			<tr>
412 412
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend>
413
-				<label for='newminwords'>"._MIN.":</label> <span style='padding-left: 38.5%;'> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
413
+				<label for='newminwords'>"._MIN.":</label> <span style='padding-left: 38.44%;'> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414 414
 				<label for='newmaxwords'>"._MAX.":</label> <span style='padding-left: 37.7%;'> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
415 415
 	}
416 416
 	else if($sect == "sitesettings") {
Browse code

admin/settings.php: this is hopefully the last of formatting changes...

Clarissa Walker authored on 2026/07/26 20:01:18
Showing 1 changed files
... ...
@@ -396,8 +396,8 @@ else if(isset($_POST['submit'])) {
396 396
 			</tr>
397 397
 			<tr>
398 398
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._IMAGESIZE." <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGESIZE."</span></a></legend>
399
-				<label for='newimageheight'>"._MAXHEIGHT.":</label> &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
-				<label for='newimagewidth'>"._MAXWIDTH.":</label> &nbsp; &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
399
+				<label for='newimageheight'>"._MAXHEIGHT.":</label> <span style='padding-left: 24.3%;'> <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
+				<label for='newimagewidth'>"._MAXWIDTH.":</label> <span style='padding-left: 25.3%;'> <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
401 401
 			</tr>
402 402
 			<tr>
403 403
 				<td><label for='newstore'>"._HOWSTORE.":</label></td><td><select name='newstore' onChange='if (this.disabled) this.selectedIndex=0' disabled>
... ...
@@ -410,8 +410,8 @@ else if(isset($_POST['submit'])) {
410 410
 			</tr>
411 411
 			<tr>
412 412
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend>
413
-				<label for='newminwords'>"._MIN.":</label> &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414
-				<label for='newmaxwords'>"._MAX.":</label> &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
413
+				<label for='newminwords'>"._MIN.":</label> <span style='padding-left: 38.5%;'> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414
+				<label for='newmaxwords'>"._MAX.":</label> <span style='padding-left: 37.7%;'> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
415 415
 	}
416 416
 	else if($sect == "sitesettings") {
417 417
 		$output .= "<div class='sectionheader'>"._SITESETTINGS."</div>
Browse code

Making admin settings sections look even less jank

Clarissa Walker authored on 2026/07/26 17:29:21
Showing 1 changed files
... ...
@@ -310,10 +310,10 @@ else if(isset($_POST['submit'])) {
310 310
 		$$var = stripslashes($val );
311 311
 	}
312 312
 
313
-	$output .= "<form method='POST' class='tblborder' style='width:30%; margin:0 auto' enctype='multipart/form-data' action='".((isset($action) && $action == "settings") ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&amp;sect=$sect'>";
313
+	$output .= "<br><form method='POST' class='tblborder' style='width: 45%; margin: 0 auto;' enctype='multipart/form-data' action='".((isset($action) && $action == "settings") ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&amp;sect=$sect'>";
314 314
 	if($sect == "main") {
315 315
 		$output .= "<div class='sectionheader'>"._SITEINFO."</div>
316
-		<table class='acp'>
316
+		<table class='acp' style='margin: 0 auto;'>
317 317
 			<tr>
318 318
 				<td><label for='newsitekey'>"._SITEKEY.":</label></td><td><input type='text' class='textbox' name='newsitekey' value='".SITEKEY."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEKEY."</span></a></td>
319 319
 			</tr>
... ...
@@ -356,7 +356,7 @@ else if(isset($_POST['submit'])) {
356 356
 	}
357 357
 	else if($sect == "submissions") {
358 358
 		$output .= "<div class='sectionheader'>"._SUBMISSIONSETTINGS."</div>
359
-		<table class='acp'>
359
+		<table class='acp' style='margin: 0 auto;'>
360 360
 			<tr>
361 361
 				<td><label for='newsubmissionsoff'>"._NOSUBS.":</label></td><td><select name='newsubmissionsoff'>
362 362
 				<option value='1'".($submissionsoff == "1" ? " selected" : "").">"._YES."</option>
... ...
@@ -396,8 +396,8 @@ else if(isset($_POST['submit'])) {
396 396
 			</tr>
397 397
 			<tr>
398 398
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._IMAGESIZE." <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGESIZE."</span></a></legend>
399
-				<label for='newimageheight'>"._MAXHEIGHT.":</label> &nbsp; &nbsp; <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
-				<label for='newimagewidth'>"._MAXWIDTH.":</label> &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
399
+				<label for='newimageheight'>"._MAXHEIGHT.":</label> &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
+				<label for='newimagewidth'>"._MAXWIDTH.":</label> &nbsp; &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
401 401
 			</tr>
402 402
 			<tr>
403 403
 				<td><label for='newstore'>"._HOWSTORE.":</label></td><td><select name='newstore' onChange='if (this.disabled) this.selectedIndex=0' disabled>
... ...
@@ -415,7 +415,7 @@ else if(isset($_POST['submit'])) {
415 415
 	}
416 416
 	else if($sect == "sitesettings") {
417 417
 		$output .= "<div class='sectionheader'>"._SITESETTINGS."</div>
418
-		<table class='acp'>
418
+		<table class='acp' style='margin: 0 auto;'>
419 419
 			<tr>
420 420
 				<td><label for='newtinyMCE'>"._USETINYMCE. ": </label></td><td><select name='newtinyMCE'>
421 421
 				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">TinyMce4</option>
... ...
@@ -475,7 +475,7 @@ else if(isset($_POST['submit'])) {
475 475
 				"d.m.y", "Y.m.d", "m.d.Y", "d-m-y", "m-d-y", "M d Y", "M d, Y", "F d Y", "F d, Y");
476 476
 		$defaulttimes = array("h:i a", "h:i A", "H:i", "g:i a", "g:i A", "G:i", "h:i:s a", "H:i:s", "g:i:s a", "g:i:s A", "G:i:s");
477 477
 		$output .= "<div class='sectionheader'>"._DISPLAYSETTINGS."</div>
478
-		<table class='acp'>
478
+		<table class='acp' style='margin: 0 auto;'>
479 479
 			<tr>
480 480
 				<td><label for='newdateformat'>"._DATEFORMAT.":</label></td><td><select name='newdateformat'><option value=''>"._SELECTONE."</option>";
481 481
 		foreach($defaultdates as $date) {
... ...
@@ -536,7 +536,7 @@ else if(isset($_POST['submit'])) {
536 536
 	}
537 537
 	else if($sect == "reviews") {
538 538
 		$output .= "<div class='sectionheader'>"._REVIEWSETTINGS."</div>
539
-		<table class='acp'>
539
+		<table class='acp' style='margin: 0 auto;'>
540 540
 			<tr>
541 541
 				<td><label for='newreviewsallowed'>"._ONREVIEWS.":</label></td><td><select name='newreviewsallowed'>
542 542
 				<option value='1'".($reviewsallowed == "1" ? " selected" : "").">"._YES."</option>
... ...
@@ -572,7 +572,7 @@ else if(isset($_POST['submit'])) {
572 572
 	}
573 573
 	else if($sect == "useropts") {
574 574
 		$output .= "<div class='sectionheader'>"._USERSETTINGS."</div>
575
-		<table class='acp'>
575
+		<table class='acp' style='margin: 0 auto;'>
576 576
 			<tr>
577 577
 				<td><label for='newalertson'>"._ALERTSON.":</label></td><td><select name='newalertson'>
578 578
 				<option value='1'".($alertson == "1" ? " selected" : "").">"._YES."</option>
... ...
@@ -599,7 +599,7 @@ else if(isset($_POST['submit'])) {
599 599
 	}
600 600
 	else if($sect == "email") {
601 601
 		$output .= "<div class='sectionheader'>"._EMAILSETTINGS."</div>
602
-		<table class='acp'>
602
+		<table class='acp' style='margin: 0 auto;'>
603 603
 			<tr>
604 604
 				<td><label for='newsmtp_host'>"._SMTPHOST.":</label></td><td><input name='newsmtp_host' type='text' value='$smtp_host'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPHOST."</span></a></td>
605 605
 		</tr>
... ...
@@ -619,20 +619,19 @@ else if(isset($_POST['submit'])) {
619 619
 				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPSECURE."</span></a></td></tr>";
620 620
 		$output .= 	write_message(_SMTPOFF);
621 621
 	}
622
-	$output .= "<tr><td colspan='2'><div align='center'><input type='submit' id='submit' class='button' name='submit' value='"._SUBMIT."'></div></form></td></tr></table>";
622
+	$output .= "<tr><td colspan='2'><div align='center'><br><input type='submit' id='submit' class='button' name='submit' value='"._SUBMIT."'><p></div></form></td></tr></table>";
623 623
 	// The SMTP test button lives OUTSIDE the main settings form (nested forms are
624 624
 	// invalid HTML). It is its own POST mini-form -- a submit button, not a GET
625 625
 	// link -- so the outbound SMTP connection can't be triggered by a plain link
626 626
 	// or a browser prefetch. The existing testsmtp handler posts to the same URL.
627 627
 	if($sect == "email") {
628 628
 		$output .= "<div class='sectionheader'>"._TESTSMTP_HEADER."</div>
629
-		<ul>
630
-			<li>
629
+		<div align='center'>
631 630
 				<form method='POST' action='admin.php?action=settings&amp;sect=email' style='display:inline'>
632 631
 					<input type='submit' class='button' name='testsmtp' value='"._TESTSMTP."'>
633 632
 				</form>
634 633
 				<a href='#' class='pophelp'>[?]<span>"._HELP_TESTSMTP."</span></a>
635
-			</li>
636
-		</ul>";
634
+			<p>
635
+		</div>";
637 636
 	}
638 637
 ?>
Browse code

Fix oversight regarding tables formatting conversion - and make it less jank

Clarissa Walker authored on 2026/07/26 15:17:56
Showing 1 changed files
... ...
@@ -50,7 +50,7 @@ function updatePanelOrder( ) {
50 50
 }
51 51
 
52 52
 if($action == "settings") {
53
-$output .= "<h1>"._SETTINGS."</h1><div style='text-align: center;'>
53
+$output .= "<div id='pagetitle'>"._SETTINGS."</div><div style='text-align: center;'>
54 54
 	<a href='admin.php?action=settings&amp;sect=main'>"._MAINSETTINGS."</a> |
55 55
 	<a href='admin.php?action=settings&amp;sect=submissions'>"._SUBMISSIONSETTINGS."</a> |
56 56
 	<a href='admin.php?action=settings&amp;sect=sitesettings'>"._SITESETTINGS."</a> |
... ...
@@ -310,9 +310,9 @@ else if(isset($_POST['submit'])) {
310 310
 		$$var = stripslashes($val );
311 311
 	}
312 312
 
313
-	$output .= "<form method='POST' class='tblborder' style='' enctype='multipart/form-data' action='".((isset($action) && $action == "settings") ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&amp;sect=$sect'>";
313
+	$output .= "<form method='POST' class='tblborder' style='width:30%; margin:0 auto' enctype='multipart/form-data' action='".((isset($action) && $action == "settings") ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&amp;sect=$sect'>";
314 314
 	if($sect == "main") {
315
-		$output .= "<h2>"._SITEINFO."</h2>
315
+		$output .= "<div class='sectionheader'>"._SITEINFO."</div>
316 316
 		<table class='acp'>
317 317
 			<tr>
318 318
 				<td><label for='newsitekey'>"._SITEKEY.":</label></td><td><input type='text' class='textbox' name='newsitekey' value='".SITEKEY."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEKEY."</span></a></td>
... ...
@@ -355,7 +355,7 @@ else if(isset($_POST['submit'])) {
355 355
 		$output .= "</select> <a href='#' class='pophelp'>[?]<span>"._HELP_LANGUAGE."</span></a></td></tr>";
356 356
 	}
357 357
 	else if($sect == "submissions") {
358
-		$output .= "<h2>"._SUBMISSIONSETTINGS."</h2>
358
+		$output .= "<div class='sectionheader'>"._SUBMISSIONSETTINGS."</div>
359 359
 		<table class='acp'>
360 360
 			<tr>
361 361
 				<td><label for='newsubmissionsoff'>"._NOSUBS.":</label></td><td><select name='newsubmissionsoff'>
... ...
@@ -396,8 +396,8 @@ else if(isset($_POST['submit'])) {
396 396
 			</tr>
397 397
 			<tr>
398 398
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._IMAGESIZE." <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGESIZE."</span></a></legend>
399
-				<label for='newimageheight'>"._MAXHEIGHT.":</label> <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
-				<label for='newimagewidth'>"._MAXWIDTH.":</label> <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
399
+				<label for='newimageheight'>"._MAXHEIGHT.":</label> &nbsp; &nbsp; <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
400
+				<label for='newimagewidth'>"._MAXWIDTH.":</label> &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
401 401
 			</tr>
402 402
 			<tr>
403 403
 				<td><label for='newstore'>"._HOWSTORE.":</label></td><td><select name='newstore' onChange='if (this.disabled) this.selectedIndex=0' disabled>
... ...
@@ -410,11 +410,11 @@ else if(isset($_POST['submit'])) {
410 410
 			</tr>
411 411
 			<tr>
412 412
 				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend>
413
-				<label for='newminwords'>"._MIN.":</label> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414
-				<label for='newmaxwords'>"._MAX.":</label> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
413
+				<label for='newminwords'>"._MIN.":</label> &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
414
+				<label for='newmaxwords'>"._MAX.":</label> &nbsp; &nbsp; &nbsp; <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
415 415
 	}
416 416
 	else if($sect == "sitesettings") {
417
-		$output .= "<h2>"._SITESETTINGS."</h2>
417
+		$output .= "<div class='sectionheader'>"._SITESETTINGS."</div>
418 418
 		<table class='acp'>
419 419
 			<tr>
420 420
 				<td><label for='newtinyMCE'>"._USETINYMCE. ": </label></td><td><select name='newtinyMCE'>
... ...
@@ -474,7 +474,7 @@ else if(isset($_POST['submit'])) {
474 474
 		$defaultdates = array("m/d/y", "m/d/Y", "m/d/Y", "d/m/Y", "d/m/y", "d M Y", 
475 475
 				"d.m.y", "Y.m.d", "m.d.Y", "d-m-y", "m-d-y", "M d Y", "M d, Y", "F d Y", "F d, Y");
476 476
 		$defaulttimes = array("h:i a", "h:i A", "H:i", "g:i a", "g:i A", "G:i", "h:i:s a", "H:i:s", "g:i:s a", "g:i:s A", "G:i:s");
477
-		$output .= "<h2>"._DISPLAYSETTINGS."</h2>
477
+		$output .= "<div class='sectionheader'>"._DISPLAYSETTINGS."</div>
478 478
 		<table class='acp'>
479 479
 			<tr>
480 480
 				<td><label for='newdateformat'>"._DATEFORMAT.":</label></td><td><select name='newdateformat'><option value=''>"._SELECTONE."</option>";
... ...
@@ -535,7 +535,7 @@ else if(isset($_POST['submit'])) {
535 535
 			<td><label for='newlinkrange'>"._LINKRANGE.":</label></td><td><input  type='text' class='textbox=' name='newlinkrange' size='3' value='$linkrange'> <a href='#' class='pophelp'>[?]<span>"._HELP_LINKRANGE."</span></a></td></tr>";
536 536
 	}
537 537
 	else if($sect == "reviews") {
538
-		$output .= "<h2>"._REVIEWSETTINGS."</h2>
538
+		$output .= "<div class='sectionheader'>"._REVIEWSETTINGS."</div>
539 539
 		<table class='acp'>
540 540
 			<tr>
541 541
 				<td><label for='newreviewsallowed'>"._ONREVIEWS.":</label></td><td><select name='newreviewsallowed'>
... ...
@@ -571,7 +571,7 @@ else if(isset($_POST['submit'])) {
571 571
 				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_RATEONLY."</span></a></td></tr>";
572 572
 	}
573 573
 	else if($sect == "useropts") {
574
-		$output .= "<h2>"._USERSETTINGS."</h2>
574
+		$output .= "<div class='sectionheader'>"._USERSETTINGS."</div>
575 575
 		<table class='acp'>
576 576
 			<tr>
577 577
 				<td><label for='newalertson'>"._ALERTSON.":</label></td><td><select name='newalertson'>
... ...
@@ -598,7 +598,7 @@ else if(isset($_POST['submit'])) {
598 598
 			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_PWD."</span></a></td></tr>";
599 599
 	}
600 600
 	else if($sect == "email") {
601
-		$output .= "<h2>"._EMAILSETTINGS."</h2>
601
+		$output .= "<div class='sectionheader'>"._EMAILSETTINGS."</div>
602 602
 		<table class='acp'>
603 603
 			<tr>
604 604
 				<td><label for='newsmtp_host'>"._SMTPHOST.":</label></td><td><input name='newsmtp_host' type='text' value='$smtp_host'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPHOST."</span></a></td>
... ...
@@ -625,7 +625,7 @@ else if(isset($_POST['submit'])) {
625 625
 	// link -- so the outbound SMTP connection can't be triggered by a plain link
626 626
 	// or a browser prefetch. The existing testsmtp handler posts to the same URL.
627 627
 	if($sect == "email") {
628
-		$output .= "<h2>"._TESTSMTP_HEADER."</h2>
628
+		$output .= "<div class='sectionheader'>"._TESTSMTP_HEADER."</div>
629 629
 		<ul>
630 630
 			<li>
631 631
 				<form method='POST' action='admin.php?action=settings&amp;sect=email' style='display:inline'>
Browse code

Reintroduce Number of Likes ratings option - 3.5.7 still references this, and the definition conflict is solved. This would have been an issue in future PHP 9.

Clarissa Walker authored on 2026/07/16 16:58:05
Showing 1 changed files
... ...
@@ -558,6 +558,7 @@ else if(isset($_POST['submit'])) {
558 558
 		</tr>
559 559
 		<tr>
560 560
 				<td><label for='newratings'>"._WHATRATINGS.":</label></td><td><select name='newratings'>
561
+				<option value='3'".($ratings == "3" ? " selected" : "").">"._LIKES_NUMBER_SYS."</option>
561 562
 				<option value='2'".($ratings == "2" ? " selected" : "").">"._LIKESYS."</option>
562 563
 				<option value='1'".($ratings == "1" ? " selected" : "").">"._STARS."</option>
563 564
 				<option value='0'".($ratings == "0" ? " selected" : "").">"._NONE."</option>
Browse code

Fix oversights with SMTP fixes and test code causing Undefined variable PHP Warning

Clarissa Walker authored on 2026/07/16 02:22:41
Showing 1 changed files
... ...
@@ -301,6 +301,7 @@ else if(isset($_POST['submit'])) {
301 301
 	} else {
302 302
 		$output .= write_error(_ERROR);
303 303
 	}
304
+}
304 305
 	$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
305 306
 	$settings = dbassoc($settingsresults);
306 307
  
... ...
@@ -308,7 +309,6 @@ else if(isset($_POST['submit'])) {
308 309
 		if(is_NULL($val)) $val = '';
309 310
 		$$var = stripslashes($val );
310 311
 	}
311
-	}
312 312
 
313 313
 	$output .= "<form method='POST' class='tblborder' style='' enctype='multipart/form-data' action='".((isset($action) && $action == "settings") ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&amp;sect=$sect'>";
314 314
 	if($sect == "main") {
... ...
@@ -557,8 +557,7 @@ else if(isset($_POST['submit'])) {
557 557
 				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_REVDELETE."</span></a></td>
558 558
 		</tr>
559 559
 		<tr>
560
-				<td><label for='newratings'>"._WHATRATINGS. ":</label></td><td><select name='newratings'>
561
-				<option value='3'" . ($ratings == "3" ? " selected" : "") . ">" . _LIKES_NUMBER . "</option>
560
+				<td><label for='newratings'>"._WHATRATINGS.":</label></td><td><select name='newratings'>
562 561
 				<option value='2'".($ratings == "2" ? " selected" : "").">"._LIKESYS."</option>
563 562
 				<option value='1'".($ratings == "1" ? " selected" : "").">"._STARS."</option>
564 563
 				<option value='0'".($ratings == "0" ? " selected" : "").">"._NONE."</option>
Browse code

smtp fix + tester

Jimako authored on 2026/07/10 14:03:10
Showing 1 changed files
... ...
@@ -77,7 +77,117 @@ $sects = array("main", "submissions", "sitesettings", "display", "reviews", "use
77 77
 //if(!isset($_GET['sect'])) $sect = "main";
78 78
 //else $sect = $_GET['sect'];
79 79
 $sect = isset($_GET['sect']) ? $_GET['sect'] : "main";
80
-if(isset($_POST['submit'])) {
80
+if(isset($_POST['testsmtp']) && $sect == "email") {
81
+	// SMTP connection test. Runs only on POST (the Test button), never via a GET
82
+	// parameter. It verifies the SAVED settings loaded from fanfiction_settings
83
+	// (via header.php) -- NOT the unsaved form values -- by opening a real SMTP
84
+	// connection and reporting each step. It never sends an email and never writes
85
+	// to the database, so it must not touch $result or advance $sects.
86
+	$output .= "<h2>"._TESTSMTP_HEADER."</h2>";
87
+	if(empty($smtp_host)) {
88
+		$output .= write_error(_TESTSMTP_NOHOST);
89
+	}
90
+	else {
91
+		// Effective values MUST mirror the real sending behaviour of sendemail():
92
+		// PHPMailer's default port is 25, and 'ssl' uses an ssl:// transport prefix.
93
+		$port   = !empty($smtp_port) ? (int) $smtp_port : 25;
94
+		$secure = !empty($smtp_secure) ? $smtp_secure : '';
95
+		$host   = ($secure === 'ssl') ? 'ssl://'.$smtp_host : $smtp_host;
96
+
97
+		$output .= write_message(sprintf(_TESTSMTP_PORTNOTE, htmlspecialchars((string) $port), htmlspecialchars($secure !== '' ? $secure : '(none)')));
98
+		// If encryption is requested but no port is saved, warn about the usual port
99
+		// -- but still run the test on the effective values, since that is what real
100
+		// sending will do.
101
+		if(empty($smtp_port) && $secure === 'ssl') $output .= write_message(_TESTSMTP_SSLPORTWARN);
102
+		if(empty($smtp_port) && $secure === 'tls') $output .= write_message(_TESTSMTP_TLSPORTWARN);
103
+
104
+		// Load the SMTP class the same way emailer.php loads PHPMailer, via the
105
+		// autoloader -- NOT by requiring class.smtp.php directly. After the planned
106
+		// PHPMailer 6.x upgrade the autoload file becomes a shim and this must keep
107
+		// working (that upgrade must alias the SMTP class name; see issue #2).
108
+		require_once(_BASEDIR."includes/PHPMailerAutoload.php");
109
+
110
+		$steps = "";
111
+		ob_start();
112
+		$smtp = new SMTP;
113
+		$smtp->do_debug = 2;
114
+		try {
115
+			if(!$smtp->connect($host, $port, 10)) {
116
+				$steps .= write_error(sprintf(_TESTSMTP_CONNECTFAIL, htmlspecialchars($host), htmlspecialchars((string) $port)));
117
+			}
118
+			else {
119
+				$steps .= write_message(sprintf(_TESTSMTP_CONNECTOK, htmlspecialchars($host), htmlspecialchars((string) $port)));
120
+				if(!$smtp->hello(gethostname())) {
121
+					$err = $smtp->getError();
122
+					$steps .= write_error(sprintf(_TESTSMTP_HELOFAIL, htmlspecialchars(!empty($err['error']) ? $err['error'] : '')));
123
+				}
124
+				else {
125
+					$steps .= write_message(_TESTSMTP_HELOOK);
126
+					$ext = $smtp->getServerExtList();
127
+					$hasStartTls = is_array($ext) && array_key_exists('STARTTLS', $ext);
128
+					if($hasStartTls) {
129
+						$steps .= write_message(_TESTSMTP_STARTTLSOK);
130
+						if($secure === 'tls') {
131
+							if(!$smtp->startTLS()) {
132
+								$err = $smtp->getError();
133
+								$steps .= write_error(sprintf(_TESTSMTP_STARTTLSFAIL, htmlspecialchars(!empty($err['error']) ? $err['error'] : '')));
134
+							}
135
+							else {
136
+								// Re-issue EHLO over the now-encrypted channel and refresh caps.
137
+								$smtp->hello(gethostname());
138
+								$ext = $smtp->getServerExtList();
139
+							}
140
+						}
141
+					}
142
+					else if($secure === 'tls') {
143
+						$steps .= write_error(_TESTSMTP_STARTTLSMISSING);
144
+					}
145
+					$hasAuth = is_array($ext) && array_key_exists('AUTH', $ext);
146
+					if($hasAuth) {
147
+						if(!empty($smtp_username)) {
148
+							if(!$smtp->authenticate($smtp_username, $smtp_password)) {
149
+								// NOTE: never include the password in this message.
150
+								$err = $smtp->getError();
151
+								$steps .= write_error(sprintf(_TESTSMTP_AUTHFAIL, htmlspecialchars(!empty($err['error']) ? $err['error'] : '')));
152
+							}
153
+							else {
154
+								$steps .= write_message(_TESTSMTP_AUTHOK);
155
+							}
156
+						}
157
+						else {
158
+							$steps .= write_message(_TESTSMTP_AUTHSKIP);
159
+						}
160
+					}
161
+					else {
162
+						$steps .= write_message(_TESTSMTP_NOAUTH);
163
+					}
164
+				}
165
+			}
166
+		} catch (Exception $e) {
167
+			$steps .= write_error(htmlspecialchars($e->getMessage()));
168
+		}
169
+		// Always close the connection, even if we stopped early above.
170
+		$smtp->quit(true);
171
+		$debug = ob_get_clean();
172
+
173
+		// SECURITY: the debug transcript at level 2 echoes client commands, which
174
+		// during AUTH include the base64-encoded credentials. Redact every form of
175
+		// the password before it is ever shown so it is never printed anywhere.
176
+		if(!empty($smtp_password)) {
177
+			$secrets = array(
178
+				$smtp_password,
179
+				base64_encode($smtp_password),
180
+				base64_encode("\0".$smtp_username."\0".$smtp_password), // AUTH PLAIN
181
+			);
182
+			$debug = str_replace($secrets, "***REDACTED***", $debug);
183
+		}
184
+
185
+		$output .= $steps;
186
+		// Server banners are untrusted input -> escape the whole transcript (XSS).
187
+		$output .= "<h3>"._TESTSMTP_TRANSCRIPT."</h3><pre style='text-align:left; overflow:auto; background-color: rgba(0, 0, 0, .6); margin-top: 10px; color: #fff; padding: 8px;'>".htmlspecialchars($debug)."</pre>";
188
+	}
189
+}
190
+else if(isset($_POST['submit'])) {
81 191
 	if($sect == "main") {
82 192
 		if(!preg_match("!^[a-z0-9_]{3,30}$!i", $_POST['newsitekey'])) $output .= write_error(_BADSITEKEY);
83 193
 		else {
... ...
@@ -164,21 +274,29 @@ if(isset($_POST['submit'])) {
164 274
 		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET alertson = '$alertson', disablepopups = '$disablepopups', agestatement = '$agestatement', pwdsetting = '$pwdsetting' WHERE sitekey ='".SITEKEY."'");
165 275
 	}
166 276
 	else if($sect == "email") {
167
-		$smtp_host = $_POST['newsmtp_host'];
168
-		$smtp_username = $_POST['newsmtp_username'];
169
-		$smtp_password = $_POST['newsmtp_password'];
170
-		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET smtp_host = '$smtp_host', smtp_username = '$smtp_username', smtp_password = '$smtp_password' WHERE sitekey ='".SITEKEY."'");
277
+		$smtp_host = escapestring(descript(strip_tags($_POST['newsmtp_host'])));
278
+		$smtp_username = escapestring(descript(strip_tags($_POST['newsmtp_username'])));
279
+		$smtp_password = escapestring(descript(strip_tags($_POST['newsmtp_password'])));
280
+		$smtp_port = !empty($_POST['newsmtp_port']) ? (int) $_POST['newsmtp_port'] : '';
281
+		$smtp_secure = in_array($_POST['newsmtp_secure'], array('', 'tls', 'ssl'), true) ? $_POST['newsmtp_secure'] : '';
282
+		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET smtp_host = '$smtp_host', smtp_username = '$smtp_username', smtp_password = '$smtp_password', smtp_port = '$smtp_port', smtp_secure = '$smtp_secure' WHERE sitekey ='".SITEKEY."'");
171 283
 	}
172 284
 	if ($result) {
173 285
 		$output .= write_message(_ACTIONSUCCESSFUL);
174
-		
175
-		$idx = array_search($sect, $sects);
176
-		if ($idx !== false) {
177
-			$next_idx = $idx + 1;
178
-			if ($next_idx >= count($sects)) {
179
-				$next_idx = 0;
286
+		// The section-advance wizard is for the INSTALLER only (install/install.php
287
+		// includes this file and steps through sections). In admin, "email" is the
288
+		// last entry in $sects, so advancing would wrap to 0 and jump back to the
289
+		// first tab while the URL still says sect=email. $action is undefined in the
290
+		// installer include context, so guard with isset() to avoid a PHP 8 warning.
291
+		if (!isset($action) || $action != "settings") {
292
+			$idx = array_search($sect, $sects);
293
+			if ($idx !== false) {
294
+				$next_idx = $idx + 1;
295
+				if ($next_idx >= count($sects)) {
296
+					$next_idx = 0;
297
+				}
298
+				$sect = $sects[$next_idx];
180 299
 			}
181
-			$sect = $sects[$next_idx];
182 300
 		}
183 301
 	} else {
184 302
 		$output .= write_error(_ERROR);
... ...
@@ -190,8 +308,9 @@ if(isset($_POST['submit'])) {
190 308
 		if(is_NULL($val)) $val = '';
191 309
 		$$var = stripslashes($val );
192 310
 	}
311
+	}
193 312
 
194
-	$output .= "<form method='POST' class='tblborder' style='' enctype='multipart/form-data' action='".($action == "settings" ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&amp;sect=$sect'>";
313
+	$output .= "<form method='POST' class='tblborder' style='' enctype='multipart/form-data' action='".((isset($action) && $action == "settings") ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&amp;sect=$sect'>";
195 314
 	if($sect == "main") {
196 315
 		$output .= "<h2>"._SITEINFO."</h2>
197 316
 		<table class='acp'>
... ...
@@ -488,8 +607,32 @@ if(isset($_POST['submit'])) {
488 607
 				<td><label for='newsmtp_username'>"._SMTPUSER.":</label></td><td><input name='newsmtp_username' type='text' value='$smtp_username'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPUSER."</span></a></td>
489 608
 		</tr>
490 609
 		<tr>
491
-				<td><label for='newsmtp_password'>"._SMTPPASS.":</label></td><td><input name='newsmtp_password' type='password' value='$smtp_password'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPPWD."</span></a></td></tr>";		
610
+				<td><label for='newsmtp_password'>"._SMTPPASS.":</label></td><td><input name='newsmtp_password' type='password' value='$smtp_password'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPPWD."</span></a></td></tr>
611
+		<tr>
612
+				<td><label for='newsmtp_port'>"._SMTPPORT.":</label></td><td><input name='newsmtp_port' type='text' value='".((isset($smtp_port) && $smtp_port !== '') ? $smtp_port : '')."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPPORT."</span></a></td>
613
+		</tr>
614
+		<tr>
615
+				<td><label for='newsmtp_secure'>"._SMTPSECURE.":</label></td><td><select name='newsmtp_secure'>
616
+					<option value=''".((!isset($smtp_secure) || $smtp_secure === '') ? " selected" : "").">(none)</option>
617
+					<option value='tls'".((isset($smtp_secure) && $smtp_secure == 'tls') ? " selected" : "").">STARTTLS / 587</option>
618
+					<option value='ssl'".((isset($smtp_secure) && $smtp_secure == 'ssl') ? " selected" : "").">SSL / 465</option>
619
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPSECURE."</span></a></td></tr>";
492 620
 		$output .= 	write_message(_SMTPOFF);
493 621
 	}
494 622
 	$output .= "<tr><td colspan='2'><div align='center'><input type='submit' id='submit' class='button' name='submit' value='"._SUBMIT."'></div></form></td></tr></table>";
623
+	// The SMTP test button lives OUTSIDE the main settings form (nested forms are
624
+	// invalid HTML). It is its own POST mini-form -- a submit button, not a GET
625
+	// link -- so the outbound SMTP connection can't be triggered by a plain link
626
+	// or a browser prefetch. The existing testsmtp handler posts to the same URL.
627
+	if($sect == "email") {
628
+		$output .= "<h2>"._TESTSMTP_HEADER."</h2>
629
+		<ul>
630
+			<li>
631
+				<form method='POST' action='admin.php?action=settings&amp;sect=email' style='display:inline'>
632
+					<input type='submit' class='button' name='testsmtp' value='"._TESTSMTP."'>
633
+				</form>
634
+				<a href='#' class='pophelp'>[?]<span>"._HELP_TESTSMTP."</span></a>
635
+			</li>
636
+		</ul>";
637
+	}
495 638
 ?>
Browse code

#17 php warning fix

Jimako authored on 2026/04/29 10:53:51
Showing 1 changed files
... ...
@@ -169,13 +169,20 @@ if(isset($_POST['submit'])) {
169 169
 		$smtp_password = $_POST['newsmtp_password'];
170 170
 		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET smtp_host = '$smtp_host', smtp_username = '$smtp_username', smtp_password = '$smtp_password' WHERE sitekey ='".SITEKEY."'");
171 171
 	}
172
-	if($result) {
172
+	if ($result) {
173 173
 		$output .= write_message(_ACTIONSUCCESSFUL);
174
-		$sect = $sects[(array_search($sect, $sects) + 1)];
175
-		if(!$sect) $sect = $sects[0];
174
+		
175
+		$idx = array_search($sect, $sects);
176
+		if ($idx !== false) {
177
+			$next_idx = $idx + 1;
178
+			if ($next_idx >= count($sects)) {
179
+				$next_idx = 0;
180
+			}
181
+			$sect = $sects[$next_idx];
182
+		}
183
+	} else {
184
+		$output .= write_error(_ERROR);
176 185
 	}
177
-	else $output .= write_error(_ERROR);
178
-}
179 186
 	$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
180 187
 	$settings = dbassoc($settingsresults);
181 188
  
Browse code

Number of Likes

Jimako authored on 2024/05/24 17:54:38
Showing 1 changed files
... ...
@@ -431,7 +431,8 @@ if(isset($_POST['submit'])) {
431 431
 				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_REVDELETE."</span></a></td>
432 432
 		</tr>
433 433
 		<tr>
434
-				<td><label for='newratings'>"._WHATRATINGS.":</label></td><td><select name='newratings'>
434
+				<td><label for='newratings'>"._WHATRATINGS. ":</label></td><td><select name='newratings'>
435
+				<option value='3'" . ($ratings == "3" ? " selected" : "") . ">" . _LIKES_NUMBER . "</option>
435 436
 				<option value='2'".($ratings == "2" ? " selected" : "").">"._LIKESYS."</option>
436 437
 				<option value='1'".($ratings == "1" ? " selected" : "").">"._STARS."</option>
437 438
 				<option value='0'".($ratings == "0" ? " selected" : "").">"._NONE."</option>
Browse code

#2 fixed https url

Jimako authored on 2024/04/21 13:18:16
Showing 1 changed files
... ...
@@ -86,8 +86,8 @@ if(isset($_POST['submit'])) {
86 86
 			$sitename = escapestring(descript(strip_tags($_POST['newsitename'])));
87 87
 			$slogan = escapestring(descript(strip_tags($_POST['newslogan'])));
88 88
 			$url = escapestring(descript(strip_tags($_POST['newsiteurl'])));
89
-			// if the http:// is missing add it.
90
-			if(substr($url, 0, 7) != "http://") $url = "http://".$url;
89
+			// if the https:// is missing add it.
90
+			if(substr($url, 0, 8) != "https://" && substr($url, 0, 7) != "http://") $url = "https://".$url;
91 91
 			// we also want to check for a trailing slash.
92 92
 			if(substr($url, -1, 1) == "/") $url = substr($url, 0, strlen($url) - 1);
93 93
 			$tableprefix = escapestring(descript(strip_tags($_POST['newtableprefix'])));
... ...
@@ -484,4 +484,4 @@ if(isset($_POST['submit'])) {
484 484
 		$output .= 	write_message(_SMTPOFF);
485 485
 	}
486 486
 	$output .= "<tr><td colspan='2'><div align='center'><input type='submit' id='submit' class='button' name='submit' value='"._SUBMIT."'></div></form></td></tr></table>";
487
-?>
488 487
\ No newline at end of file
488
+?>
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,487 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+
27
+function updatePanelOrder( ) {
28
+	
29
+	$ptypes = dbquery("SELECT panel_type FROM ".TABLEPREFIX."fanfiction_panels GROUP BY panel_type");
30
+	while($ptype = dbassoc($ptypes)) {
31
+		if($ptype['panel_type'] == "A") {
32
+			for($x = 1; $x < 5; $x++) {
33
+				$count = 1;
34
+				$plist = dbquery("SELECT panel_name, panel_id FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden = '0' AND panel_type = '".$ptype['panel_type']."' AND panel_level = '$x' ORDER BY panel_level, panel_order");
35
+				while($p = dbassoc($plist)) {
36
+					dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_order = '$count' WHERE panel_id = '".$p['panel_id']."' LIMIT 1");
37
+					$count++;
38
+				}
39
+			}
40
+		}
41
+		else {
42
+			$count = 1;
43
+			$plist = dbquery("SELECT panel_name, panel_id FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden = '0' AND panel_type = '".$ptype['panel_type']."' ORDER BY ".($ptype['panel_type'] == "A" ? "panel_level," : "")."panel_order");
44
+			while($p = dbassoc($plist)) {
45
+				dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_order = '$count' WHERE panel_id = '".$p['panel_id']."' LIMIT 1");
46
+				$count++;
47
+			}
48
+		}
49
+	}
50
+}
51
+
52
+if($action == "settings") {
53
+$output .= "<h1>"._SETTINGS."</h1><div style='text-align: center;'>
54
+	<a href='admin.php?action=settings&amp;sect=main'>"._MAINSETTINGS."</a> |
55
+	<a href='admin.php?action=settings&amp;sect=submissions'>"._SUBMISSIONSETTINGS."</a> |
56
+	<a href='admin.php?action=settings&amp;sect=sitesettings'>"._SITESETTINGS."</a> |
57
+	<a href='admin.php?action=settings&amp;sect=display'>"._DISPLAYSETTINGS."</a> |
58
+	<a href='admin.php?action=settings&amp;sect=reviews'>"._REVIEWSETTINGS."</a> |
59
+	<a href='admin.php?action=settings&amp;sect=useropts'>"._USERSETTINGS."</a> |
60
+	<a href='admin.php?action=settings&amp;sect=email'>"._EMAILSETTINGS."</a> |
61
+	<a href='admin.php?action=censor'>"._CENSOR."</a> <br />
62
+	<a href='admin.php?action=messages&message=welcome'>"._WELCOME."</a> | 
63
+	<a href='admin.php?action=messages&message=copyright'>"._COPYRIGHT."</a> | 
64
+	<a href='admin.php?action=messages&message=printercopyright'>"._PRINTERCOPYRIGHT."</a> | 
65
+	<a href='admin.php?action=messages&message=tinyMCE'>"._TINYMCE."</a> | 
66
+	<a href='admin.php?action=messages&message=nothankyou'>"._NOTHANKYOU."</a> | 
67
+	<a href='admin.php?action=messages&message=thankyou'>"._THANKYOU."</a><br />";
68
+	$settingsquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_type = 'AS' ORDER BY panel_title");
69
+	while($os = dbassoc($settingsquery)) {
70
+		if($os['panel_url']) $othersettings[] = "<a href='".$os['panel_url']."'>".$os['panel_title']."</a>";
71
+	}
72
+	if(isset($othersettings)) $output .= implode(" | ", $othersettings);
73
+$output .= "</div> ";
74
+}	
75
+
76
+$sects = array("main", "submissions", "sitesettings", "display", "reviews", "useropts", "email");
77
+//if(!isset($_GET['sect'])) $sect = "main";
78
+//else $sect = $_GET['sect'];
79
+$sect = isset($_GET['sect']) ? $_GET['sect'] : "main";
80
+if(isset($_POST['submit'])) {
81
+	if($sect == "main") {
82
+		if(!preg_match("!^[a-z0-9_]{3,30}$!i", $_POST['newsitekey'])) $output .= write_error(_BADSITEKEY);
83
+		else {
84
+			$oldsitekey = $sitekey;
85
+			$sitekey = descript($_POST['newsitekey']);
86
+			$sitename = escapestring(descript(strip_tags($_POST['newsitename'])));
87
+			$slogan = escapestring(descript(strip_tags($_POST['newslogan'])));
88
+			$url = escapestring(descript(strip_tags($_POST['newsiteurl'])));
89
+			// if the http:// is missing add it.
90
+			if(substr($url, 0, 7) != "http://") $url = "http://".$url;
91
+			// we also want to check for a trailing slash.
92
+			if(substr($url, -1, 1) == "/") $url = substr($url, 0, strlen($url) - 1);
93
+			$tableprefix = escapestring(descript(strip_tags($_POST['newtableprefix'])));
94
+			$siteemail = escapestring(descript(strip_tags($_POST['newsiteemail'])));
95
+			$skin = escapestring(descript(strip_tags($_POST['newskin'])));
96
+			$language = escapestring(descript(strip_tags($_POST['newlanguage'])));
97
+			if(empty($sitekey)) $output .= write_message(_SITEKEYREQUIRED);
98
+			else {
99
+				if($sitekey != $oldsitekey) $output .= write_message(_SITEKEYCHANGED);
100
+				$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET sitekey = '$sitekey', sitename = '$sitename', slogan = '$slogan', url = '$url', tableprefix = '$tableprefix', siteemail = '$siteemail', skin = '$skin', language = '$language' WHERE sitekey = '$oldsitekey'");
101
+			}
102
+		}
103
+	}
104
+	else if($sect == "submissions") {
105
+		$submissionsoff = $_POST['newsubmissionsoff'] == 1 ? 1 : 0;
106
+		$autovalidate = $_POST['newautovalidate'] == 1 ? 1 : 0;
107
+		$coauthallowed = $_POST['newcoauthallowed'] == 1 ? 1 : 0;
108
+		$store = !empty($_POST['newstore']) ? ($_POST['newstore'] == "files" ? "files" : "mysql" ) : $store;
109
+		$storiespath = descript($_POST['newstoriespath']);
110
+		$minwords = isNumber($_POST['newminwords']) ? $_POST['newminwords'] : 0;
111
+		$maxwords = isNumber($_POST['newmaxwords']) ? $_POST['newmaxwords'] : 0;
112
+		$roundrobins = $_POST['newroundrobins'] == 1 ? 1 : 0;
113
+		$allowseries = $_POST['newallowseries'] && isNumber($_POST['newallowseries']) ? $_POST['newallowseries'] : 0;
114
+		$imageupload = $_POST['newimageupload'] == 1 ? 1 : 0;
115
+		$imageheight = isNumber($_POST['newimageheight']) ? $_POST['newimageheight'] : 0;
116
+		$imagewidth = isNumber($_POST['newimagewidth']) ? $_POST['newimagewidth'] : 0;
117
+		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET submissionsoff = '$submissionsoff', autovalidate = '$autovalidate', coauthallowed = '$coauthallowed', store = '$store', storiespath = '$storiespath', minwords = '$minwords', maxwords = '$maxwords', imageupload = '$imageupload', imageheight = '$imageheight', imagewidth = '$imagewidth', roundrobins = '$roundrobins', allowseries = '$allowseries' WHERE sitekey ='".SITEKEY."'");
118
+		if($action == "settings") {
119
+			dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_hidden = '".($imageupload ? "0" : "1")."' WHERE panel_name LIKE 'manageimages'");
120
+			dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_hidden = '".($allowseries ? "0" : "1")."' WHERE (panel_name LIKE '%series%' OR panel_title LIKE '%series%') AND panel_type != 'A' AND panel_type != 'B'");
121
+			updatePanelOrder( );
122
+		}
123
+
124
+	}
125
+	else if($sect == "sitesettings") {
126
+		$tinyMCE = ($_POST['newtinyMCE'] == 1  OR $_POST['newtinyMCE'] == 2) ? $_POST['newtinyMCE'] : 0;
127
+		$allowed_tags = $_POST['newallowed_tags'];
128
+		$favorites = $_POST['newfavorites'] == 1 ? 1 : 0;
129
+		$multiplecats = $_POST['newmultiplecats'] == 1 ? 1 : 0;
130
+		$newscomments = $_POST['newnewscomments'] == 1 ? 1 : 0;
131
+		$logging = $_POST['newlogging'] == 1 ? 1 : 0;
132
+		$maintenance = $_POST['newmaint'] == 1 ? 1 : 0;
133
+		$debug = $_POST['newdebug'] == 1 ? 1 : 0;
134
+		$captcha = $_POST['newcaptcha'] == 1 ? 1 : 0;
135
+		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET tinyMCE = '$tinyMCE', favorites = '$favorites', multiplecats = '$multiplecats', allowed_tags = '$allowed_tags', newscomments = '$newscomments', logging = '$logging', maintenance = '$maintenance', debug = '$debug', captcha = '$captcha' WHERE sitekey ='".SITEKEY."'");
136
+	}
137
+	else if($sect == "display") {
138
+		$dateformat = $_POST['newdateformat'] ? descript(strip_tags($_POST['newdateformat'])) : descript(strip_tags($_POST['customdateformat']));
139
+		$timeformat = $_POST['newtimeformat'] ? descript(strip_tags($_POST['newtimeformat'])) : descript(strip_tags($_POST['customtimeformat']));
140
+		$extendcats = $_POST['newextendcats'] == 1 ? 1 : 0;
141
+		if(isset($_POST['newdisplaycolumns']) && isNumber($_POST['newdisplaycolumns'])) $displaycolumns = $_POST['newdisplaycolumns'];
142
+		if(isset($_POST['newitemsperpage']) && isNumber($_POST['newitemsperpage'])) $itemsperpage = $_POST['newitemsperpage'];
143
+		if(isset($_POST['newlinkstyle']) && isNumber($_POST['newlinkstyle'])) $linkstyle = $_POST['newlinkstyle'];
144
+		if(isset($_POST['newlinkrange']) && isNumber($_POST['newlinkrange'])) $linkrange = $_POST['newlinkrange'];
145
+		$displayindex = $_POST['newstoryindex'] == 1 ? 1 : 0;
146
+		$displayprofile = $_POST['newdisplayprofile'] == 1 ? 1 : 0;
147
+		$defaultsort = $_POST['newdefaultsort'] == 1 ? 1 : 0;
148
+		if(isNumber($_POST['newrecentdays'])) $recentdays = $_POST['newrecentdays'];
149
+		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET dateformat = '$dateformat', timeformat = '$timeformat', extendcats = '$extendcats', displaycolumns = '$displaycolumns', itemsperpage = '$itemsperpage', displayindex = '$displayindex', defaultsort = '$defaultsort', recentdays = '$recentdays', displayprofile = '$displayprofile', linkstyle = '$linkstyle', linkrange = '$linkrange' WHERE sitekey ='".SITEKEY."'");
150
+	}
151
+	else if($sect == "reviews") {
152
+		$reviewsallowed = $_POST['newreviewsallowed'] == 1 ? 1 : 0;
153
+		$anonreviews = $_POST['newanonreviews'] == 1 ? 1 : 0;
154
+		$rateonly = $_POST['newrateonly'] == 1 ? 1 : 0;
155
+		$ratings = isset($_POST['newratings']) && isNumber($_POST['newratings']) ? $_POST['newratings'] : 0;
156
+		$revdelete = isset($_POST['newrevdelete']) && isNumber($_POST['newrevdelete']) ? $_POST['newrevdelete'] : 0;
157
+		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET reviewsallowed = '$reviewsallowed', anonreviews = '$anonreviews', rateonly = '$rateonly', ratings = '$ratings', revdelete = '$revdelete' WHERE sitekey ='".SITEKEY."'");
158
+	}
159
+	else if($sect == "useropts") {
160
+		$alertson = $_POST['newalertson'] == 1 ? 1 : 0;
161
+		$disablepopups = $_POST['newdisablepops'] == 1 ? 1 : 0;
162
+		$agestatement  = $_POST['newagestatement'] == 1 ? 1 : 0;
163
+		$pwdsetting = $_POST['newpwdsetting'] == 1 ? 1 : 0;
164
+		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET alertson = '$alertson', disablepopups = '$disablepopups', agestatement = '$agestatement', pwdsetting = '$pwdsetting' WHERE sitekey ='".SITEKEY."'");
165
+	}
166
+	else if($sect == "email") {
167
+		$smtp_host = $_POST['newsmtp_host'];
168
+		$smtp_username = $_POST['newsmtp_username'];
169
+		$smtp_password = $_POST['newsmtp_password'];
170
+		$result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET smtp_host = '$smtp_host', smtp_username = '$smtp_username', smtp_password = '$smtp_password' WHERE sitekey ='".SITEKEY."'");
171
+	}
172
+	if($result) {
173
+		$output .= write_message(_ACTIONSUCCESSFUL);
174
+		$sect = $sects[(array_search($sect, $sects) + 1)];
175
+		if(!$sect) $sect = $sects[0];
176
+	}
177
+	else $output .= write_error(_ERROR);
178
+}
179
+	$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
180
+	$settings = dbassoc($settingsresults);
181
+ 
182
+	foreach($settings as $var => $val) {
183
+		if(is_NULL($val)) $val = '';
184
+		$$var = stripslashes($val );
185
+	}
186
+
187
+	$output .= "<form method='POST' class='tblborder' style='' enctype='multipart/form-data' action='".($action == "settings" ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&amp;sect=$sect'>";
188
+	if($sect == "main") {
189
+		$output .= "<h2>"._SITEINFO."</h2>
190
+		<table class='acp'>
191
+			<tr>
192
+				<td><label for='newsitekey'>"._SITEKEY.":</label></td><td><input type='text' class='textbox' name='newsitekey' value='".SITEKEY."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEKEY."</span></a></td>
193
+			</tr>
194
+			<tr>
195
+				<td><label for='newsitename'>"._SITENAME.":</label></td><td><input type='text' class='textbox' name='newsitename' value='".htmlspecialchars($sitename, ENT_QUOTES)."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITENAME."</span></a></td>
196
+			</tr>
197
+			<tr>
198
+				<td><label for='newslogan'>"._SITESLOGAN.":</label></td><td><input type='text' class='textbox' name='newslogan' value='".htmlspecialchars($slogan, ENT_QUOTES)."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SLOGAN."</span></a></td>
199
+			</tr>
200
+			<tr>
201
+				<td><label for='newurl'>"._SITEURL.":</label></td><td><input type='text' class='textbox' name='newsiteurl' value='$url'> <a href='#' class='pophelp'>[?]<span>"._HELP_URL."</span></a></td>
202
+			</tr>
203
+			<tr>				
204
+				<td><label for='newtableprefix'>"._TABLEPREFIX.":</label></td><td><input type='text' class='textbox' name='newtableprefix' value='".TABLEPREFIX."'> <a href='#' class='pophelp'>[?]<span>"._HELP_TABLEPREFIX."</span></a></td>
205
+			</tr>
206
+			<tr>				
207
+				<td><label for='newsiteemail'>"._ADMINEMAIL.":</label></td><td><input type='text' class='textbox' name='newsiteemail' value='$siteemail'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEEMAIL."</span></a></td>
208
+			</tr>
209
+			<tr>				
210
+				<td><label for='newsiteskin'>"._DEFAULTSKIN.":</label></td><td><select name='newskin'>";
211
+		$directory = opendir(_BASEDIR."skins");
212
+		while($filename = readdir($directory)) {
213
+			if($filename=="." || $filename==".." || !is_dir(_BASEDIR."skins/".$filename)) continue;
214
+			$output .= "<option value='$filename'".($skin == $filename ? " selected" : "").">$filename</option>";
215
+		}
216
+		closedir($directory);
217
+		$output .= "</select> <a href='#' class='pophelp'>[?]<span>"._HELP_SITESKIN."</span></a></td>
218
+			</tr>
219
+			<tr>
220
+				<td><label for='newlanguage'>"._LANGUAGE.":</label></td><td><select name='newlanguage'>";
221
+		$directory = opendir(_BASEDIR."languages");
222
+			while($filename = readdir($directory)) {
223
+				if($filename=="." || $filename==".." || substr($filename, 2) == "_admin.php") continue;
224
+				$output .= "<option value='".substr($filename, 0, 2)."'".
225
+					($language == substr($filename, 0, strpos($filename, ".php")) ? " selected" : "").">
226
+				".substr($filename, 0, strpos($filename, ".php"))."</option>";
227
+			}
228
+		closedir($directory);
229
+		$output .= "</select> <a href='#' class='pophelp'>[?]<span>"._HELP_LANGUAGE."</span></a></td></tr>";
230
+	}
231
+	else if($sect == "submissions") {
232
+		$output .= "<h2>"._SUBMISSIONSETTINGS."</h2>
233
+		<table class='acp'>
234
+			<tr>
235
+				<td><label for='newsubmissionsoff'>"._NOSUBS.":</label></td><td><select name='newsubmissionsoff'>
236
+				<option value='1'".($submissionsoff == "1" ? " selected" : "").">"._YES."</option>
237
+				<option value='0'".($submissionsoff == "0" ? " selected" : "").">"._NO."</option>
238
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_SUBSOFF."</span></a></td>
239
+			</tr>
240
+			<tr>
241
+				<td><label for='newautovalidate'>"._AUTOVALIDATE.":</label></td><td><select name='newautovalidate'>
242
+				<option value='1'".($autovalidate == "1" ? "selected" : "").">"._YES."</option>
243
+				<option value='0'".($autovalidate == "0" ? "selected" : "").">"._NO."</option>
244
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_AUTOVALIDATE."</span></a></td>
245
+			</tr>		
246
+			<tr>
247
+				<td><label for='newcoauthallowed'>"._COAUTHALLOW.":</label></td><td><select name='newcoauthallowed'>
248
+				<option value='1'".($coauthallowed == "1" ? "selected" : "").">"._YES."</option>
249
+				<option value='0'".($coauthallowed == "0" ? "selected" : "").">"._NO."</option>
250
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_COAUTHORS."</span></a></td>
251
+			</tr>			
252
+			<tr>
253
+				<td><label for='newroundrobins'>"._ALLOWRR.":</label></td><td><select name='newroundrobins'>
254
+				<option value='1'".($roundrobins == "1" ? " selected" : "").">"._YES."</option>
255
+				<option value='0'".($roundrobins == "0" ? " selected" : "").">"._NO."</option>
256
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_ROUNDROBINS."</span></a></td>
257
+			</tr>			
258
+			<tr>
259
+				<td><label for='newallowseries'>"._ALLOWSERIES.":</label></td><td><select name='newallowseries'>
260
+				<option value='2'".($allowseries == "2" ? " selected" : "").">"._ALLMEMBERS."</option>
261
+				<option value='1'".($allowseries == "1" ? " selected" : "").">"._AUTHORSONLY."</option>
262
+				<option value='0'".($allowseries == "0" ? " selected" : "").">"._ADMINS."</option>
263
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_ALLOWSERIES."</span></a></td>
264
+			</tr>
265
+			<tr>
266
+				<td><label for='newimageupload'>"._IMAGEUPLOAD.":</label></td><td><select name='newimageupload'>
267
+				<option value='1'".($imageupload == "1" ? " selected" : "").">"._YES."</option>
268
+				<option value='0'".($imageupload == "0" ? " selected" : "").">"._NO."</option>
269
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGEUPLOAD."</span></a></td>
270
+			</tr>
271
+			<tr>
272
+				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._IMAGESIZE." <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGESIZE."</span></a></legend>
273
+				<label for='newimageheight'>"._MAXHEIGHT.":</label> <input  type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br />
274
+				<label for='newimagewidth'>"._MAXWIDTH.":</label> <input  type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td>
275
+			</tr>
276
+			<tr>
277
+				<td><label for='newstore'>"._HOWSTORE.":</label></td><td><select name='newstore' onChange='if (this.disabled) this.selectedIndex=0' disabled>
278
+					<option value='files'".($store == "files" || !$store ? " selected" : "").">"._FILES."</option>
279
+					<option value='mysql'".($store == "mysql" ? " selected" : "").">"._MYSQL."</option>
280
+					</select> <input class='textbox=' type='checkbox' class='checkbox' name='r1' onClick='this.form.newstore.disabled=false' checked> <a href='#' class='pophelp'>[?]<span>"._HELP_STORE."</span></a></td>
281
+			</tr>
282
+			<tr>
283
+				<td><label for='newstoriespath'>"._STORIESPATH.":</label></td><td><input type='text' class='textbox=' name='newstoriespath' value='$storiespath'> <a href='#' class='pophelp'>[?]<span>"._HELP_STORIESPATH."</span></a></td>
284
+			</tr>
285
+			<tr>
286
+				<td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend>
287
+				<label for='newminwords'>"._MIN.":</label> <input  type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br />
288
+				<label for='newmaxwords'>"._MAX.":</label> <input  type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>";
289
+	}
290
+	else if($sect == "sitesettings") {
291
+		$output .= "<h2>"._SITESETTINGS."</h2>
292
+		<table class='acp'>
293
+			<tr>
294
+				<td><label for='newtinyMCE'>"._USETINYMCE. ": </label></td><td><select name='newtinyMCE'>
295
+				<option value=\"2\"" . ($tinyMCE == 2 ? " selected" : "") . ">TinyMce4</option>
296
+				<option value=\"1\"" . ($tinyMCE == 1 ? " selected" : "") . ">TinyMce3</option>
297
+				<option value=\"0\"" . (!$tinyMCE ? " selected" : "") . ">" . _NO . "</option>
298
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_TINYMCE." "._TINYMCENOTE."</span></a></td>
299
+			</tr>
300
+			<tr>
301
+				<td><label for='newallowed_tags'>"._TAGS.": </label></td><td><input type='text' class='textbox'  name='newallowed_tags' value='".($allowed_tags ? $allowed_tags : "<strong><em><br /><br><blockquote><strike><font><b><i><u><center><img><a><hr><p><ul><li><ol>")."' size='40'> <a href='#' class='pophelp'>[?]<span>"._HELP_ALLOWEDTAGS." "._TINYMCENOTE."</span></a></td>
302
+			</tr>
303
+			<tr>
304
+				<td><label for='newfavorites'>"._FAVORITES.": </label></td><td><select name='newfavorites'>
305
+				<option value='1'".($favorites == "1" ? " selected" : "").">"._YES."</option>
306
+				<option value='0'".($favorites == "0" ? " selected" : "").">"._NO."</option>
307
+				</select><a href='#' class='pophelp'>[?]<span>"._HELP_FAVORITES."</span></a></td>
308
+			</tr>
309
+			<tr>
310
+				<td><label for='newmultplecats'>"._NUMCATS.": </label></td><td><select name='newmultiplecats'>
311
+				<option value='1'".($multiplecats == "1" ? "selected" : "").">"._MORETHANONE."</option>
312
+				<option value='0'".($multiplecats == "0" ? "selected" : "").">"._ONLYONE."</option>
313
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_NUMCATS."</span></a></td>
314
+			</tr>
315
+			<tr>
316
+				<td><label for='newnewscomments'>"._NEWSCOMMENTS.": </label></td><td><select name='newnewscomments'>
317
+				<option value='1'".($newscomments == "1" ? " selected" : "").">"._YES."</option>
318
+				<option value='0'".($newscomments == "0" ? " selected" : "").">"._NO."</option>
319
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_NEWSCOMMENTS."</span></a></td>
320
+			</tr>
321
+			<tr>
322
+				<td><label for='newlogging'>"._LOGGING.": </label></td><td><select name='newlogging'>
323
+				<option value='1'".($logging == "1" ? " selected" : "").">"._YES."</option>
324
+				<option value='0'".($logging == "0" ? " selected" : "").">"._NO."</option>
325
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_LOGGING."</span></a></td>
326
+			</tr>
327
+			<tr>
328
+				<td><label for='newmaint'>"._MAINTENANCE.": </label></td><td><select name='newmaint'>
329
+				<option value='1'".($maintenance == "1" ? " selected" : "").">"._YES."</option>
330
+				<option value='0'".($maintenance == "0" ? " selected" : "").">"._NO."</option>
331
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_MAINTENANCE."</span></a></td>
332
+			</tr>
333
+			<tr>
334
+				<td><label for='newdebug'>"._DEBUG.": </label></td><td><select name='newdebug'>
335
+				<option value='1'".($debug == "1" ? " selected" : "").">"._YES."</option>
336
+				<option value='0'".(!isset($debug) || $debug == "0" ? " selected" : "").">"._NO."</option>
337
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_DEBUG."</span></a></td>
338
+			</tr>
339
+			<tr>
340
+				<td><label for='newcaptcha'>"._CAPTCHA.": </label></td><td><select name='newcaptcha'>
341
+				<option value='1'".($captcha == "1" ? " selected" : "").">"._YES."</option>
342
+				<option value='0'".(!isset($captcha) || $captcha == "0" ? " selected" : "").">"._NO."</option>
343
+				</select><a href='#' class='pophelp'>[?]<span>"._HELP_CAPTCHA."</span></a></td></tr>";
344
+	}
345
+	else if($sect == "display") {
346
+		$settings = dbquery("SELECT defaultsort, displayindex FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
347
+		list($sitedefaultsort, $sitedisplayindex) = dbrow($settings);
348
+		$defaultdates = array("m/d/y", "m/d/Y", "m/d/Y", "d/m/Y", "d/m/y", "d M Y", 
349
+				"d.m.y", "Y.m.d", "m.d.Y", "d-m-y", "m-d-y", "M d Y", "M d, Y", "F d Y", "F d, Y");
350
+		$defaulttimes = array("h:i a", "h:i A", "H:i", "g:i a", "g:i A", "G:i", "h:i:s a", "H:i:s", "g:i:s a", "g:i:s A", "G:i:s");
351
+		$output .= "<h2>"._DISPLAYSETTINGS."</h2>
352
+		<table class='acp'>
353
+			<tr>
354
+				<td><label for='newdateformat'>"._DATEFORMAT.":</label></td><td><select name='newdateformat'><option value=''>"._SELECTONE."</option>";
355
+		foreach($defaultdates as $date) {
356
+			$output .= "<option value='$date'>".date("$date")."</option>";
357
+		}
358
+		$output .= "</select> "._OR." <input type='text' name='customdateformat' class='textbox' value='$dateformat'> <a href='#' class='pophelp'>[?]<span>"._HELP_DATEFORMAT."</span></a></td>
359
+		</tr>
360
+		<tr>
361
+			<td><label for='newtimeformat'>"._TIMEFORMAT.":</label></td><td><select name='newtimeformat'><option value=''>"._SELECTONE."</option>";
362
+		foreach($defaulttimes as $time) {
363
+			$output .= "<option value='$time'>".date("$time")."</option>";
364
+		}
365
+		$output .= "
366
+			</select> "._OR." <input type='text' name='customtimeformat' class='textbox' value='$timeformat'> <a href='#' class='pophelp'>[?]<span>"._HELP_TIMEFORMAT."</span></a></td>
367
+		</tr>
368
+		<tr>
369
+			<td><label for='newextendcats'>"._EXTENDCATS.":</label></td><td><select name='newextendcats'>
370
+				<option value='1'".($extendcats == "1" ? " selected" : "").">"._YES."</option>
371
+				<option value='0'".($extendcats == "0" ? " selected" : "").">"._NO."</option>
372
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_EXTENDCATS."</span></a></td>
373
+		</tr>
374
+		<tr>
375
+			<td><label for='newdisplaycolumns'>"._COLUMNS.":</label></td><td><input  type='text' class='textbox=' name='newdisplaycolumns' size='3' value='$displaycolumns'> <a href='#' class='pophelp'>[?]<span>"._HELP_COLUMNS."</span></a></td>
376
+		</tr>
377
+		<tr>
378
+			<td><label for='newitemsperpage'>"._NUMITEMS.":</label></td><td><input  type='text' class='textbox' name='newitemsperpage' size='3' value='$itemsperpage'> <a href='#' class='pophelp'>[?]<span>"._HELP_ITEMSPERPAGE."</span></a></td>
379
+		</tr>
380
+		<tr>
381
+			<td><label for='newrecentdays'>"._RECENTDAYS.":</label></td><td><input  type='text' class='textbox' name='newrecentdays' size='3' value='$recentdays'> <a href='#' class='pophelp'>[?]<span>"._HELP_RECENTDAYS."</span></a></td>
382
+		</tr>
383
+		<tr>
384
+			<td><label for='newdefaultsort'>"._DEFAULTSORT.":</label></td><td><select name='newdefaultsort'>
385
+				<option value='1'".($sitedefaultsort ? " selected" : "").">"._MOSTRECENT."</option>
386
+				<option value='0'".(!$sitedefaultsort ? " selected" : "").">"._ALPHA."</option>
387
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_DEFAULTSORT."</span></a></td>
388
+		</tr>
389
+		<tr>
390
+			<td><label for='newdisplayindex'>"._STORYINDEX.":</label></td><td><select name='newstoryindex'>
391
+				<option value='1'".($sitedisplayindex ? " selected" : "").">"._YES."</option>
392
+				<option value='0'".(!$sitedisplayindex ? " selected" : "").">"._NO."</option>
393
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_DISPLAYINDEX."</span></a></td>
394
+		</tr>
395
+		<tr>
396
+			<td><label for='newdisplayprofile'>"._DISPLAYPROFILE.":</label></td><td><select name='newdisplayprofile'>
397
+				<option value='1'".($displayprofile ? " selected" : "").">"._YES."</option>
398
+				<option value='0'".(!$displayprofile ? " selected" : "").">"._NO."</option>
399
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_DISPLAYPROFILE."</span></a></td>
400
+		</tr>
401
+		<tr>
402
+			<td><label for='newdisplayprofile'>"._LINKSTYLE.":</label></td><td><select name='newlinkstyle'>
403
+				<option value='2'".($linkstyle == 2 ? " selected" : "").">"._BOTHLINKSTYLE."</option>
404
+				<option value='1'".($linkstyle == 1 ? " selected" : "").">"._FIRSTLAST."</option>
405
+				<option value='0'".(!$linkstyle ? " selected" : "").">"._NEXTPREV."</option>
406
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_LINKSTYLE."</span></a></td>
407
+		</tr>
408
+		<tr>
409
+			<td><label for='newlinkrange'>"._LINKRANGE.":</label></td><td><input  type='text' class='textbox=' name='newlinkrange' size='3' value='$linkrange'> <a href='#' class='pophelp'>[?]<span>"._HELP_LINKRANGE."</span></a></td></tr>";
410
+	}
411
+	else if($sect == "reviews") {
412
+		$output .= "<h2>"._REVIEWSETTINGS."</h2>
413
+		<table class='acp'>
414
+			<tr>
415
+				<td><label for='newreviewsallowed'>"._ONREVIEWS.":</label></td><td><select name='newreviewsallowed'>
416
+				<option value='1'".($reviewsallowed == "1" ? " selected" : "").">"._YES."</option>
417
+				<option value='0'".($reviewsallowed == "0" ? " selected" : "").">"._NO."</option>
418
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_REVIEWSON."</span></a></td>
419
+		</tr>
420
+		<tr>
421
+				<td><label for='newanonreviews'>"._ANONREVIEWS.":</label></td><td><select name='newanonreviews'>
422
+				<option value='1'".($anonreviews == "1" ? " selected" : "").">"._YES."</option>
423
+				<option value='0'".($anonreviews == "0" ? " selected" : "").">"._NO."</option>
424
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_ANONREVIEWS."</span></a></td>
425
+		</tr>
426
+		<tr>
427
+				<td><label for='newrevdelete'>"._REVDELETE.":</label></td><td><select name='newrevdelete'>
428
+				<option value='2'".($revdelete == 2 ? " selected" : "").">"._ALLREV."</option>
429
+				<option value='1'".($revdelete == 1 ? " selected" : "").">"._ANONREV."</option>
430
+				<option value='0'".(empty($revdelete) ? " selected" : "").">"._NONE."</option>
431
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_REVDELETE."</span></a></td>
432
+		</tr>
433
+		<tr>
434
+				<td><label for='newratings'>"._WHATRATINGS.":</label></td><td><select name='newratings'>
435
+				<option value='2'".($ratings == "2" ? " selected" : "").">"._LIKESYS."</option>
436
+				<option value='1'".($ratings == "1" ? " selected" : "").">"._STARS."</option>
437
+				<option value='0'".($ratings == "0" ? " selected" : "").">"._NONE."</option>
438
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_RATINGS."</span></a></td>
439
+		</tr>
440
+		<tr>
441
+				<td><label for='newrateonly'>"._ALLOWRATEONLY.":</label></td><td><select name='newrateonly'>
442
+				<option value='1'".($rateonly == "1" ? " selected" : "").">"._YES."</option>
443
+				<option value='0'".($rateonly == "0" ? " selected" : "").">"._NO."</option>
444
+				</select> <a href='#' class='pophelp'>[?]<span>"._HELP_RATEONLY."</span></a></td></tr>";
445
+	}
446
+	else if($sect == "useropts") {
447
+		$output .= "<h2>"._USERSETTINGS."</h2>
448
+		<table class='acp'>
449
+			<tr>
450
+				<td><label for='newalertson'>"._ALERTSON.":</label></td><td><select name='newalertson'>
451
+				<option value='1'".($alertson == "1" ? " selected" : "").">"._YES."</option>
452
+				<option value='0'".($alertson == "0" ? " selected" : "").">"._NO."</option>
453
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_ALERTSON."</span></a></td>
454
+		</tr>
455
+		<tr>
456
+				<td><label for='newdisablepops'>"._USERPOPS.":</label></td><td><select name='newdisablepops'>
457
+				<option value='1'".($disablepopups ? " selected" : "").">"._YES."</option>
458
+				<option value='0'".(!$disablepopups ? " selected" : "").">"._NO."</option>
459
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_POPUPS."</span></a></td>
460
+		</tr>
461
+		<tr>
462
+				<td><label for='newagestatement'>"._AGESTATEMENT.":</label></td><td><select name='newagestatement'>
463
+				<option value='1'".($agestatement ? " selected" : "").">"._YES."</option>
464
+				<option value='0'".(!$agestatement ? " selected" : "").">"._NO."</option>
465
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_AGECONSENT."</span></a></td>
466
+		</tr>
467
+		<tr>
468
+				<td><label for='newpwdsetting'>"._PWDSETTING.":</label></td><td><select name='newpwdsetting'>
469
+				<option value='1'".($pwdsetting ? " selected" : "").">"._SELF."</option>
470
+				<option value='0'".(!$pwdsetting ? " selected" : "").">"._RANDOM."</option>
471
+			</select> <a href='#' class='pophelp'>[?]<span>"._HELP_PWD."</span></a></td></tr>";
472
+	}
473
+	else if($sect == "email") {
474
+		$output .= "<h2>"._EMAILSETTINGS."</h2>
475
+		<table class='acp'>
476
+			<tr>
477
+				<td><label for='newsmtp_host'>"._SMTPHOST.":</label></td><td><input name='newsmtp_host' type='text' value='$smtp_host'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPHOST."</span></a></td>
478
+		</tr>
479
+		<tr>
480
+				<td><label for='newsmtp_username'>"._SMTPUSER.":</label></td><td><input name='newsmtp_username' type='text' value='$smtp_username'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPUSER."</span></a></td>
481
+		</tr>
482
+		<tr>
483
+				<td><label for='newsmtp_password'>"._SMTPPASS.":</label></td><td><input name='newsmtp_password' type='password' value='$smtp_password'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPPWD."</span></a></td></tr>";		
484
+		$output .= 	write_message(_SMTPOFF);
485
+	}
486
+	$output .= "<tr><td colspan='2'><div align='center'><input type='submit' id='submit' class='button' name='submit' value='"._SUBMIT."'></div></form></td></tr></table>";
487
+?>
0 488
\ No newline at end of file