RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > SVN Releases > Requests

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 12-12-2006, 03:04 AM
Registered User
 
Join Date: Jun 2006
Posts: 40
Downloads: 0
Uploads: 0
Default Integrating a new message icon

OK, so this isn't a full-blown request, per se, owing to the fact that I just need some guidance on what to do.

Here's what I want:

Some people may be familiar with my web site and its installation of Roundcube. My site is fully powered by phpBB and one of the perks is a free email account that is activated upon sign up. This email account can be accessed by web mail. I've made a page to make web mail access easier- all one has to do is login to my site, click the email icon, enter their password again, and the Roundcube inbox automagically loads.

Now, what I want to do is make that icon "smart." A user would sign into his Mac GUI account. Without needing to open up Roundcube webmail, that email icon at the top of the page would change to reflect how many new unread emails his account has.



So I want, on each page load ( or perhaps have it cached for each session), to have the user logged into Roundcube, grab the number of new unread mails, then output that back to my main script. The icon would then change to show how many new emails there are. This would eliminate the extra step of having to login constantly to check if new mails are available; one could simply browse my Mac GUI site and be updated if any new email arrives.

I don't need anyone to program this for me, I can do it myself, I just need some pointers, some guides for which code to look through to log a user into Roundcube, grab the # of new mails, and spit that out into my main site's pages.

If you're not sure about what I want, or want to see my current email system in action, the link to my site is in my signature.

-Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 12-12-2006, 01:44 PM
mrJ mrJ is offline
Registered User
 
Join Date: Sep 2006
Posts: 2
Downloads: 0
Uploads: 0
Default Re: Integrating a new message icon

this is something that i would be interested in getting onto my site as well - let me know how you get on... but I wouldn't know where exactly to start!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 12-12-2006, 02:03 PM
Registered User
 
Join Date: Jun 2006
Posts: 106
Downloads: 0
Uploads: 0
Default Re: Integrating a new message icon

you can do this via imap server. involving roundcube into it is almost same as using thunderbird to get unread message count.
see http://www.phptutorial.info/index.php?q=imap-status (php needs imap plugin, see http://ee2.php.net/manual/en/ref.imap.php)
__________________
irc://irc.freenode.net:6667/#roundcube
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 12-14-2006, 08:09 PM
Registered User
 
Join Date: Jun 2006
Posts: 40
Downloads: 0
Uploads: 0
Default Re: Integrating a new message icon

thanks for the info!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 01-10-2007, 10:32 PM
Registered User
 
Join Date: Jun 2006
Posts: 40
Downloads: 0
Uploads: 0
Default Re: Integrating a new message icon

OK, I put it live yesterday and it doesn't appear to work. Here's what I'm using:

Code:
//
// Obtain number of new emails
// if user is logged in
//
if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) && $userdata['web_activated'] && $userdata['user_raw_pwd'] )
{

	// Domain is the user name, but still needs to filtered for legacy members on older accounts

	// Format the members username to make it acceptable
	$domain = $userdata['username'];
	$domain = strtolower($domain);

	$drop_char_match =  array('^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '?', '%', '-', '~', '+', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!', '*', ' ');
    $drop_char_replace = array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '' , '', '', '', '', '', '', '_'); 

	// Filter out non-alphabetical chars
	$domain = str_replace($drop_char_match, $drop_char_replace, $domain);
		
	$email_username = $domain . "@macgui.com";
	$web_raw_pwd = $userdata['user_raw_pwd'];

	$mbox = imap_open("{mail.macgui.com}", "$email_username", "$web_raw_pwd", OP_HALFOPEN);

	$email_status = imap_status($mbox, "{mail.macgui.com}INBOX", SA_ALL);

	if ($email_status)
	{
		$new_emails = $status->unseen;
	}

	imap_close($mbox);
}

// Based on previous data, let's decide what eMail icon to show...
if ($new_emails > 0)
{
$icon_email = '_plus';
}
else
{
$icon_email = '';
}
And icon_email goes to template var:

Code:
	'UNREAD_EMAIL_IMG' => $icon_email,
Like so:

Code:
"><img src="{U_DIR}gfx/header/header_email{UNREAD_EMAIL_IMG}.gif" alt="eMail" border="0">
Please help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 01-18-2007, 11:16 PM
Registered User
 
Join Date: Jun 2006
Posts: 40
Downloads: 0
Uploads: 0
Default Re: Integrating a new message icon

bump

Help, please!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 01:43 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2006-2008 RoundCube Webmail Community