1
DarkDeath
Alerts for Private Messaging
  • 2003/7/25 21:45

  • DarkDeath

  • Just popping in

  • Posts: 29

  • Since: 2002/8/17


Alrighty, well i have posted this in another forum here, but have gotten no response so iw as hoping that perhaps it would be better placed here. Firstly, I am running version RC3. Anyways I am trying to set something up so taht when a user recieves a new private message they recieve a pop up window alert saying You have # new messages in your Inbox. Click HERE to read them. Or something. OR if not in a popup just a line of text i can place somewhere pertinent that would say essentially the same thing jsut not in its own popup. ANYBODY know what im talking about?

I have a little information as I have been at this for months. I know the private mesaging system works by sending mySQL entries from one user id to another user id. Hence the columns "from_userid" and "to_userid". I believe that i will need to query through php the entire table of pvtmsgs and have it see if that users ID has any entries in the "to)userid" column, AS WELL AS in the "read_msg" column, (which i think is an entry of 1 for unread and 0 for read). Can someone help me with the rest of this puzzle?!?

2
onokazu
Re: Alerts for Private Messaging
  • 2003/7/25 22:03

  • onokazu

  • XOOPS Founder

  • Posts: 617

  • Since: 2001/12/13


Try the code something like below

if($xoopsUser) {
  
$pm_handler =& xoops_gethandler('privmessage');
  
$criteria = new CriteriaCompo(new Criteria('read_msg'0));
  
$criteria->add(new Criteria('to_userid'$xoopsUser->getVar('uid')));
  
$count $pm_handler->getCount($criteria);
}


$xoopsUser is the current user and $count will now contain the number of message the user have not yet read.

3
DarkDeath
Re: Alerts for Private Messaging
  • 2003/7/25 22:15

  • DarkDeath

  • Just popping in

  • Posts: 29

  • Since: 2002/8/17


WOW... finally someone who knows whats going on! Thankyou so much for the help! However, I am unclear on where to put this.. am i putting this in my theme.php file? and am i placing this code where i want the number to showe up? or do i have to display it using $count?? Thankyou for the help so far!

4
DarkDeath
Re: Alerts for Private Messaging
  • 2003/7/27 18:25

  • DarkDeath

  • Just popping in

  • Posts: 29

  • Since: 2002/8/17


Bumb.....i am so close.... thanks for the help... but im still a tad unclear....on placment of the code.... please help! I am using version 1.3.8 RC3

5
DarkDeath
Re: Alerts for Private Messaging
  • 2003/9/9 5:09

  • DarkDeath

  • Just popping in

  • Posts: 29

  • Since: 2002/8/17


PLEASE someone give me na update on this!!! I am desperatly in need of finding a way to alert users to new PM's. I KNOW i can set a link to their inbox, but life would be 1000000 times simplier if i could get an alert to pop-up. Something like vB does when you get PM's. Would be FANTSTIC!!!!!!!!!!!!!!!!!

Someone PLEASE PLEASE PLEASE help me?!?!

6
zer0fill
Re: Alerts for Private Messaging
  • 2004/6/11 18:56

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


^bump

Has there been any updates that allow this in 2.0.6; receiving an email and/or popup alert when a new PM arrives?

7
intel352
Re: Alerts for Private Messaging
  • 2004/6/11 20:57

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


why not just inform the users that in the User Menu block, their Inbox will highlight red with the number of new messages that they currently have...


as for placement of a popup hack, try editing the User Menu block (somewhere in the modules/system directory, i'm guessing). the block already has code to detect when a user has a new pm, so likely the block and block template could be edited to generate a popup upon receipt of a new pm

btw, i'm using 2.0.6 as a reference. also, instead of modifying an older version of xoops, why not just upgrade and see if it meets your needs? no need to reinvent the wheel

Login

Who's Online

151 user(s) are online (106 user(s) are browsing Support Forums)


Members: 0


Guests: 151


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits