在discuz论坛中删除主题出现一下错误:
Warning: implode(): Bad arguments. in e:\web\include\post.func.php on line 342
Discuz! info: MySQL Query Error
User: admin
Time: 2008-1-24 10:41pm
Script: /topicadmin.php
SQL: Update cdb_members SET Where uid = 37
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Where uid = 37' at line 1
Errno.: 1064
Similar error report has beed dispatched to administrator before.
当论坛积分设置当中和板块设置当中对于上传附件没有设置积分策略的时候,版主删除含有附件的帖子可能
会出现程序错误。
解决方法,手工修改:
打开, include/post.func.php 查找:
function updateattachcredits($operator, $uidarray, $creditsarray) {
global $db, $tablepre, $discuz_uid;
$creditsadd1 = '';
if(is_array($creditsarray)) {
foreach($creditsarray as $id => $addcredits) {
$creditsadd1[] = "extcredits$id=extcredits$id$operator$addcredits*\$attachs";
}
}
$creditsadd1 = implode(', ', $creditsadd1);
foreach($uidarray as $uid => $attachs) {
eval("\$creditsadd2 = \"$creditsadd1\";");
$db->query("Update {$tablepre}members SET $creditsadd2 Where uid = $uid", 'UNBUFFERED');
}
}
将上述代码替换为
function updateattachcredits($operator, $uidarray, $creditsarray) {
global $db, $tablepre, $discuz_uid;
$creditsadd1 = array();
if(is_array($creditsarray)) {
foreach($creditsarray as $id => $addcredits) {
$creditsadd1[] = "extcredits$id=extcredits$id$operator$addcredits*\$attachs";
}
}
if(empty($creditsadd1)) return;
$creditsadd1 = implode(', ', $creditsadd1);
foreach($uidarray as $uid => $attachs) {
eval("\$creditsadd2 = \"$creditsadd1\";");
$db->query("Update {$tablepre}members SET $creditsadd2 Where uid = $uid", 'UNBUFFERED');
}
}
文章评论