![]() |
|
|
|||||||
| For more information about the ads and why they're here, please see the FAQ |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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! |
|
#2
|
|||
|
|||
|
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!
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
thanks for the info!
|
|
#5
|
|||
|
|||
|
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 = '';
}
Code:
'UNREAD_EMAIL_IMG' => $icon_email, Code:
"><img src="{U_DIR}gfx/header/header_email{UNREAD_EMAIL_IMG}.gif" alt="eMail" border="0">
|
|
#6
|
|||
|
|||
|
bump
Help, please! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
| For more information about the ads and why they're here, please see the FAQ |