Browse code

blocks/random/admin.php: Formatting changes

Clarissa Walker authored on 2026/09/24 10:00:37
Showing 1 changed files
... ...
@@ -26,12 +26,12 @@ if(!empty($blocks['random']['tpl'])) $tpl->gotoBlock("_ROOT");
26 26
 	}
27 27
 	else  {
28 28
 		$output .= "<div style='text-align: center;'><b>"._CURRENT.":</b><br /><div class=\"tblborder\" style=\"width: 80%; margin: 1ex auto; text-align: left;\">".(!empty($blocks['random']['tpl']) ? _NATPL : $content)."</div><br /></div>";
29
-		$output .= "<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=random\">
29
+		$output .= "<div id='settingsform' style=\"width: 35em; margin-right: -2%;\"><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=random\">
30 30
 			<label for=\"tpl\">"._BLOCKTYPE.":</label><select class=\"textbox\" name=\"tpl\" id=\"tpl\"><option value=\"0\"".(empty($blocks['random']['tpl']) ? " selected" : "").">"._DEFAULT."</option>
31 31
 					<option value=\"1\"".(!empty($blocks['random']['tpl']) ? " selected" : "").">"._USETPL."</option></select><br />
32 32
 			<label for=\"allowtags\">"._TAGS.":</label><select class=\"textbox\" name=\"allowtags\" id=\"allowtags\"><option value=\"0\"".(empty($blocks['random']['allowtags']) ? " selected" : "").">"._STRIPTAGS."</option>
33 33
 					<option value=\"1\"".(!empty($blocks['random']['allowtags']) ? " selected" : "").">"._ALLOWTAGS."</option></select><br />
34 34
 			<label for=\"sumlength\">"._SUMLENGTH.":</label><input type=\"text\" class=\"textbox\" name=\"sumlength\" id=\"sumlength\" size=\"4\" value=\"".(!empty($blocks['random']['sumlength']) ? $blocks['random']['sumlength'] : "")."\"><br />
35
-			<INPUT type=\"submit\" name=\"submit\" id=\"submit\" class=\"button\" value=\""._SUBMIT."\"></form></div><div style='text-align: center;'>"._SUMNOTE."</div>";
35
+			<INPUT type=\"submit\" name=\"submit\" id=\"submit\" style=\"margin-left: 31.8%; margin-top: 0.3em;\" class=\"button\" value=\""._SUBMIT."\"></form></div><div style='text-align: center;'>"._SUMNOTE."</div>";
36 36
 	}
37
-?>
38 37
\ No newline at end of file
38
+?>
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,37 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+
4
+global $language;
5
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'random'");
6
+while($block = dbassoc($blockquery)) {
7
+	if ($block['block_variables'])
8
+	{
9
+		$blocks[$block['block_name']] = unserialize($block['block_variables']);
10
+	}
11
+	$blocks[$block['block_name']]['title'] = $block['block_title'];
12
+	 $blocks[$block['block_name']]['file'] = $block['block_file'];
13
+	$blocks[$block['block_name']]['status'] = $block['block_status'];
14
+}
15
+include("blocks/".$blocks['random']['file']);
16
+if(!empty($blocks['random']['tpl'])) $tpl->gotoBlock("_ROOT");
17
+	if(isset($_POST['submit'])) {
18
+		if($_POST['tpl']) $blocks['random']['tpl'] = 1;
19
+		else unset($blocks['random']['tpl']);
20
+		if($_POST['allowtags']) $blocks['random']['allowtags'] = 1;
21
+		else unset($blocks['random']['allowtags']);
22
+		if(isset($_POST['sumlength']) && isNumber($_POST['sumlength'])) $blocks['random']['sumlength'] = $_POST['sumlength'];
23
+		else unset($blocks['random']['sumlength']);
24
+		$output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>";
25
+		save_blocks( $blocks );
26
+	}
27
+	else  {
28
+		$output .= "<div style='text-align: center;'><b>"._CURRENT.":</b><br /><div class=\"tblborder\" style=\"width: 80%; margin: 1ex auto; text-align: left;\">".(!empty($blocks['random']['tpl']) ? _NATPL : $content)."</div><br /></div>";
29
+		$output .= "<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=random\">
30
+			<label for=\"tpl\">"._BLOCKTYPE.":</label><select class=\"textbox\" name=\"tpl\" id=\"tpl\"><option value=\"0\"".(empty($blocks['random']['tpl']) ? " selected" : "").">"._DEFAULT."</option>
31
+					<option value=\"1\"".(!empty($blocks['random']['tpl']) ? " selected" : "").">"._USETPL."</option></select><br />
32
+			<label for=\"allowtags\">"._TAGS.":</label><select class=\"textbox\" name=\"allowtags\" id=\"allowtags\"><option value=\"0\"".(empty($blocks['random']['allowtags']) ? " selected" : "").">"._STRIPTAGS."</option>
33
+					<option value=\"1\"".(!empty($blocks['random']['allowtags']) ? " selected" : "").">"._ALLOWTAGS."</option></select><br />
34
+			<label for=\"sumlength\">"._SUMLENGTH.":</label><input type=\"text\" class=\"textbox\" name=\"sumlength\" id=\"sumlength\" size=\"4\" value=\"".(!empty($blocks['random']['sumlength']) ? $blocks['random']['sumlength'] : "")."\"><br />
35
+			<INPUT type=\"submit\" name=\"submit\" id=\"submit\" class=\"button\" value=\""._SUBMIT."\"></form></div><div style='text-align: center;'>"._SUMNOTE."</div>";
36
+	}
37
+?>
0 38
\ No newline at end of file