Exemplo n.º 1
0
//获得父栏目
$nrow = $dsql->GetOne("SELECT * FROM #@__story_catalog WHERE id='{$catid}' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];
if (empty($bcatid)) {
    $bcatid = 0;
}
if (empty($booktype)) {
    $booktype = 0;
}
$addtime = time();
//处理上传的缩略图
if (!isset($isremote)) {
    $isremote = 0;
}
$bigpic = UploadOneImage('imgfile', $imgurl, $isremote);
$adminID = $cuserLogin->getUserID();
//----------------------------------
$inQuery = "\n   UPDATE `#@__story_content` SET `title`='{$title}',`bookname`='{$bookname}',\n   `chapterid`='{$chapterid}',`sortid`='{$sortid}',`bigpic`='{$bigpic}'\n  WHERE id='{$cid}'\n";
if (!$dsql->ExecuteNoneQuery($inQuery)) {
    ShowMsg("把数据保存到数据库时出错,请检查!" . str_repolace("'", "`", $dsql->GetError() . $inQuery), "-1");
    $dsql->Close();
    exit;
}
$arcID = $cid;
//生成HTML
//---------------------------------
//$artUrl = MakeArt($arcID,true);
if (empty($artcontentUrl)) {
    $artcontentUrl = "";
}
//本章最后一个漫画的排列顺次序
$lrow = $dsql->GetOne("Select sortid From #@__story_content where bookid='$bookid' And chapterid='$chapterid' order by sortid desc");
if(empty($lrow)) $sortid = 1;
else $sortid = $lrow['sortid']+1;

//处理上传的图片

if(!isset($isremote)) $isremote = 0;
//$bigpic = UploadOneImage('bigpic',$bigpicname,$ddisremote);

$adminID = $cuserLogin->getUserID();

$postnum = 0;
for($i=1;$i<=$photonum;$i++)
{
  $bigpic = UploadOneImage('imgfile'.$i,${'imgurl'.$i},$isremote);
  if($bigpic!=''){
     $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++;
     }
   }
}