<?php
if(!defined( 'R_P')) die("access die");
$id = intval($_GET['id']);
$_output = $cms->get_item($id);
if (empty($_output)) qbase::purviewCheckDie("您提交的数据不存在");
if ($admin_info['groupid'] > 3 && !in_array(intval($_output['cid']), $manage_category[$channelid])) qbase::purviewCheckDie();
$_output['filter'] = explode(",", $_output['filter']);
$_output = array_merge($_output, $cms->getExtendData($channelid, $id));
$keywords_array = getTag($channelid, $id);

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 = "";
}

$piclist = qdb::fetchAll("select * from ".TABLEPRE."pics_{$channelid} where id = '{$id}' order by ordering asc");
$ppcid = $_output[cid];
$strall = str_replace("value=\"{$ppcid}-", " selected value=\"{$ppcid}-", $menuTree);
include qbase::template($path . 'pic/edit');
?>