<?php
require_once(dirname(__FILE__)."/config.php");
CheckRank(0,0);
if(!isset($action)) $action = '';
$dsql = new DedeSql(false);

//读取所有栏目
$dsql->SetQuery("Select id,classname,pid,rank From #@__story_catalog order by rank asc");
$dsql->Execute();
$ranks = Array();
$btypes = Array();
$stypes = Array();
while($row = $dsql->GetArray()){
	if($row['pid']==0) $btypes[$row['id']] = $row['classname'];
	else $stypes[$row['pid']][$row['id']] = $row['classname'];
	$ranks[$row['id']] = $row['rank'];
}
$lastid = $row['id'];
$msg = '';

$books = $dsql->GetOne("Select * From #@__story_books where id='$bookid' and memberid={$cfg_ml->M_ID} ");
if($cfg_book_ifcheck == 'Y' && $books['ischeck'] == 1){
	$dsql->close();
	ShowMsg('禁止修改，请返回','-1');
	exit;
}
require_once(dirname(__FILE__)."/templets/story_edit.htm");
$dsql->close();
?>