Browse code

fixed blocks for PHP 8.1

Jimmi08 authored on 2023/02/19 13:27:16
Showing 1 changed files
... ...
@@ -1,34 +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
-	$blocks[$block['block_name']] = unserialize($block['block_variables']);
8
-	$blocks[$block['block_name']]['title'] = $block['block_title'];
9
-	 $blocks[$block['block_name']]['file'] = $block['block_file'];
10
-	$blocks[$block['block_name']]['status'] = $block['block_status'];
11
-}
12
-include("blocks/".$blocks['random']['file']);
13
-if(!empty($blocks['random']['tpl'])) $tpl->gotoBlock("_ROOT");
14
-	if(isset($_POST['submit'])) {
15
-		if($_POST['tpl']) $blocks['random']['tpl'] = 1;
16
-		else unset($blocks['random']['tpl']);
17
-		if($_POST['allowtags']) $blocks['random']['allowtags'] = 1;
18
-		else unset($blocks['random']['allowtags']);
19
-		if(isset($_POST['sumlength']) && isNumber($_POST['sumlength'])) $blocks['random']['sumlength'] = $_POST['sumlength'];
20
-		else unset($blocks['random']['sumlength']);
21
-		$output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>";
22
-		save_blocks( $blocks );
23
-	}
24
-	else  {
25
-		$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>";
26
-		$output .= "<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=random\">
27
-			<label for=\"tpl\">"._BLOCKTYPE.":</label><select class=\"textbox\" name=\"tpl\" id=\"tpl\"><option value=\"0\"".(empty($blocks['random']['tpl']) ? " selected" : "").">"._DEFAULT."</option>
28
-					<option value=\"1\"".(!empty($blocks['random']['tpl']) ? " selected" : "").">"._USETPL."</option></select><br />
29
-			<label for=\"allowtags\">"._TAGS.":</label><select class=\"textbox\" name=\"allowtags\" id=\"allowtags\"><option value=\"0\"".(empty($blocks['random']['allowtags']) ? " selected" : "").">"._STRIPTAGS."</option>
30
-					<option value=\"1\"".(!empty($blocks['random']['allowtags']) ? " selected" : "").">"._ALLOWTAGS."</option></select><br />
31
-			<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 />
32
-			<INPUT type=\"submit\" name=\"submit\" id=\"submit\" class=\"button\" value=\""._SUBMIT."\"></form></div><div style='text-align: center;'>"._SUMNOTE."</div>";
33
-	}
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
+	}
34 37
 ?>
35 38
\ No newline at end of file
Browse code

Initial uplad w/ php7 fixes

Rainer Volkrodt authored on 2016/03/12 15:54:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,34 @@
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
+	$blocks[$block['block_name']] = unserialize($block['block_variables']);
8
+	$blocks[$block['block_name']]['title'] = $block['block_title'];
9
+	 $blocks[$block['block_name']]['file'] = $block['block_file'];
10
+	$blocks[$block['block_name']]['status'] = $block['block_status'];
11
+}
12
+include("blocks/".$blocks['random']['file']);
13
+if(!empty($blocks['random']['tpl'])) $tpl->gotoBlock("_ROOT");
14
+	if(isset($_POST['submit'])) {
15
+		if($_POST['tpl']) $blocks['random']['tpl'] = 1;
16
+		else unset($blocks['random']['tpl']);
17
+		if($_POST['allowtags']) $blocks['random']['allowtags'] = 1;
18
+		else unset($blocks['random']['allowtags']);
19
+		if(isset($_POST['sumlength']) && isNumber($_POST['sumlength'])) $blocks['random']['sumlength'] = $_POST['sumlength'];
20
+		else unset($blocks['random']['sumlength']);
21
+		$output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>";
22
+		save_blocks( $blocks );
23
+	}
24
+	else  {
25
+		$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>";
26
+		$output .= "<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=random\">
27
+			<label for=\"tpl\">"._BLOCKTYPE.":</label><select class=\"textbox\" name=\"tpl\" id=\"tpl\"><option value=\"0\"".(empty($blocks['random']['tpl']) ? " selected" : "").">"._DEFAULT."</option>
28
+					<option value=\"1\"".(!empty($blocks['random']['tpl']) ? " selected" : "").">"._USETPL."</option></select><br />
29
+			<label for=\"allowtags\">"._TAGS.":</label><select class=\"textbox\" name=\"allowtags\" id=\"allowtags\"><option value=\"0\"".(empty($blocks['random']['allowtags']) ? " selected" : "").">"._STRIPTAGS."</option>
30
+					<option value=\"1\"".(!empty($blocks['random']['allowtags']) ? " selected" : "").">"._ALLOWTAGS."</option></select><br />
31
+			<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 />
32
+			<INPUT type=\"submit\" name=\"submit\" id=\"submit\" class=\"button\" value=\""._SUBMIT."\"></form></div><div style='text-align: center;'>"._SUMNOTE."</div>";
33
+	}
34
+?>
0 35
\ No newline at end of file