conn_db = $_SESSION['connR']; $obj->SelectDb($fields,"media_category",NULL,$where); $arr_media_category=$obj->arr_db_rows; $fields2="mc_sn,mc_title"; $where2="WHERE mc_type=1 AND mc_launch='1' ORDER BY mc_sort desc,mc_sn asc"; $obj->SelectDb($fields2,"media_category",NULL,$where2); $arr_media_parent_temp=$obj->arr_db_rows; $arr_media_parent=array(); for($i=0;$i$arr_media_parent_temp[$i]['mc_title']); } //echo "
";print_r($arr_media_category);
	
	$obj_AntiHacker=new AntiHacker();	
	
	$c=$obj_AntiHacker->AntiHack($_GET['c']);
	if(empty($c))$c=$arr_media_category[0]['mc_sn'];
	
	$bool_category_error=false;
	for($i=0;$iAntiHack($_GET['p']);
	if(empty($topage)) $topage=1;
	
	if( !ereg( "^[0-9]+$" , $topage )) 
	{
		header('Location: error.php?w=g');
		exit;
	}
	
	$today=date("Y-m-d H:i:s");	
	
	$obj2 = new ReWrDb();
	$obj2->conn_db = $_SESSION['connR'];
	$where2="WHERE m_type='3' AND mc_sn='$c'
			 AND m_launch='1' 
			 AND ( m_forever='1' OR ( m_start_date < '".$today."' AND m_end_date > '".$today."' ))";
	$fields2="m_sn,m_title,m_desc,m_reference,m_url_path,m_file";
	$obj2->int_rows_per_page = 1;
	$obj2->int_thispage = $topage;
	$obj2->str_orderby = "m_sort,m_start_date";
	$obj2->str_sort = "desc";
	$obj2->SelectDb($fields2,"media",NULL,$where2,1);	
	$arr_media_show=$obj2->arr_db_rows;
	$int_allpages=$obj2->int_allpages;
	
	$bool_pages_error=false;
	if($int_allpages<$topage)
		$bool_pages_error=true;
		
	if($bool_pages_error || $bool_category_error)
	{
		header('Location: error.php?w=g');
		exit;
	}
	
	if($int_allpages > 4&&($topage==$int_allpages || $topage==($int_allpages-1) || $topage==($int_allpages-2)))
		$getlinkpage=$int_allpages-4;
	elseif($int_allpages <= 4)
		$getlinkpage=0;
	else
		$getlinkpage=$topage-1;
		
	$pages_sql_command="SELECT m_title,m_url_path,m_icon FROM media ".$where2." ORDER BY m_sort DESC,m_start_date DESC LIMIT ".$getlinkpage.",4";
	
	$arr_media= array();
	$res_media = $_SESSION['connR'] -> execute( $pages_sql_command );
	for( $i = 0 ; $i < $res_media ->RecordCount() ; $i++ )
	{
		$row_media = $res_media ->GetRowAssoc( false );
		array_push( $arr_media , $row_media );
		$res_media ->MoveNext();
	}
	
function getLastPage()
{
	global $topage;
	global $c;
	global $int_allpages;
	
	if(($topage+1)>$int_allpages)
		echo "#";
	else
		echo "study_graphic.php?c=".$c."&p=".($topage+1);
	
}
function getForwardPage()
{
	global $topage;
	global $c;
	
	if(($topage-1)==0)
		echo "#";
	else
		echo "study_graphic.php?c=".$c."&p=".($topage-1);
}
function getPage($topage,$i)
{
	global $int_allpages;
	if($topage==$int_allpages)
		return $topage-3+$i;
	elseif($topage==$int_allpages-1)
		return $topage-2+$i;
	elseif($topage==$int_allpages-2)
		return $topage-1+$i;
	else
		return $topage+$i;
}
function getLongdesc($desc,$title)
{
	if(empty($desc))
		return $title;
	else
		return $desc;
}
?>





蔣故總統經國先生百年誕辰紀念