<?php
require("../../../class/connect.php");
require("../../../class/q_functions.php");
require("../../../class/db_sql.php");
require("../../../class/dpfun.php");
require("../../../data/dbcache/class.php");
require("../../class/user.php");
require('../../class/favfun.php');
$link=db_connect();
$empire=new mysqlquery();
$editor=2;
eCheckCloseMods('member');//关闭模块
$user=islogin();
$id=(int)$_GET['id'];
$bookid=(int)$_GET['bookid'];
if(!$id||!$bookid)
{
	printerror("ErrorUrl","",1);
}
//链接
$bi=$empire->fetch1("select * from {$dbtbpre}ecms_bookname_index where id='$bookid' limit 1");
if(empty($bi['id'])||$bi['id']!=$bookid)
{
	printerror("ErrorUrl","",1);
}
$bk=$empire->fetch1("select * from {$dbtbpre}ecms_bookname where id='$bookid' limit 1");
$classid=$bk[classid];
$tb=GetBdTbname($bookid);
$bdi=$empire->fetch1("select * from {$dbtbpre}ecms_".$tb[tbname]."_index where id='$id' limit 1");
if(empty($bdi['id'])||$bdi['id']!=$id||!$bdi[checked])
{
	printerror("ErrorUrl","",1);
}
$bdd=$empire->fetch1("select * from {$dbtbpre}ecms_".$tb[tbname]." where id='$id' limit 1");
$bookurl=GotoGetBookUrl($classid,$id);
$bdurl=GotoGetBDUrl($bookid,$id,$classid);

$from=$_SERVER['HTTP_REFERER'];
//导入模板
require(ECMS_PATH.'e/template/member/AddFavaq.php');
db_close();
$empire=null;
?>