Author Topic: Summary Plugin question  (Read 4907 times)

Offline deltatech

  • Jr. Member
  • **
  • Posts: 41
Summary Plugin question
« on: May 02, 2011, 12:55:27 AM »
Does anyone know how to get the summary plugin to display the counts of ALL imap folders?

Mine only shows the special folders and I want to display all folders so the users can easily see how big they are getting.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Summary Plugin question
« Reply #1 on: May 02, 2011, 07:58:41 AM »
This would need code modifications. Due to performance concerns I won't implement a walk-through all imap folders.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline deltatech

  • Jr. Member
  • **
  • Posts: 41
Summary Plugin question
« Reply #2 on: May 02, 2011, 04:18:53 PM »
Quote from: rosali;34550
This would need code modifications. Due to performance concerns I won't implement a walk-through all imap folders.


Can you give me a clue where to start?  I may develop my own version of the plugin.    

I am thinking of having a cron job get the stats of the other folders and store them in the database.  That way the user won't have to wait for the info from those folders.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Summary Plugin question
« Reply #3 on: May 02, 2011, 04:58:28 PM »
Did you see the quota indicator? People will see there how big they are getting.

It is not so easy to do this by a cron, because you must access Roundcube index.php to have all built-in classes/methods available.

Basically you get counts by ...
$rcmail->imap->messagecount('INBOX', 'ALL', TRUE);
[INBOX has to be replaced by the folder name]

The list of all folders can be obtained by ...
$rcmail->imap->list_mailboxes(); [returns an array]

Roundcube remembers folder stats in $_SESSION.

I don't know, if this is already available when summary plugin jumps in. You have to test.

A general hint: Look in ./program/include. This folders contain most of the classes used by Roundcube. So you can easily find starting points there.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)