编辑和删除功能如下: (发表内容为空,表示删除)
代码修改如下
misc.php
elseif($action == 'oreply') {
$query = $db->query("SELECT pid,onereply FROM {$tablepre}posts WHERE pid='$pid' and onereplyt<>0 limit 1");
$replytext = '请输入你的回复内容,建议不超过32个汉字。';
if($onereply = $db->fetch_array($query)) {
$replytext = $onereply['onereply'];
}
if(!submitcheck('oreplysubmit')) {
include template('onereply');
}else{
$neworeply=trim($neworeply);
if($neworeply!='')
{
$db->query("UPDATE {$tablepre}posts SET onereply='$neworeply', onereplyu='$discuz_user', onereplyt = '$timestamp' WHERE pid='$pid'"); !$inajax ? showmessage('post_onereply_succeed',"viewthread.php?tid=$tid&page=$page#pid$pid") : showmessage('ajax_post_onereply_succeed');
}
else
{
$db->query("UPDATE {$tablepre}posts SET onereply='', onereplyu='', onereplyt = '0' WHERE pid='$pid'");
showmessage('帖内回复已经删除, 刷新查看.');
}
}
}
版主附件: onereply.htm
查找 {lang post_onereply_mo}
共两个都替换为 $replytext
[ 本帖最后由 qiank128 于 2008-6-6 13:25 编辑 ] |