Welcome to Geeklog, Anonymous Saturday, May 04 2024 @ 04:50 am EDT

Geeklog Forums

PrivateMessage Popup dialog


Anonymous

Anonymous
Hey guys,

Is there an existing way to have a dialog popup (like just an alert) to tell the user that they have a new private message?

Thanks

Big Celebration
 Quote

Status: offline

jnordquist

Forum User
Full Member
Registered: 03/14/03
Posts: 129
Location:Kenosha
I got this one to pop up using a plugin from portalparts:

on all pages in Left blocks, position 1. Works well. Only when a PM is waiting.

Login to kenoshaonline.net and the PM initially sent will give you a sample how it works.

For some reason the image is not displaying in this post. the img url is: here
John Nordquist,
Applications Specialist, medical Technologies
 Quote

Status: offline

vadertech

Forum User
Full Member
Registered: 05/26/03
Posts: 329
Open system/lib-custom.php. At the bottom before the php close tag ( ?> )Wink add the following.

Text Formatted Code
function phpblock_newmessages() {
   global $_USER, $_CONF, $_TABLES, $LANG_MSG00, $CONF_MSG;
   // If restricted access has been enabled in the plugins config.php then check access right
   $retval = "";
   if ($_USER['uid'] > 1 AND (!$CONF_MSG['RestrictedAccess'] OR SEC_hasRights('messenger.user')) ) {
       // Check and see if user wants to view Broadcast messages - if not exclude them
       if (DB_getItem($_TABLES['messenger_userinfo'],"broadcasts", "uid={$_USER['uid']}") == '1') {
            $sql = DB_query("SELECT count(*) as count FROM {$_TABLES['messenger_dist']} dist LEFT JOIN {$_TABLES['messenger_msg']} msg ON dist.msg_id=msg.id WHERE (target_uid = {$_USER['uid']} AND read_date is NULL) ");
       } else {
           $sql = DB_query("SELECT count(*) as count FROM {$_TABLES['messenger_dist']} dist LEFT JOIN {$_TABLES['messenger_msg']} msg ON dist.msg_id=msg.id WHERE (target_uid = {$_USER['uid']} AND read_date is NULL) OR (target_uid = '0' AND archive='0')");
       }
       list($count) = DB_fetchArray($sql);
       if ($count > 0) {
            $retval = '<a href="' . $_CONF['site_url'] . '/messenger/index.php">' . $LANG_MSG00['usermenu'] . ' (' .$count. ')</a>';
       }
  }
  return $retval;
}

 


Now create a new block called Message and in Block Function box put "phpblock_newmessages" (without the quotes)

I think that's everything.

(credit) I believe I got this code from portalparts.com


GeekLog Hosting, Installations and Upgrades - WWW.AWEHOST.COM - Hosting starts @ only $4.95/mo.
 Quote

andrew

Anonymous
Hi Vader,

I am new to geeklog and it's programming style, how exactly would I do this for index.php?
 Quote

Status: offline

vadertech

Forum User
Full Member
Registered: 05/26/03
Posts: 329
Quote by andrew: Hi Vader,

I am new to geeklog and it's programming style, how exactly would I do this for index.php?


Sorry I forgot to add that this block is for glmessenger.
GeekLog Hosting, Installations and Upgrades - WWW.AWEHOST.COM - Hosting starts @ only $4.95/mo.
 Quote

All times are EDT. The time is now 04:50 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content