引用 | 編輯
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
|