Exemplo n.º 1
0
    $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 = "";
}
if ($artcontentUrl == "") {
    $artcontentUrl = $cfg_mainsite . $cfg_cmspath . "/book/show-photo.php?id={$arcID}&bookid={$bookid}&chapterid={$chapterid}";
}
require_once DEDEROOT . '/book/include/story.view.class.php';
$bv = new BookView($bookid, 'book');
Exemplo n.º 2
0
 }
}
$itemconfig .= "
{/dede:art}
";

$inQuery = "
Update #@__conote set gathername='$notename',language='$language',arcsource='$arcsource',noteinfo='$itemconfig' 
Where nid='$nid';
";
$dsql = new DedeSql(false);
if($dsql->ExecuteNoneQuery($inQuery))
{
	$dsql->Close();
	ShowMsg("成功更改一个节点!","co_main.php");
	exit();
}
else
{
	$gerr = $dsql->GetError();
	$dsql->Close();
	header("Content-Type: text/html; charset={$cfg_ver_lang}");
	echo "SQL语句:<xmp>$inQuery</xmp>";
	echo "<hr>错误提示:".$gerr."<hr>";
	$dsql->Close();
	ShowMsg("更改节点失败,请检查原因!","javascript:;");
	exit();
}

ClearAllLink();
?>
click='$click',
freenum='$freenum',
bookname='$bookname',
author='$author',
litpic='$litpic',
pubdate='$pubdate',
description='$description',
body='$body',
keywords='$keywords',
status='$status',
ischeck='$ischeck'
where id='$bookid' ";


if(!$dsql->ExecuteNoneQuery($upQuery)){
	ShowMsg("更新数据库时出错,请检查!".$dsql->GetError(),"-1");
	$dsql->Close();
	exit();
}

$dsql->Close();

//生成HTML
//---------------------------------

require_once(dirname(__FILE__).'/../../include/inc_arcbook_view.php');
$bv = new BookView($bookid,'book');
$artUrl = $bv->MakeHtml();
$bv->Close();

//---------------------------------
Exemplo n.º 4
0
	  		  if(ereg("[^0-9]",$k)){ echo "<font color='red'>{$k}:</font>{$v}<br/>\r\n"; }
	  	 }
	  }
	  $t2 = ExecTime();
	  echo "<hr>执行时间:".($t2-$t1);
	  exit();
	}
	if($querytype==2){
	   //普通的SQL语句
	   $sqlquery = str_replace("\r","",$sqlquery);
	   $sqls = split(";[ \t]{0,}\n",$sqlquery);
	   $nerrCode = ""; $i=0;
	   foreach($sqls as $q){
	     $q = trim($q); if($q==""){ continue; }
	     $dsql->ExecuteNoneQuery($q);
	     $errCode = trim($dsql->GetError());
	     if($errCode=="") $i++;
	     else $nerrCode .= "执行: <font color='blue'>$q</font> 出错,错误提示:<font color='red'>".$errCode."</font><br>";
     }
	   echo "成功执行{$i}个SQL语句!<br><br>";
	   echo $nerrCode;
  }else{
  	$dsql->ExecuteNoneQuery($sqlquery);
  	$nerrCode = trim($dsql->GetError());
  	echo "成功执行1个SQL语句!<br><br>";
	  echo $nerrCode;
	}
	$dsql->Close();
	$t2 = ExecTime();
	echo "<hr>执行时间:".($t2-$t1);
	exit();
		 $dsql->SetSource($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$dbname,'');
		 $dsql->Open(false);
	}
	else if($dbptype==3){
		$dsql = new DedeSql(false,false);
		$dsql->SetSource($dbhost,$dbuser,$dbpwd,$dbname,'');
		$dsql->Open(false);
	}
	if(!$dsql->linkID){
		echo "<font color='red'>连接数据库失败!</font><br>";
		echo $qbutton;
		exit();
	}
	$dsql->SetQuery("Show Tables");
  $dsql->Execute('t');
  if($dsql->GetError()!=""){
  	echo "<font color='red'>找不到你所指定的数据库! $dbname</font><br>";
		echo $qbutton;
  }
  echo "<select name='exptable' id='exptable' size='10' style='width:60%' onchange='ShowFields()'>\r\n";
  while($row = $dsql->GetArray('t')){
	  echo "<option value='{$row[0]}'>{$row[0]}</option>\r\n";
  }
  echo "</select>\r\n";
	$dsql->Close();
	exit();
}
/*-------------------------------
//列出数据库表里的字段
function __getfields()
--------------------------------*/
$adminID = $cuserLogin->getUserID();

//本章最后一个小说的排列顺次序
$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;


//----------------------------------
$inQuery = "
INSERT INTO `#@__story_content`(`title`,`bookname`,`chapterid`,`catid`,`bcatid`,`bookid`,`booktype`,`sortid`,
`memberid`,`bigpic`,`body`,`addtime`,`adminid` )
VALUES ('$title','$bookname', '$chapterid', '$catid','$bcatid', '$bookid','$booktype','$sortid', '0', '' , '', '$addtime','$adminID');";

if(!$dsql->ExecuteNoneQuery($inQuery)){
	ShowMsg("把数据保存到数据库时出错,请检查!".$dsql->GetError().$inQuery,"-1");
	$dsql->Close();
	exit();
}

$arcID = $dsql->GetLastID();

WriteBookText($arcID,stripslashes($body));

//更新图书的内容数
$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' ");
Exemplo n.º 7
0
  if($copytemplet==1){
    $tmpletdir = $cfg_basedir.$cfg_templets_dir.'/'.$cfg_df_style;
    @copy("{$tmpletdir}/article_{$nid}.htm","{$tmpletdir}/article_{$newnid}.htm");
    @copy("{$tmpletdir}/list_{$nid}.htm","{$tmpletdir}/list_{$newnid}.htm");
    @copy("{$tmpletdir}/index_{$nid}.htm","{$tmpletdir}/index_{$newnid}.htm");
  }
  $rs = $dsql->ExecuteNoneQuery($inquery);
  if($rs)
  {
  	 ShowMsg("成功复制模型,现转到详细参数页... ","mychannel_edit.php?ID={$newid}&dopost=edit");
  	 $dsql->Close();
     exit();
  }
  else
  {
  	 $errv = $dsql->GetError();
  	 ShowMsg("系统出错,请把错误代码发送到官方论坛,以检查原因!<br /> 错误代码:mychannel_edit.php?dopost=savecopy $errv","javascript:;");
  	 $dsql->Close();
     exit();
  }
}
/*----------------
function __GetTemplets()
-----------------*/
else if($dopost=="gettemplets")
{
  $dsql = new DedeSql(-100);
  $row = $dsql->GetOne("Select * From #@__channeltype where ID='$ID'");
  $dsql->Close();
  $wintitle = "频道管理-查看模板";
	$wecome_info = "<a href='mychannel_main.php'>频道管理</a>:查看模板";
Exemplo n.º 8
0
            $dsql->Close();
            exit;
        }
        $pname = $row['pname'];
        $price = $row['money'];
    }
}
if ($product == 'card') {
    $okptype = $ptype . ' : 未获得卡号';
} else {
    $okptype = $ptype;
}
//保存定单信息
$inquery = "\n   INSERT INTO #@__member_operation(`buyid` , `pname` , `product` , `money` , `mtime` , `pid` , `mid` , `sta` ,`oldinfo`) \n   VALUES ('{$buyid}', '{$pname}', '{$product}' , '{$price}' , '{$mtime}' , '{$pid}' , '{$mid}' , '0' , '{$ptype}');\n";
$isok = $dsql->ExecuteNoneQuery($inquery);
if (!$isok) {
    echo "数据库出错,请重新尝试!" . $dsql->GetError();
    $dsql->Close();
    exit;
}
if ($price == '') {
    echo "无法识别你的订单!";
    $dsql->Close();
    exit;
}
$pagePos = 'post_to_pay';
if (empty($cfg_online_type)) {
    $cfg_online_type = 'none';
}
require_once dirname(__FILE__) . '/config_pay_' . $cfg_online_type . '.php';
require_once dirname(__FILE__) . '/templets/buy_action_' . $cfg_online_type . '.htm';