<?php
require("header.php");
require(R_P.'require/f_channel.php');

/***********************  UPDATE **************************************/
InitGP(array('pub','id',));
if ($pub == 'yes') {
	InitGP(array('content_bc_id','content_channel','content_cg','content_title','content_content',));
	$uid = GetCookie('user_id');
	$uid || Showmsg('log'); 
	channelChk($content_channel);
	$sql1 = "INSERT INTO ".$db_tablepre."content (content_uid,content_bc_id,content_channel,content_cg,content_title,content_content,content_uptimes) VALUES (".$uid.", ".$content_bc_id.",".$content_channel.",".$content_cg.",'".$content_title."','".$content_content."','".$timestamp."')";
	$sql2 = "UPDATE ".$db_tablepre."user SET u_money=u_money+5 WHERE u_id=".$uid;
	sql_return($sql1) && sql_return($sql2) && Cookie('user_money',GetCookie('user_money')+5) && Showmsg('post_Success');
}else {
	$sql = "SELECT  * FROM ".$db_tablepre."channel  WHERE BC_Tschannel=".$id;
	$query = sql_return($sql);
	$sql = "SELECT  * FROM ".$db_tablepre."channel  WHERE BC_id=".$id;
	$query_cg = sql_return($sql,2);
	$cg = explode('|',$query_cg['BC_categories']);
	$bc_id = $query_cg['BC_id'];
}


require PrintEot($self_template,'U');
?>