<?php
require_once( 'global.php');
$channelid = intval($_GET['mod']);
$ac = empty($_GET['ac']) ? 'index' : $_GET['ac'];
if(!ereg("([a-z]+)", $ac)) qbase::showmsg("bad request");
$current_menu = array();
if($channelid > 0){
	if(!isset($channel[$channelid]) || empty($channel[$channelid])) qbase::showmsg("bad request");
	unset($channel[$channelid]['id']);
	@extract($channel[$channelid]);
	$mod = $_MODULE[$channel[$channelid]['channelselect']]['table_name'];
	if(empty($mod)) die('module system not found');
	if($show == 0) qbase::showmsg("I'm sorry, this channel has been closed by administrator.");
	$current_menu[$channelid] = " class='selected' ";
	if(!@include(R_P . "/app/" . ($_MODULE[$channelselect]['appname'] ? $_MODULE[$channelselect]['appname'] : $_MODULE[$channelselect]['table_name']) ."/". $ac . ".php")) qbase::showmsg("bad request");
}else{
	$current_menu[$ac] = " class='selected' ";
	if(!@include(R_P . "/app/" . $ac . ".php")) qbase::showmsg("bad request");
}
?>