<?php
if(!defined('IN_MYMPS')) exit('FORBIDDEN');
$id = isset($id) ? intval($id) : '';

(!$news = $db -> getRow("SELECT * FROM `{$db_mymps}news` WHERE id = '$id'")) && write_msg('您所指定的新闻不存在或者已被删除！');//获得新闻内容

$latest_news = mymps_get_news_list(15);//取得最新发布的10条新闻
$relate_news = mymps_get_news_list(8,$news['catid']);//取得相关的8条新闻
$image_news = mymps_get_news_list(6,'',1);//取得最新的6条图文新闻

$news['view_url'] = $mymps_global[SiteUrl].($news['isactive'] == 1 ? '/news.php?id='.$id : $news['html_path']);

if($news['redirect_url'] != '' && $news['isjump'] == 1) write_msg('请稍候，当前页面正跳转至 '.$news[redirect_url].' ',$news[redirect_url]);

/*****页面标题,当前位置,SEO信息****/
$loc				 = get_location('channel',$news[catid],$news[title]);
$location	 		 = $loc['location'];
$page_title			 = $loc['page_title'];

$advertisement			= get_advertisement('other');//获得全局广告
$adveritems				= $advertisement['items'];
$advertisement			= $advertisement['all'];

$news['keywords']	 = $news['keywords'] ? $news['keywords'] : $news['title'];
$news['description'] = mhtmlspecialchars(substring(clear_html($news['content']),0,250));

/*新闻内容内链处理*/
$news['content'] = replace_insidelink($news['content'],'news');

tpl_assign();
$smarty->assign('news',$news);
$smarty->assign('latest_news',$latest_news);
$smarty->assign('relate_news',$relate_news);
$smarty->assign('image_news',$image_news);
$smarty->assign('latest_info',mymps_get_info_list(10,'','','','','','','',false));
$smarty->assign('cat',NULL);
$advertisement = $catid = $adveritems = $page1 = $cat_list = $area_list = $news = $latest_news = $relate_news = $cat = $location = $page_title = NULL;
?>