dedecms5.7织梦调用文档评论次数的办法

网站建设 2022-07-27 09:12www.1681989.com免费网站
建站解决办法 cmsxx_archives 添加postcount t(10) UNSIGNED default 0 然后打开plus\feedback.php 找到大约220左右 //保存评论内容 if($type == ments) { $arctitle = addslashes($title); if($msg!=) { $query = INSERT […]



建站解决办法

cmsxx_archives 添加postcount t(10) UNSIGNED default 0
然后打开plus\feedback.php 找到大约220左右
//保存评论内容
if($type == 'ments')
{
$arctitle = addslashes($title);
if($msg!='')
{
$query = "INSERT INTO `cmsxx_feedback`(`aid`,`typeid`,`username`,`arctitle`,`ip`,`ischeck`,`dtime`, `mid`,`bad`,`good`,`ftype`,`face`,`msg`)
VALUES ('$aid','$typeid','$username','$arctitle','$ip','$ischeck','$dtime', '{$cfg_ml->M_ID}','0','0','$feedbacktype','$face','$msg'); ";
//插入位置1
$rs = $dsql->ExecuteNoneQuery($query);
if(!$rs)
{
echo $dsql->GetError();
exit();
}
//插入位置2
插入位置1内容:
$rowc = $dsql->GetOne("Select count() as count from `cmsxx_feedback` where aid ='$aid'");
$pcount = $rowc ['count'];
$query2 = "update `cmsxx_archives` set postcount = '$pcount' where id = '$aid'";
插入位置2内容:
$rs = $dsql->ExecuteNoneQuery($query2);
if(!$rs)
{
echo $dsql->GetError();
exit();
}

只需要复制以上内容到你想调用的地方即可。 


Copyright © 2016-2025 www.1681989.com 推火网 版权所有 Power by