Roundcube Community Forum

 

Summary Plugin question

Started by deltatech, May 02, 2011, 12:55:27 AM

Previous topic - Next topic

deltatech

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.

rosali

This would need code modifications. Due to performance concerns I won't implement a walk-through all imap folders.
Regards,
Rosali

deltatech

Quote from: rosali;34550This 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.

rosali

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