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
  #2  
Old 01-22-2002, 04:52 PM
bokhalifa bokhalifa is offline
 
Join Date: Oct 2001
Location: U A E Dubai
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks leased:
Reply With Quote
  #3  
Old 01-25-2002, 06:23 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #4  
Old 01-25-2002, 07:10 PM
69-FLy-gUy's Avatar
69-FLy-gUy 69-FLy-gUy is offline
 
Join Date: Oct 2001
Posts: 137
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks.. will install this one later tonight

Ciao
Reply With Quote
  #5  
Old 02-02-2002, 05:21 PM
LuBi LuBi is offline
 
Join Date: Oct 2001
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So anyone figureo ut what's up with the funky code? Is it something we should worry about or will this feature work?
Reply With Quote
  #6  
Old 02-02-2002, 05:30 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, you mean the mysql_insert_id() function? It'll be fine. I think it's only mucked up on me once or twice in maybe 100 emails or so. And it hasn't happened in weeks. I may have imagined it.
Reply With Quote
  #7  
Old 02-04-2002, 05:14 AM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

Also, myself and some others on the board have been reporting that they've been getting e-mails advising them of a new PM but when they access their PM section there's nothing there!

Any ideas?
Reply With Quote
  #8  
Old 02-04-2002, 05:29 AM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you take me through the steps you've gone through to install this? I can't imagine how it could be much of a problem...one line of code (that needs to be RIGHT after that query), and a minor template change.
Reply With Quote
  #9  
Old 02-04-2002, 07:20 AM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by TWTCommish
Can you take me through the steps you've gone through to install this? I can't imagine how it could be much of a problem...one line of code (that needs to be RIGHT after that query), and a minor template change.
Yeah, only two steps that I followed to the letter. Editing private.php was a snap, and I even used your example of what to put in the email_pmreceived template but for some reason I'm getting the above probs.
Reply With Quote
  #10  
Old 02-04-2002, 02:39 PM
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Location: Pittsburgh, PA, USA
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm wondering if it's got something to do with your installation of PHP, then. I do know the function is a tad shaky, but if it completely fails to work, EVER, then there might be some switch missing. Do you know which version you're running, offhand?
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:14 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.04326 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
  • (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
  • (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