Browse code

news blog fix

Jimako authored on 2023/09/20 02:17:08
Showing 3 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'];
... ...
@@ -26,6 +26,6 @@
26 26
 if(!defined("_CHARSET")) exit( );
27 27
 
28 28
 
29
-dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_blocks(`block_name`, `block_title`, `block_status`, `block_file`, `block_variables`) VALUES('news', 'Site News', '0', 'news/news.php', '');");
29
+dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_blocks(`block_name`, `block_title`, `block_status`, `block_file`, `block_variables`) VALUES('news', 'Site News', '0', 'news/blog.php', '');");
30 30
 $blocks["news"] = array("title" => "Site News", "status" => "1", "file" => "news/news.php", "num" => "3");
31 31
 ?>
32 32
\ No newline at end of file
... ...
@@ -24,7 +24,7 @@
24 24
 // ----------------------------------------------------------------------
25 25
 
26 26
 if(!defined("_CHARSET")) exit( );
27
-
27
+ 
28 28
 	if(isset($blocks['news']['num'])) $numupdated = $blocks['news']['num'];
29 29
 	else $numupdated = 1;
30 30
 	if(file_exists("$skindir/newsbox.tpl")) $news = new TemplatePower( "$skindir/newsbox.tpl" );
... ...
@@ -41,7 +41,7 @@ if(!defined("_CHARSET")) exit( );
41 41
 		$news->newBlock("newsbox");
42 42
 		
43 43
 		//assign values
44
-		if(!empty($blocks['news']['sumlength']) && isNumber($blocks['news']['sumlength'])) $newsStory = truncate_text($stories['story'], $blocks['news']['sumlength'])."<div class='newsReadMore'><a href='news.php?action=newsstory&amp;nid=".$stories['nid']."'>"._READMORE."</a></div>";
44
+		if(!empty($blocks['news']['sumlength']) && isNumber($blocks['news']['sumlength'])) $newsStory = truncate_text($stories['story'], $blocks['news']['sumlength'])."<div class='newsReadMore'><a href='blog.php?action=newsstory&amp;nid=".$stories['nid']."'>"._READMORE."</a></div>";
45 45
 		else $newsStory = format_story($stories['story']);
46 46
 		$news->assign("newstitle" , $stories['title'] );
47 47
 		$news->assign("newsstory" , $newsStory);
... ...
@@ -51,7 +51,7 @@ if(!defined("_CHARSET")) exit( );
51 51
 		$news->assign("newsid", $stories['nid']);
52 52
 		$news->assign("skindir", $skindir);
53 53
 		if($newscomments)
54
-			$news->assign("newscomments", "<a href=\"news.php?action=newsstory&amp;nid=".$stories['nid']."\">".$stories['comments']." "._COMMENTS."</a>");
54
+			$news->assign("newscomments", "<a href=\"blog.php?action=newsstory&amp;nid=".$stories['nid']."\">".$stories['comments']." "._COMMENTS."</a>");
55 55
 		if(isADMIN) 
56 56
 			$news->assign("adminoptions", "<a href=\"admin.php?action=news&amp;form=".$stories['nid']."\">"._EDIT."</a> | <a href=\"admin.php?action=news&amp;delete=".$stories['nid']."\">"._DELETE."</a>");
57 57
 		$count++;