Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: 1.00, by TWTCommish TWTCommish is offline
Developer Last Online: Dec 2022 Show Printable Version Email this Page

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

What's it do?
Simple: it checks to see how many new PMs a user has. If they've only got one (which is usually the case...I don't think many people get tons of new PMs), the popup JavaScript alert displayed to them will let them know who sent them the message, what it's title is, and, rather than take them to the Inbox, it'll take them directly to the message.

If there's more than one, it'll display a more vague message, letting them know just how many new messages they have, and redirecting them to their Inbox (which is where the current popup directs you). Anyway, here's the hack:


Open global.php. Around line 266 you should see the following:

Code:
$newpmmsg=1;
RIGHT below it, place this (REPLACE your current code for this hack with the code below, if you happen to be one of the few people who actually intalled this originally from the Beta Hacks forum. )

Code:
  $latest_pm = $DB_site->query("SELECT p.privatemessageid AS pm_popup_id, p.title AS pm_popup_title, u.username AS pm_popup_username FROM privatemessage p, user u WHERE messageread = 0 AND p.userid = $bbuserinfo[userid] AND p.fromuserid = u.userid ORDER BY dateline DESC");
  $hack_pm_total  = $DB_site->num_rows($latest_pm);
  
    if ($hack_pm_total > 1) {
      eval("\$pm_popup_text = \"".gettemplate('pm_popup_multiple')."\";");
      eval("\$pm_popup_url  = \"".gettemplate('pm_popup_url_multiple')."\";");
    } else {
      extract($DB_site->fetch_array($latest_pm));
      eval("\$pm_popup_text = \"".gettemplate('pm_popup')."\";");
      eval("\$pm_popup_url  = \"".gettemplate('pm_popup_url')."\";");
    }
Now, create the four new templates. I've attached a file to this post containing the names of the four templates, and the text I've used to populate them -- which will probably be the same text and such you'll want to use. Don't be intimidated...they're all very small.

After that, edit your head_newpm template to make use of the new variables. Here's my use of it (highly suggested):

Code:
<script language="JavaScript">
<!--
function confirm_newpm() {
	input_box = confirm("$pm_popup_text");
	if (input_box == true) { // Output when OK is clicked
		second_box = confirm("Open in new window?\n\n(Press cancel to open your $inboxname in the current window.)");
		if (second_box == true) {
			window.open('$pm_popup_url','pmnew','width=600,height=500,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=50,left=50'); 
		} else {
			window.location = "$pm_popup_url";
		}
	} else {
	// Output when Cancel is clicked
	}
}
-->
</script>
Enjoy.

Show Your Support

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

Comments
  #72  
Old 05-11-2002, 01:36 AM
CeleronXL's Avatar
CeleronXL CeleronXL is offline
 
Join Date: Nov 2001
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know if anyone's done this yet, but I need to keep tabs on all the hacks I install. The only directions in the directions file itself were the new templates, so I made this set of instructions that were included in the first post. If anyone else wants them to keep tabs on the whole thing, here's the entire set of instructions.
Reply With Quote
  #73  
Old 06-06-2002, 07:35 PM
akowacko akowacko is offline
 
Join Date: May 2002
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have the welcome panel hack. no i added your hack and the PM box is gone. i revert to my original files and the pm is still gone. can't see a thing. please help.
Reply With Quote
  #74  
Old 06-06-2002, 07:36 PM
akowacko akowacko is offline
 
Join Date: May 2002
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'm having trouble looking for the original head_newpm template. can someone check if this is the original one?

<script language="JavaScript">
<!--
function confirm_newpm() {
input_box=confirm("You have a new private message. Click OK to view it, or cancel to hide this prompt.");
if (input_box==true) { // Output when OK is clicked
second_box=confirm("Open in new window?\n\n(Press cancel to open your $inboxname in the current window.)");
if (second_box==true) {
window.open('private.php?s=$session[sessionhash]','pmnew','width=600,height=500,menubar=yes,scroll bars=yes,toolbar=yes,location= yes,directories=yes,resizable=yes,top=50,left=50') ;
} else {
window.location="private.php?s=$session[sessionhash]";
}
} else {
// Output when Cancel is clicked
}
}
// -->
</script>

thanks!
Reply With Quote
  #75  
Old 06-06-2002, 07:51 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think we're allowed to post entire templates.
Reply With Quote
  #76  
Old 06-06-2002, 09:56 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried installing this hack and all I could get where script errors. (Line 79). I realluy wanted it, but it doesn't look like it wants to work with my setup. If anybody has any updates that might make it work for me, I'm willing to try them.
Reply With Quote
  #77  
Old 06-06-2002, 10:08 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check your vBulletin Options to make sure you do NOT have each template beginning and ending with an HTML comment. If you do, the hack won't work.
Reply With Quote
  #78  
Old 06-06-2002, 11:07 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I already checked that when you mentioned it in the other post. I reverted back to the standard popup and everything works like it should now. I'd like to get this one going if you can think of anything.
Reply With Quote
  #79  
Old 06-06-2002, 11:25 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm. What error do you get? I'm wondering if the title of the PM or the username of the person who sent it might be interfering...
Reply With Quote
  #80  
Old 06-06-2002, 11:42 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The title was Test and the name of the sender was Brandon. Normal stuff. It was the same kind of error that other user got at around line 88, only mine was 79. An object expected error, or something like that.
Reply With Quote
  #81  
Old 07-06-2002, 12:57 PM
69-FLy-gUy's Avatar
69-FLy-gUy 69-FLy-gUy is offline
 
Join Date: Oct 2001
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm. I am having a little problem.. the PM box won't Pop up....

when i view the source.. the js is there. and says the info, but it won't pop up.
Reply With Quote
Reply

Thread Tools

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 04:09 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.08976 seconds
  • Memory Usage 2,301KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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