Browse code

fixed blocks for PHP 8.1

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