Browse code

news blog fix

Jimako authored on 2023/09/20 02:17:08
Showing 1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 <?php
2 2
 if(!defined("_CHARSET")) exit( );
3
+ 
3 4
 $blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'news'");
4 5
 while($block = dbassoc($blockquery)) {
5 6
 	if ($block['block_variables'])
... ...
@@ -11,6 +12,10 @@ while($block = dbassoc($blockquery)) {
11 12
 	$blocks[$block['block_name']]['status'] = $block['block_status'];
12 13
 }
13 14
 global $language, $numupdated;
15
+
16
+if (file_exists(_BASEDIR . "blocks/news/" . $language . ".php")) include(_BASEDIR . "blocks/news/" . $language . ".php");
17
+else include(_BASEDIR . "blocks/news/en.php");
18
+
14 19
 include("blocks/".$blocks['news']['file']);
15 20
 	if(isset($_POST['submit'])) {
16 21
 		if(isset($_POST['num']) && isNumber($_POST['num'])) $blocks['news']['num'] = $_POST['num'];
Browse code

Start Point - version 3.5.5 + fixes

Jimako authored on 2023/09/05 17:01:08
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +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
+	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
+	}
31
+?>
0 32
\ No newline at end of file