<?php
if (!defined('MOD')) die("access die");

$id = intval($_GET['id']);
$extends = $cms->getExtend($channelselect);
$_output = $cms->get_item($id);
if(empty($_output)) qbase::showmsg("没有找到相关数据");
if ($admin_info['groupid'] > 3 && !in_array($_output['cid'], $manage_category[$channelid])) {
	qbase::purviewCheckDie();
} 
$_output = array_merge($_output, $cms->getExtendData($channelid, $id));
$_output['articleauthor'] = htmlspecialchars($_output['articleauthor']);
$_output['articlefrom'] = htmlspecialchars($_output['articlefrom']);
$_output['subject'] = htmlspecialchars($_output['subject']);
$_output['filter'] = explode(",", $_output['filter']);
$_output['text_id'] = $_output['message'] ;
$_output['message'] = qdb::QueryAlone("select message from ".TABLEPRE."text where text_id='$_output[message]' limit 1");
$_output['message'] = $cms->reset_short_url($_output['message']);
$_output['message'] = htmlspecialchars($_output['message']);

if($channel[$channelid]['show_related']){
	$related_arr = $cms ->get_related($channelid.'-'.$id);
	foreach($related_arr as &$val){
		foreach($val['data'] as &$v){
			$v['channelname'] = $channel[$v['channelid']]['channelname'];
		}
	}
	unset($val, $v);
	$related_json = qbase::jsonencode($related_arr);
}else{
	$related_json = "";
}

$keywords_array = getTag($channelid, $id);
$ppcid = $_output['cid'];
$strall = str_replace("value=\"{$ppcid}-", " selected value=\"{$ppcid}-", $menuTree);
include qbase::template($path . 'article/add');
?>