Browse code

fixed blocks for PHP 8.1

Jimmi08 authored on 2023/02/19 13:27:16
Showing 1 changed files
... ...
@@ -1,28 +1,31 @@
1
-<?php
2
-if(!defined("_CHARSET")) exit( );
3
-$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'news'");
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
-global $language, $numupdated;
11
-include("blocks/".$blocks['news']['file']);
12
-	if(isset($_POST['submit'])) {
13
-		if(isset($_POST['num']) && isNumber($_POST['num'])) $blocks['news']['num'] = $_POST['num'];
14
-		else $blocks['news']['num'] = 1;
15
-		if(isset($_POST['sumlength']) && isNumber($_POST['sumlength'])) $blocks['news']['sumlength'] = $_POST['sumlength'];
16
-		else unset($blocks['news']['sumlength']);
17
-		$output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>";
18
-		save_blocks( $blocks );
19
-	}
20
-	else  {
21
-		if(!isset($blocks['news']['sumlength'])) $blocks['news']['sumlength'] = "";
22
-		$output .= "<div style='text-align: center;'><b>"._CURRENT.":</b><br /><div class=\"tblborder\" style=\"width: 80%; margin: 0 auto; text-align: left;\">$content</div><br /></div>";
23
-		$output .= "<div><div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=news\">
24
-			<div><label for=\"num\">"._NUMNEWS.":</label><input type=\"text\" class=\"textbox\" name=\"num\" id=\"num\" size=\"4\" value=\"".$blocks['news']['num']."\"></div>
25
-		<div><label for=\"num\">"._SUMLENGTH.":</label><input type=\"text\" class=\"textbox\" name=\"sumlength\" id=\"sumlength\" size=\"6\" value=\"".$blocks['news']['sumlength']."\"></div>
26
-			<INPUT type=\"submit\" name=\"submit\" class=\"button\" id=\"submit\" value=\""._SUBMIT."\"></form></div><div style='clear: both;'></div></div>";
27
-	}
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'news'");
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
+global $language, $numupdated;
14
+include("blocks/".$blocks['news']['file']);
15
+	if(isset($_POST['submit'])) {
16
+		if(isset($_POST['num']) && isNumber($_POST['num'])) $blocks['news']['num'] = $_POST['num'];
17
+		else $blocks['news']['num'] = 1;
18
+		if(isset($_POST['sumlength']) && isNumber($_POST['sumlength'])) $blocks['news']['sumlength'] = $_POST['sumlength'];
19
+		else unset($blocks['news']['sumlength']);
20
+		$output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>";
21
+		save_blocks( $blocks );
22
+	}
23
+	else  {
24
+		if(!isset($blocks['news']['sumlength'])) $blocks['news']['sumlength'] = "";
25
+		$output .= "<div style='text-align: center;'><b>"._CURRENT.":</b><br /><div class=\"tblborder\" style=\"width: 80%; margin: 0 auto; text-align: left;\">$content</div><br /></div>";
26
+		$output .= "<div><div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=news\">
27
+			<div><label for=\"num\">"._NUMNEWS.":</label><input type=\"text\" class=\"textbox\" name=\"num\" id=\"num\" size=\"4\" value=\"".$blocks['news']['num']."\"></div>
28
+		<div><label for=\"num\">"._SUMLENGTH.":</label><input type=\"text\" class=\"textbox\" name=\"sumlength\" id=\"sumlength\" size=\"6\" value=\"".$blocks['news']['sumlength']."\"></div>
29
+			<INPUT type=\"submit\" name=\"submit\" class=\"button\" id=\"submit\" value=\""._SUBMIT."\"></form></div><div style='clear: both;'></div></div>";
30
+	}
28 31
 ?>
29 32
\ 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,28 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'news'");
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
+global $language, $numupdated;
11
+include("blocks/".$blocks['news']['file']);
12
+	if(isset($_POST['submit'])) {
13
+		if(isset($_POST['num']) && isNumber($_POST['num'])) $blocks['news']['num'] = $_POST['num'];
14
+		else $blocks['news']['num'] = 1;
15
+		if(isset($_POST['sumlength']) && isNumber($_POST['sumlength'])) $blocks['news']['sumlength'] = $_POST['sumlength'];
16
+		else unset($blocks['news']['sumlength']);
17
+		$output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>";
18
+		save_blocks( $blocks );
19
+	}
20
+	else  {
21
+		if(!isset($blocks['news']['sumlength'])) $blocks['news']['sumlength'] = "";
22
+		$output .= "<div style='text-align: center;'><b>"._CURRENT.":</b><br /><div class=\"tblborder\" style=\"width: 80%; margin: 0 auto; text-align: left;\">$content</div><br /></div>";
23
+		$output .= "<div><div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=news\">
24
+			<div><label for=\"num\">"._NUMNEWS.":</label><input type=\"text\" class=\"textbox\" name=\"num\" id=\"num\" size=\"4\" value=\"".$blocks['news']['num']."\"></div>
25
+		<div><label for=\"num\">"._SUMLENGTH.":</label><input type=\"text\" class=\"textbox\" name=\"sumlength\" id=\"sumlength\" size=\"6\" value=\"".$blocks['news']['sumlength']."\"></div>
26
+			<INPUT type=\"submit\" name=\"submit\" class=\"button\" id=\"submit\" value=\""._SUBMIT."\"></form></div><div style='clear: both;'></div></div>";
27
+	}
28
+?>
0 29
\ No newline at end of file