news blog fix
--- a/blocks/news/admin.php
+++ b/blocks/news/admin.php
@@ -1,5 +1,6 @@
<?php
if(!defined("_CHARSET")) exit( );
+
$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'news'");
while($block = dbassoc($blockquery)) {
if ($block['block_variables'])
@@ -11,6 +12,10 @@
$blocks[$block['block_name']]['status'] = $block['block_status'];
}
global $language, $numupdated;
+
+if (file_exists(_BASEDIR . "blocks/news/" . $language . ".php")) include(_BASEDIR . "blocks/news/" . $language . ".php");
+else include(_BASEDIR . "blocks/news/en.php");
+
include("blocks/".$blocks['news']['file']);
if(isset($_POST['submit'])) {
if(isset($_POST['num']) && isNumber($_POST['num'])) $blocks['news']['num'] = $_POST['num'];
--- a/blocks/news/init.php
+++ b/blocks/news/init.php
@@ -26,6 +26,6 @@
if(!defined("_CHARSET")) exit( );
-dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_blocks(`block_name`, `block_title`, `block_status`, `block_file`, `block_variables`) VALUES('news', 'Site News', '0', 'news/news.php', '');");
+dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_blocks(`block_name`, `block_title`, `block_status`, `block_file`, `block_variables`) VALUES('news', 'Site News', '0', 'news/blog.php', '');");
$blocks["news"] = array("title" => "Site News", "status" => "1", "file" => "news/news.php", "num" => "3");
?>
--- a/blocks/news/news.php
+++ b/blocks/news/news.php
@@ -24,7 +24,7 @@
// ----------------------------------------------------------------------
if(!defined("_CHARSET")) exit( );
-
+
if(isset($blocks['news']['num'])) $numupdated = $blocks['news']['num'];
else $numupdated = 1;
if(file_exists("$skindir/newsbox.tpl")) $news = new TemplatePower( "$skindir/newsbox.tpl" );
@@ -41,7 +41,7 @@
$news->newBlock("newsbox");
//assign values
- 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&nid=".$stories['nid']."'>"._READMORE."</a></div>";
+ 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&nid=".$stories['nid']."'>"._READMORE."</a></div>";
else $newsStory = format_story($stories['story']);
$news->assign("newstitle" , $stories['title'] );
$news->assign("newsstory" , $newsStory);
@@ -51,7 +51,7 @@
$news->assign("newsid", $stories['nid']);
$news->assign("skindir", $skindir);
if($newscomments)
- $news->assign("newscomments", "<a href=\"news.php?action=newsstory&nid=".$stories['nid']."\">".$stories['comments']." "._COMMENTS."</a>");
+ $news->assign("newscomments", "<a href=\"blog.php?action=newsstory&nid=".$stories['nid']."\">".$stories['comments']." "._COMMENTS."</a>");
if(isADMIN)
$news->assign("adminoptions", "<a href=\"admin.php?action=news&form=".$stories['nid']."\">"._EDIT."</a> | <a href=\"admin.php?action=news&delete=".$stories['nid']."\">"._DELETE."</a>");
$count++;