next up previous contents
Next: login.php Up: 目錄 src Previous: empty_trash.php   Contents

left_main.php

  1. 左側主頁程式,preg_split 函式的 flag 為 PREG_SPLIT_NO_EMPTY,不是 PREG_SPLIT_NI_EMPTY,且不能用單引號括起來。
    [root@mail squirrelmail-1.4.8]# diff -wuN ./src/left_main.php /var/www/squirrelmail/src/left_main.php
    --- ./src/left_main.php	2006-04-15 06:27:08.000000000 +0800
    +++ /var/www/squirrelmail/src/left_main.php	2013-05-23 16:39:03.000000000 +0800
    
  2. 讓其他目錄中有未讀郵件,也如收件匣一樣,可以顯示未讀郵件筆數提醒。
    @@ -48,8 +48,8 @@
         }
         $unseen = 0;
         $status = array('','');
    -    if (($unseen_notify == 2 && $real_box == 'INBOX') ||
    -        $unseen_notify == 3) {
    +    if ($unseen_notify == 2  || $unseen_notify == 3) {
                 $tmp_status = create_unseen_string($real_box, $box_array, $imapConnection, $unseen_type );
                 if ($status !== false) {
                     $status = $tmp_status;
    
  3. 讓其他目錄中有未讀郵件,也如收件匣一樣,可以顯示未讀郵件筆數提醒,上述的做法是錯的。變數 $ubseen_notify 取得的預設值由設定 /etc/squirrelmail/config.php 取得,其定義可以由預設設定檔查到:1 代表都不顯示;2 代表只有 INBOX 目錄; 3 代表全部目錄都顯示,因此只要修改設定檔即可。
    [root@mail ~]# grep default_unseen_notify -C3 /etc/squirrelmail/config_default.php 
    /**
     * These next two options set the defaults for the way that the
     * users see their folder list.
     *   $default_unseen_notify
     *       Specifies whether or not the users will see the number of 
     *       unseen in each folder by default and also which folders to
     *       do this to. Valid values are: 1=none, 2=inbox, 3=all.
     *   $default_unseen_type
     *       Specifies the type of notification to give the users by
     *       default. Valid choice are: 1=(4), 2=(4,25).
     * @global integer $default_unseen_notify
     * @global integer $default_unseen_type
     */
    $default_unseen_notify = 2;
    $default_unseen_type   = 1;
    
    /**
    
  4. 修改 squirrelmail 設定檔 /etc/squirrelmail/config.php 的 $default_ubseen_notify = 3 即可讓所有目都顯示未讀郵件數量。
    [root@mail ~]# vim /etc/squirrelmail/config.php
    [root@mail ~]# grep default_unseen_notify /etc/squirrelmail/config.php 
    $default_unseen_notify          = 3;
    
  5. 讓 Spam 目錄也有清空垃圾埇的功能。
    @@ -92,7 +93,7 @@
         }
     
         /* If it's the trash folder, show a purge link when needed */
    -    if (($move_to_trash) && ($real_box == $trash_folder)) {
    +    if (($move_to_trash) && (($real_box == $trash_folder) || ($real_box == 'Spam'))) {
             if (! isset($numMessages)) {
                 $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
             }
    @@ -100,7 +101,7 @@
             if (($numMessages > 0) or ($box_array['parent'] == 1)) {
                 $urlMailbox = urlencode($real_box);
                 $line .= "\n<small>\n" .
    -                    '&nbsp;&nbsp;(<a href="empty_trash.php" style="text-decoration:none">'._("Purge").'</a>)' .
    +                    '(<a href="empty_trash.php?purge='.$real_box.'" style="text-decoration:none">'._("Purge").'</a>)' . //dywang
                         '</small>';
             }
    



2016-03-11