mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 04:10:38 +02:00
Bugtracker #4849 - default news display if invalid 'extend' parameter
This commit is contained in:
96
news.php
96
news.php
@@ -9,9 +9,9 @@
|
|||||||
* News frontend
|
* News frontend
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/news.php,v $
|
* $Source: /cvs_backup/e107_0.8/news.php,v $
|
||||||
* $Revision: 1.21 $
|
* $Revision: 1.22 $
|
||||||
* $Date: 2009-10-09 15:08:28 $
|
* $Date: 2009-10-31 15:02:02 $
|
||||||
* $Author: secretr $
|
* $Author: e107steved $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("class2.php");
|
require_once("class2.php");
|
||||||
@@ -273,52 +273,58 @@ if ($action == "extend")
|
|||||||
AND (n.news_end=0 || n.news_end>".time().")
|
AND (n.news_end=0 || n.news_end>".time().")
|
||||||
AND n.news_id=".intval($sub_action);
|
AND n.news_id=".intval($sub_action);
|
||||||
}
|
}
|
||||||
$sql->db_Select_gen($query);
|
if ($sql->db_Select_gen($query))
|
||||||
$news = $sql->db_Fetch();
|
|
||||||
|
|
||||||
//***NEW [SecretR] - comments handled inside now
|
|
||||||
e107::setRegistry('news/page_allow_comments', !$news['news_allow_comments']);
|
|
||||||
if(!$news['news_allow_comments'] && isset($_POST['commentsubmit']))
|
|
||||||
{
|
{
|
||||||
$pid = intval(varset($_POST['pid'], 0)); // ID of the specific comment being edited (nested comments - replies)
|
$news = $sql->db_Fetch();
|
||||||
|
|
||||||
$clean_authorname = $_POST['author_name'];
|
|
||||||
$clean_comment = $_POST['comment'];
|
|
||||||
$clean_subject = $_POST['subject'];
|
|
||||||
|
|
||||||
e107::getSingleton('comment')->enter_comment($clean_authorname, $clean_comment, 'news', $sub_action, $pid, $clean_subject);
|
//***NEW [SecretR] - comments handled inside now
|
||||||
}
|
e107::setRegistry('news/page_allow_comments', !$news['news_allow_comments']);
|
||||||
|
if(!$news['news_allow_comments'] && isset($_POST['commentsubmit']))
|
||||||
//More SEO
|
{
|
||||||
setNewsFrontMeta($news);
|
$pid = intval(varset($_POST['pid'], 0)); // ID of the specific comment being edited (nested comments - replies)
|
||||||
/*
|
|
||||||
if($news['news_title'])
|
$clean_authorname = $_POST['author_name'];
|
||||||
{
|
$clean_comment = $_POST['comment'];
|
||||||
if($pref['meta_news_summary'] && $news['news_title'])
|
$clean_subject = $_POST['subject'];
|
||||||
{
|
|
||||||
define("META_DESCRIPTION",SITENAME.": ".$news['news_title']." - ".$news['news_summary']);
|
e107::getSingleton('comment')->enter_comment($clean_authorname, $clean_comment, 'news', $sub_action, $pid, $clean_subject);
|
||||||
}
|
}
|
||||||
define("e_PAGETITLE",$news['news_title']);
|
|
||||||
}*/
|
//More SEO
|
||||||
|
setNewsFrontMeta($news);
|
||||||
|
/*
|
||||||
|
if($news['news_title'])
|
||||||
|
{
|
||||||
|
if($pref['meta_news_summary'] && $news['news_title'])
|
||||||
|
{
|
||||||
|
define("META_DESCRIPTION",SITENAME.": ".$news['news_title']." - ".$news['news_summary']);
|
||||||
|
}
|
||||||
|
define("e_PAGETITLE",$news['news_title']);
|
||||||
|
}*/
|
||||||
|
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
|
||||||
$param = array();
|
$param = array();
|
||||||
$param['current_action'] = $action;
|
$param['current_action'] = $action;
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
$ix->render_newsitem($news, 'extend', '', '', $param);
|
$ix->render_newsitem($news, 'extend', '', '', $param);
|
||||||
if(e107::getRegistry('news/page_allow_comments'))
|
if(e107::getRegistry('news/page_allow_comments'))
|
||||||
{
|
{
|
||||||
global $comment_edit_query; //FIXME - kill me
|
global $comment_edit_query; //FIXME - kill me
|
||||||
$comment_edit_query = 'comment.news.'.$news['news_id'];
|
$comment_edit_query = 'comment.news.'.$news['news_id'];
|
||||||
e107::getSingleton('comment')->compose_comment('news', 'comment', $news['news_id'], null, $news['news_title'], FALSE);
|
e107::getSingleton('comment')->compose_comment('news', 'comment', $news['news_id'], null, $news['news_title'], FALSE);
|
||||||
|
}
|
||||||
|
$cache_data = ob_get_contents();
|
||||||
|
ob_end_flush();
|
||||||
|
setNewsCache($cacheString, $cache_data);
|
||||||
|
require_once(FOOTERF);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$action = 'default';
|
||||||
}
|
}
|
||||||
$cache_data = ob_get_contents();
|
|
||||||
ob_end_flush();
|
|
||||||
setNewsCache($cacheString, $cache_data);
|
|
||||||
require_once(FOOTERF);
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user