<?php
require('../class/connect.php');
require('../class/functions.php');
require('../class/eafun.php');

//是否開啟
eapage_IsOpenEapage();

//參數
$egn=(int)$_GET['egn'];
$ecmsck=RepPostVar($_GET['ecmsck']);
$classid=(int)$_GET['classid'];
$id=(int)$_GET['id'];
$dornd=RepPostVar($_GET['dornd']);
$dotime=(int)$_GET['dotime'];
$dopass=RepPostVar($_GET['dopass']);
$ecmsck=str_replace(',','',$ecmsck);
//參數

$ecmscklist=',eaShowInfo,eaShowInfoUrl,eaGoUrlFlink,eaGoUrlUserlist,eaGoUrlUserpage,eaGoUrlClass,eaGoUrlZt,eaGoUrlInfotype,eaGoUrlTags,eaGoUrlCjpage,eaGoUrlSearchUrl,';
$gotourl='';
$urlcs='';

if(!$classid||!$dornd||!$dotime||!$dopass||!$ecmsck)
{
	printerror('EapageErrorPass',$public_r['newsurl'],1);
}
if(!strstr($ecmscklist,','.$ecmsck.','))
{
	printerror('EapageErrorPass',$public_r['newsurl'],1);
}
$urlcs=eapage_CkPassShowInfo($classid,$id,$dornd,$dotime,$dopass,$ecmsck);

//db
$link=db_connect();
$empire=new mysqlquery();

include('../data/dbcache/class.php');

if($ecmsck=='eaShowInfo')//信息
{
	if($egn)
	{
		$gotourl='eaShowInfo.php?'.$urlcs;
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaShowInfoUrl')//信息地址
{
	if($egn)
	{
		$gotourl=eaGotoGeturlInfo($classid,$id,0);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlFlink')//友情鏈接
{
	if($egn)
	{
		$gotourl=eaGotoGeturlFlink($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlUserlist')//自定義列表
{
	if($egn)
	{
		$gotourl=eaGotoGeturlUserlist($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlUserpage')//自定義頁面
{
	if($egn)
	{
		$gotourl=eaGotoGeturlUserpage($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlClass')//欄目
{
	if($egn)
	{
		$gotourl=eaGotoGeturlClass($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlZt')//專題
{
	if($egn)
	{
		$gotourl=eaGotoGeturlZt($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlInfotype')//標題分類
{
	if($egn)
	{
		$gotourl=eaGotoGeturlInfotype($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlTags')//TAGS
{
	if($egn)
	{
		$gotourl=eaGotoGeturlTags($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlCjpage')//採集
{
	if($egn)
	{
		$gotourl=eaGotoGeturlCjpage($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
elseif($ecmsck=='eaGoUrlSearchUrl')//搜索轉發地址
{
	if($egn)
	{
		$gotourl=eaGotoGeturlSearchUrl($classid);
	}
	else
	{
		$gotourl='eaGotoPage.php?egn=1'.$urlcs;
	}
}
else
{
	printerror('EapageErrorPass',$public_r['newsurl'],1);
}

db_close();
$empire=null;

if($gotourl)
{
	echo'<meta http-equiv="refresh" content="0;url='.$gotourl.'">';
}

?>