Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
PM RedAlert - show unread PMs on every page Details »»
PM RedAlert - show unread PMs on every page
Version: 1.00, by Overgrow Overgrow is offline
Developer Last Online: Jun 2004 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-01-2002 Last Update: Never Installs: 14
 
No support by the author.

Disclaimer:

-No support is offered for this hack. If you PM or email for support, it will be joyfully ignored. When I have time, I will answer questions in this thread.


PM RedAlert

Problem: PM Popups are OK but not everyone likes them or uses them. Sometimes you'll cancel them and forget you have new ones to read.

Solution: If your site has a "Private Messages" link on every page, like mine, then an effective way to notify people that they have new PMs is to subtly change that link. PM Popup will still work if they have that activated.. and this is not like Chen's hack since that is only concerned with the index page. This hack is meant for site wide private message links that you would likely have in the header. (See attached screenshot)


Design Spec:

Alert users that they have new PMs on every page by subtly
changing a link style.


Steps for installation:

-add one field to table user 'unreadpm'
-edit two files 'private.php' 'private2.php'
-upload the two files
-edit header


Tested on: 2.2.1

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-02-2002, 04:54 PM
Overgrow's Avatar
Overgrow Overgrow is offline
 
Join Date: Nov 2001
Posts: 320
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screenshot-- when a user has a new private message, the "Private Msgs" link will turn yellow and stay yellow until the user goes into Private Messaging. Of course it doesn't have to be "yellow" -- by checking the new variable $bbuserinfo[pmunread], you can do whatever you want.. make something animate, blink, turn fuscia, etc.
Reply With Quote
  #3  
Old 03-02-2002, 04:58 PM
Psychdrone Psychdrone is offline
 
Join Date: Nov 2001
Posts: 525
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

its nice, and thanks!

but I think I will stick with fireflys hack
Reply With Quote
  #4  
Old 03-02-2002, 05:00 PM
Overgrow's Avatar
Overgrow Overgrow is offline
 
Join Date: Nov 2001
Posts: 320
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Two different goals with two different hacks.. Firefly's affects the index.php home page. Mine is meant if you have a "Private Messaging" link in your header on every page.
Reply With Quote
  #5  
Old 03-02-2002, 05:55 PM
DjSap DjSap is offline
 
Join Date: Nov 2001
Location: Stockholm, Sweden
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks, was planing on doing this for my board but now it dont have to, very nice
Reply With Quote
  #6  
Old 03-02-2002, 06:41 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wrote this hack for my board but didn't add another table to the database...think my way is a little more simple since it requires no DB change but the end result is the same.

In global.php

after:

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));


I put:

PHP Code:

 
// Start Glow PM in Header Hack
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[user
id] AND messageread=0 AND folderid=0 
$ignoreusers");
if (
$unreadpm['messages']==0) {
$pmglow='PM';
} else { 
$pmglow='<font color="red">New PM\'s</font>'

then in the header file just replace where the text that says PM is with the variable $pmglow and if the messages are unread it glows in red New PM's and if all messages have been read than it just reads "PM" in the regular color.

If you are using an image you can change the attribute for $pmglow to swap out the image or put an effect on it...whatever you like.
Reply With Quote
  #7  
Old 03-02-2002, 06:45 PM
Overgrow's Avatar
Overgrow Overgrow is offline
 
Join Date: Nov 2001
Posts: 320
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got a link to it? Or mind describing what you checked to see if there were unread PMs? I didn't use the pmpopup since it gets turned off once the javascript runs. If you don't use a new field (not a table) then you have to query the PM table each page load, which would be rough on a big site. I'm curious to your solution! thanks..
Reply With Quote
  #8  
Old 03-02-2002, 06:52 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Overgrow,

Yes my solution does add that one extra query to each page. Guess it's a tradeoff depending on your site load versus wanting to add the extra DB field? It's fast query as userid is an indexed key in the pm table though.
Reply With Quote
  #9  
Old 03-02-2002, 06:52 PM
Overgrow's Avatar
Overgrow Overgrow is offline
 
Join Date: Nov 2001
Posts: 320
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah yea, I avoided the extra query by including it in $bbuserinfo. For sites concerned about their database load, adding a new user field is preferable to adding a new query.. though your solution works just as well! Thanks.

And as Freddie pointed out to me somewhere else, I should remember to check what fields are indexed before determining what would be a slow query or not.
Reply With Quote
  #10  
Old 03-02-2002, 07:01 PM
mvigod mvigod is offline
 
Join Date: Dec 2001
Location: Jersey
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just read through your hack and that extra query will be saved as you said. Just 2 different ways to skin a cat.

If a site is really loaded heavy I'd go Overgrow's route to save the one query but otherwise either works nicely.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 02:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04284 seconds
  • Memory Usage 2,297KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete