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']; $contents = $dsql->GetOne("SELECT * FROM #@__story_content WHERE id='$cid' "); $bookinfos = $dsql->GetOne("SELECT catid,bcatid,bookname,booktype FROM #@__story_books WHERE bid='{$contents['bookid']}' "); $catid = $bookinfos['catid']; $bcatid = $bookinfos['bcatid']; $bookname = $bookinfos['bookname']; $booktype = $bookinfos['booktype']; $bookid = $contents['bookid']; $dsql->SetQuery("SELECT id,chapnum,chaptername FROM #@__story_chapter WHERE bookid='{$contents['bookid']}' ORDER BY chapnum DESC"); $dsql->Execute(); $chapters = Array(); $chapnums = Array(); while($row = $dsql->GetArray()){ $chapters[$row['id']] = $row['chaptername']; $chapnums[$row['id']] = $row['chapnum']; } require_once DedeInclude('/templets/story_content_edit.htm'); //ClearAllLink();