[HACK]后台清理短消息加强 By Polo!
------------------------------------------------------------
后台清理短消息加强
------------------------------------------------------------
版本: 1.0
作者: Polo!
更新: ------
说明:
加入主题内容关键字和文件夹 ( 收件箱或 / 及发件箱 ) 的选择
修改:
admin/prune.php
admin/tpl/prune_pm.php
admincp.lang.php 语言包
------------------------------------------------------------
第一步: admin/prune.php
找到
- $db->query("DELETE FROM $table_pms WHERE dateline<='$prunedate' $pruneuser $prunenew");
复制代码
换成
- // ------------------------------------------------------------
- // Prune PM Enhancing
- // 27-06-2005 By Polo!
- // ------------------------------------------------------------
-
- $foldersql = $keywordssql = NULL;
- $keywords = trim($keywords);
- if($keywords != '') {
- $or = '';
- $keywords = explode(',', str_replace(' ', '', $keywords));
- for($i = 0; $i < count($keywords); $i++) {
- $keywordssql .= " $or subject LIKE '%".$keywords[$i]."%' OR message LIKE '%".$keywords[$i]."%'";
- $or = 'OR';
- }
- $keywordssql = " AND ($keywordssql)";
- }
- if($folder <> 'both' && in_array($folder, array('inbox', 'outbox'))) {
- $foldersql = " AND folder='$folder'";
- }
- // ------------------------------------------------------------
- // $db->query("DELETE FROM $table_pms WHERE dateline<='$prunedate' $pruneuser $prunenew");
- // ------------------------------------------------------------
- $db->query("DELETE FROM $table_pms WHERE dateline<='$prunedate' $pruneuser $prunenew $keywordssql $foldersql");
- // ------------------------------------------------------------
复制代码
第二步: admin/tpl/prune_pm.php
找到
- <tr><td bgcolor="<?=ALTBG1?>"><?=$lang['prune_pm_user']?></td>
- <td bgcolor="<?=ALTBG2?>" align="right"><input type="text" name="users" size="40"></td></tr>
复制代码
下加
- <tr><td bgcolor="<?=ALTBG1?>"><?=$lang['prune_keyword']?></td>
- <td align="right" bgcolor="<?=ALTBG2?>"><input type="text" name="keywords" size="40"></td></tr>
- <tr>
- <td bgcolor="<?=ALTBG1?>"><?=$lang['prune_pm_folder']?></td>
- <td align="right" bgcolor="<?=ALTBG2?>"><select name="folder"><option value="both"><?=$lang['prune_pm_folder_option1']?></option><option value="inbox"><?=$lang['prune_pm_folder_option2']?></option><option value="outbox"><?=$lang['prune_pm_folder_option3']?></option></select></td>
- </tr>
复制代码
第三步: admincp.lang.php 语言包
找到
- 'prune_pm_user' => '按用户名清理(大小写敏感,用户名间用半角逗号 "," 分割):',
复制代码
下加
- 'prune_pm_folder' => '文件夹:',
- 'prune_pm_folder_option1' => '收件箱及发件箱',
- 'prune_pm_folder_option2' => '收件箱',
- 'prune_pm_folder_option3' => '发件箱',
复制代码
完成 |