廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 3284 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
konsi
數位造型
個人文章 個人相簿 個人日記 個人地圖
路人甲
級別: 帳號封鎖 該用戶目前不上站
推文 x0 鮮花 x0
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[<5.0][優化] 按進編輯帖子ˍ修改為較體貼的顯示ˍ及對應刪除附件
【插件名稱】按進編輯帖子ˍ修改為較體貼的顯示ˍ及對應刪除附件
【適用版本】3.01
【插件來源】轉貼
【插件類型】優化
【是否升級資料庫】
【插件介紹】

修正了 按進 [ 編輯 ] 刪除主題或回覆帖子 不對應也刪除附件的錯誤

亦加入較實用的刪除 若開啟了回收站 自行刪除自己的發表 而這主題帖又無回覆

亦會移到回收站 若管理員進入看到帖子無問題 以為是板主誤將帖子刪除

管理員便會將這帖子移回適當區內 構成會員發錯帖 自行刪除也被將帖子回復的錯誤

所以加入了程式 主題帖沒有人回覆過 而發帖者亦是刪除者 將會直接刪除 不移到回收站

只要是發帖者不是刪除者 或是板主刪除別人的主題時 才會移到回收站
=======================================================
修改檔案 ( 請先將這兩份檔案備份 )

require/postmodify.php
template/wind/post.htm
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
-->
require/postmodify.php 最頂找
複製程式
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=]
            }
        }
if(!$db_recycle || $fid==$db_recycle || $winduid==$authorid){
以上這段的 || $winduid==$authorid

就是 發主題者刪除自己未有回覆的主題 將會直接刪除

若你想也移到回收站 可將這句刪除   || $winduid==$authorid 改回以下

if(!$db_recycle || $fid==$db_recycle){



獻花 x0 回到頂端 [樓 主] From:台灣中華電信 | Posted:2005-11-16 16:54 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.014308 second(s),query:15 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言