引用 | 编辑
konsi
2005-11-16 16:54 |
楼主
|
||
x0
【插件名称】按进编辑帖子ˍ修改为较体贴的显示ˍ及对应删除附件【适用版本】3.01 【插件来源】转贴 【插件类型】优化 【是否升级资料库】否 【插件介绍】 修正了 按进 [ 编辑 ] 删除主题或回覆帖子 不对应也删除附件的错误 亦加入较实用的删除 若开启了回收站 自行删除自己的发表 而这主题帖又无回覆 亦会移到回收站 若管理员进入看到帖子无问题 以为是板主误将帖子删除 管理员便会将这帖子移回适当区内 构成会员发错帖 自行删除也被将帖子回复的错误 所以加入了程式 主题帖没有人回覆过 而发帖者亦是删除者 将会直接删除 不移到回收站 只要是发帖者不是删除者 或是板主删除别人的主题时 才会移到回收站 ======================================================= 修改档案 ( 请先将这两份档案备份 )template/wind/post.htm 找 复制程式 <!-- EOT; if($action=='modify'){print <<<EOT --> <form method=post name=form action=post.php?> <table cellPadding=0 cellSpacing=1 width=颼%' $i_table> <tr><td class=head colspan=2><b>修改文章</b></td></tr> <tr><td height=ཕ' class='t_one' colspan=2><b>删除贴子(此操作不可恢复,请慎重使用!)</b></td></tr> <tr><td width=ྛ%' class='t_one'><b>注意: 如果这个贴子是主题内的第一个贴子且已有人回覆此贴,需拥有管理权限才能删除。</b></td> <td height=ཕ'width=Ƌ%' align=right class='t_one'> <input type='submit' value='直接删除'> </td></tr></table> <input type=hidden value=1 name=step> <input type=hidden value='$action' name='action'> <input type=hidden value='$fid' name=fid> <input type=hidden value='$tid' name=tid> <input type=hidden value='$pid' name=pid> <input type=hidden value='$pollid' name=pollid> <input type=hidden value='$article' name=article> </form> <!-- EOT; }print <<<EOT --> 复制程式 <!-- EOT; if($action=='modify'){ if($gp_allowdelatc){ if($pid == 'tpc'){ if($tidcount == Ƈ'){ print <<<EOT --> <form method=post name=form action=post.php?> <table cellPadding=3 cellSpacing=1 width=颼%' $i_table> <tr><td class=head colspan=2>修改文章</td></tr> <tr><td class='t_one' align=center><font color=red>删除主题帖 ( 此操作不可恢复,请慎重使用!)</font></td> <td width=Ƌ%' align=right class='t_one'> <input type='submit' style='color:red;' value='直接删除'> </td></tr></table> <input type=hidden value=1 name=step> <input type=hidden value='$action' name='action'> <input type=hidden value='$fid' name=fid> <input type=hidden value='$tid' name=tid> <input type=hidden value='$pid' name=pid> <input type=hidden value='$pollid' name=pollid> <input type=hidden value='$article' name=article> </form> <!-- EOT; }else{print <<<EOT --> <table cellPadding=3 cellSpacing=1 width=颼%' $i_table> <tr><td class=head colspan=2>修改文章</td></tr> <tr><td class='t_one' align=center>这个主题帖已有 $tidusercount 人回覆,必需拥有管理权限才能删除。您只可删除未有人回覆的主题帖。</td> </td></tr></table> <!-- EOT; }}else{print <<<EOT --> <form method=post name=form action=post.php?> <table cellPadding=3 cellSpacing=1 width=颼%' $i_table> <tr><td class=head colspan=2>修改文章</td></tr> <tr><td class='t_one' align=center><font color=red>删除回覆帖 ( 此操作不可恢复,请慎重使用!)</font></td> <td width=Ƌ%' align=right class='t_one'> <input type='submit' style='color:red;' value='直接删除'> </td></tr></table> <input type=hidden value=1 name=step> <input type=hidden value='$action' name='action'> <input type=hidden value='$fid' name=fid> <input type=hidden value='$tid' name=tid> <input type=hidden value='$pid' name=pid> <input type=hidden value='$pollid' name=pollid> <input type=hidden value='$article' name=article> </form> <!-- EOT; }}else{print <<<EOT --> <table cellPadding=3 cellSpacing=1 width=颼%' $i_table> <tr><td class=head colspan=2>修改文章</td></tr> <tr><td class='t_one' align=center>抱歉!您的用户组权限不允许删除自己发表的帖子。</td> </td></tr></table> <!-- EOT; }}print <<<EOT --> 复制程式 if($article==0){ $tpcdb=$db->get_one("SELECT tm.aid,tm.ifsign,t.tid,t.fid AS tfid,t.author,t.authorid,t.icon,t.locked,t.postdate,t.subject,t.type,t.ifcheck,t.pollid,tm.content FROM pw_threads t LEFT JOIN pw_tmsgs tm ON tm.tid=t.tid WHERE t.tid='$tid'"); !$tpcdb['tid'] && Showmsg('illegal_tid'); @extract($tpcdb); 复制程式 if($article==0){ $tpcdb=$db->get_one("SELECT tm.aid,tm.ifsign,t.tid,t.fid AS tfid,t.author,t.authorid,t.icon,t.replies,t.locked,t.postdate,t.subject,t.type,t.ifcheck,t.pollid,tm.content FROM pw_threads t LEFT JOIN pw_tmsgs tm ON tm.tid=t.tid WHERE t.tid='$tid'"); !$tpcdb['tid'] && Showmsg('illegal_tid'); @extract($tpcdb); $tidcount=$tpcdb['replies']; $tidcount++; $tidusercount=$tidcount-1; 将会直接删除 不移到回收站 及对应也删除帖中的附件 require/postmodify.php 找 复制程式 $topic='' if($article==0){ $deltype='Del topic' $msg_delrvrc=$db_dtdelrvrc; if($count==1){ $topic=1; if(!$db_recycle || $fid==$db_recycle){ $db->update("DELETE FROM pw_tmsgs WHERE tid='$tid'"); $db->update("DELETE FROM pw_threads WHERE tid='$tid'"); 复制程式 $topic='' if($article==0){ $deltype='Del topic' $msg_delrvrc=$db_dtdelrvrc; if($count==1){ $topic=1; if(!$db_recycle || $fid==$db_recycle || $winduid==$authorid){ $db->update("DELETE FROM pw_tmsgs WHERE tid='$tid'"); $db->update("DELETE FROM pw_threads WHERE tid='$tid'"); if($aid){ $attachs= unserialize(stripslashes($aid)); foreach($attachs as $key=>$value){ @unlink("$attachpath/$value[attachurl]"); $db->update("DELETE FROM pw_attachs WHERE aid='$key'"); $atc_content=str_replace("[attachment=$key]","",$atc_content);//删除附件的同时删除帖子内容中的[attachment=] } } 以上这段的 || $winduid==$authorid 就是 发主题者删除自己未有回覆的主题 将会直接删除 若你想也移到回收站 可将这句删除 || $winduid==$authorid 改回以下 if(!$db_recycle || $fid==$db_recycle){ x0
|