if (empty($chapterid) || !empty($addchapter) && !empty($chapternew)) { if (empty($chapternew)) { ShowMsg("由于你发布的内容没选择章节,系统拒绝发布!", "-1"); exit; } $dsql = new DedeSql(); $row = $dsql->GetOne("SELECT * FROM #@__story_chapter WHERE bookid='{$bookid}' ORDER BY chapnum DESC"); if (is_array($row)) { $nchapnum = $row['chapnum'] + 1; } else { $nchapnum = 1; } $query = "INSERT INTO `#@__story_chapter`(`bookid`,`catid`,`chapnum`,`mid`,`chaptername`,`bookname`)\n VALUES ('{$bookid}', '{$catid}', '{$nchapnum}', '0', '{$chapternew}','{$bookname}');"; $rs = $dsql->ExecuteNoneQuery($query); if ($rs) { $chapterid = $dsql->GetLastID(); } else { ShowMsg("增加章节失败,请检查原因!", "-1"); exit; } } else { $dsql = new DedeSql(); } //获得父栏目 $nrow = $dsql->GetOne("SELECT * FROM #@__story_catalog WHERE id='{$catid}' "); $bcatid = $nrow['pid']; $booktype = $nrow['booktype']; if (empty($bcatid)) { $bcatid = 0; } if (empty($booktype)) {
$attlist .= " type='"; foreach($types as $v) $attlist .= $v.'.'; $attlist .= "'"; } $innertext = stripslashes($innertext); if($keyword!="") $attlist .= " keyword='$keyword'"; $fulltag = "{dede:arclist$attlist} $innertext {/dede:arclist}\r\n"; if($dopost=='savetag') { $dsql = new DedeSql(false); $fulltag = addslashes($fulltag); $tagname = "auto"; $inQuery = " Insert Into #@__mytag(typeid,tagname,timeset,starttime,endtime,normbody,expbody) Values('0','$tagname','0','0','0','$fulltag',''); "; $dsql->ExecuteNoneQuery($inQuery); $id = $dsql->GetLastID(); $dsql->ExecuteNoneQuery("Update #@__mytag set tagname='{$tagname}_{$id}' where aid='$id'"); $dsql->Close(); $fulltag = "{dede:mytag name='{$tagname}_{$id}' ismake='yes'/}"; } require_once(dirname(__FILE__)."/templets/mytag_tag_guide_ok.htm"); ClearAllLink(); ?>
$titlen = ${'title'.$i}; if(empty($titlen)) $titlen = ${'title'}; $inQuery = " INSERT INTO `#@__story_content`(`title`,`bookname`,`chapterid`,`catid`,`bcatid`,`booktype`,`bookid`,`sortid`, `memberid`,`bigpic`,`body`,`addtime`,`adminid` ) VALUES ('$titlen','$bookname', '$chapterid', '$catid','$bcatid','$booktype', '$bookid','$sortid', '0', '$bigpic' , '', '$addtime','$adminID');"; $rs = $dsql->ExecuteNoneQuery($inQuery); //if(!$rs) echo $inQuery."<hr>\r\n"; if($rs){ $sortid++; $postnum++; } } } $arcID = $dsql->GetLastID(); //更新图书的内容数 $row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid = '$bookid' "); $dsql->ExecuteNoneQuery("Update #@__story_books set postnum='{$row['dd']}',lastpost='".time()."' where id='$bookid' "); //更新章节的内容数 $row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid = '$bookid' And chapterid='$chapterid' "); $dsql->ExecuteNoneQuery("Update #@__story_chapter set postnum='{$row['dd']}' where id='$chapterid' "); if(empty($arcID)){ ShowMsg("没成功保存任何图片,可能是系统有问题!","-1"); exit(); } //生成HTML
}else if($ctype=='img'){ $action = "@me = TurnImageTag(@me);"; } $exRule .= "{dede:field name='".$ctag->GetName()."' comment='".$ctag->GetAtt('itemname')."' intable='".$addtable."' source='export'}{$action}{/dede:field}\r\n"; } } $row['ruleset'] = $exRule; $exRule = addslashes($exRule); $ntime = time(); $query = " Insert Into `#@__co_exrule`(channelid,rulename,etype,dtime,ruleset) Values('$channelid','{$cinfos['typename']}模型','当前系统','".time()."','$exRule') "; $dsql->ExecuteNoneQuery($query); $gerr = $dsql->GetError(); $row['aid'] = $exrule = $dsql->GetLastID(); if($row['aid']<1){ ClearAllLink(); ShowMsg("生成规则错误,无法进行操作!".$gerr,"javascript:;"); exit(); } $row['channelid'] = $channelid; $row['rulename'] = "{$cinfos['typename']}模型"; $row['etype'] = "当前系统"; $row['dtime'] = $ntime; } } if(empty($exrule)) $exrule = $row['aid']; if(empty($exrule)){ ClearAllLink(); ShowMsg("读取规则错误,无法继续操作!","javascript:;");