<?php
require('top.php');
require(R_P.'require/page.php');

InitGP(array('action','id',),'GP',false);
// 频道管理
/***************************************************************************************/
$num = 20;

if ($action == 'del'){
	$sql1 = 'DELETE FROM '.$db_tablepre.'content WHERE content_id='.$id;
	$sql2 = 'DELETE FROM '.$db_tablepre.'gather_record  WHERE r_up_id='.$id;
	sql_return($sql1) && sql_return($sql2) && Showmsg('dle_Success');
	
}else {
	if ($channel) $sql = ' WHERE content_channel='.$channel;
	else $sql = ' WHERE content_bc_id='.$id;
	
	$sql = "SELECT * FROM ".$db_tablepre."content c LEFT JOIN ".$db_tablepre."user u ON c.content_uid=u.u_id   LEFT JOIN ".$db_tablepre."channel ch ON c.content_channel=ch.BC_id  ".$sql;
	$rs = sql_return($sql);


	$num_page = sql_return($rs,$type = 'count');
	$page = page_top($num,$num_page);

	$sql .= "  order by content_uptimes desc limit ".($page*$num).",$num";
	$query = sql_return($sql);

	$page_foot = page_foot($page,$num,$num_page,$str);
}

require PrintEot($self_template,'A');
echo footer();
?>