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
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: 20
 
No support by the author.

Ok, I realize this is TINY. Sorry. I figured it'd be worth posting anyway, though, because this tiny little hack has been extremely useful to me.

What's it do?
Short, and sweet: instead of a link to the Inbox in the new PM notification email, it displays a link directly to the message itself.

Known bugs
From what I understand, the mysql_insert_id() function is a little bit on the funky side...so it seems that, every few dozen emails I receive, just one doesn't work. This is a real rarity, though. 99% of the time it hums along without a hitch.

Ok, this hack is VERY simple. Here goes:

in private.php in your main forums directory, find the code below (around line 625 or so):

Code:
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid,receipt) VALUES (NULL,$touserinfo[userid],$touserinfo[userid],$bbuserinfo[userid],'".addslashes(htmlspecialchars($title))."','".addslashes($message)."',".time().",'$signature','$iconid',0,0,$receipt)");
RIGHT after it, place this:

Code:
$the_pm_id = $DB_site->insert_id();
Save and upload. Yep, that's it for code editing! Then, open the email_pmreceived, and use the $the_pm_id variable as you please. Here's how I used it:

Code:
$touserinfo[username],

You have received a new private message at $bbtitle from $bbuserinfo[username]. Please click here to log in and read it:
$bburl/private.php?action=show&privatemessageid=$the_pm_id

Thanks,
$bbtitle
Attached is a quick screenshot of what the email looks like when I receive it. Works well for me. If anyone's got any suggestions, feel free to let me know. I hope this is useful.

Show Your Support

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

Comments
  #12  
Old 02-08-2002, 12:56 PM
fury's Avatar
fury fury is offline
 
Join Date: Oct 2001
Location: Indiana
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You sure you didn't add it after the query inside if ($savecopy) { }? The queries do look very similar at the beginning

If your users do not elect to save copies of their private messages, then this hack would not work, if that's where you added them. You have to add them in the query that is right after this line:

// enhanced - added $receipt to insert

Thanks for the great hack, Commish!
Reply With Quote
  #13  
Old 02-15-2002, 10:05 PM
NYI Fan's Avatar
NYI Fan NYI Fan is offline
 
Join Date: Oct 2001
Location: Long Island, NY
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is GREAT! Thank you!
Reply With Quote
  #14  
Old 02-15-2002, 11:08 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem -- I'm glad you like it. I find it highly useful...so I figured others would as well. BTW: this could be modified slightly to include, say, the title and time sent along with the username and link. Wouldn't be too tough, I don't think.
Reply With Quote
  #15  
Old 03-03-2002, 11:09 PM
tanster's Avatar
tanster tanster is offline
 
Join Date: Feb 2002
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wonderful. Thank you!

Jennie
Reply With Quote
  #16  
Old 08-04-2002, 08:53 PM
tanster's Avatar
tanster tanster is offline
 
Join Date: Feb 2002
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by X-Fan
I've installed this and it seemed to work okay but now I've gotten a bunch of e-mails notifying me of PM's that didn't have the privatemessageid number in the URL so leads to an error page when you click it.
I encountered the same problem, and I think it occurs when you're sending PMs to multiple recipients. If you add the same line of code to private2.php (as well as private.php), that seems to fix it.
Reply With Quote
  #17  
Old 10-14-2002, 03:06 PM
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Posts: 1,674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cheers Chris. Running on 2.3.0.
Reply With Quote
  #18  
Old 01-01-2003, 10:54 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

TWTCommish. how did you get the Date, To, Subject and From part in your message? Would you be willing to share the code for that?
Reply With Quote
  #19  
Old 01-01-2003, 01:25 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's just part of the email.
Reply With Quote
  #20  
Old 01-01-2003, 03:52 PM
Mystis's Avatar
Mystis Mystis is offline
 
Join Date: Jul 2002
Location: Minnesota
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe that I saw on the PHP changelog that the mysql_insert_id() function problems were fixed in 4.3.0
Reply With Quote
  #21  
Old 07-11-2005, 02:37 PM
djwins djwins is offline
 
Join Date: Jan 2005
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone update this for 3.0.7? It doesn't seem to have the same code.
Thanks!
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 07:39 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.05262 seconds
  • Memory Usage 2,306KB
  • 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)bbcode_quote
  • (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
  • (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