vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   News and Announcements (https://vborg.vbsupport.ru/forumdisplay.php?f=2)
-   -   New Feature: If you turn PM notification email to ON, you get new PMs emailed to you! (https://vborg.vbsupport.ru/showthread.php?t=51601)

Erwin 05-17-2003 02:19 AM

Can't believe I missed it - thanks filburt1.

Okay, to make it so that if the "PM Email notification" is ON, the PM is automatically made READ when the Email is sent to you, do this:

Open private.php, find:

PHP Code:

  // enhanced
  
if ($prevmessageid) { 

Above it, add:

PHP Code:

$the_pm_id $DB_site->insert_id(); 

Those who installed the direct PM link will have the above line already from that hack.

Then, find:

PHP Code:

    if ($touserinfo[emailonpm]) { 

Underneath, add:

PHP Code:

        $DB_site->query("UPDATE privatemessage SET messageread=1, readtime='".time()."', receipt=2 WHERE privatemessageid=$the_pm_id"); 

Done.

This hack may interfere with other PM hacks. I've had to modify global.php as well. I hope it is all working now.

Boofo 05-17-2003 02:21 AM

What did you modify in the global.php?

Boofo 05-17-2003 02:24 AM

Isn't your code above the same code that was in the first message you posted it in?

Erwin 05-17-2003 02:27 AM

Basically, if you have the direct PM link hack installed, this mod interferes with it. So I disabled the PM popup code when you access private.php (which you don't need anyway since you are looking at your PMs).

You find this in global.php:

PHP Code:

    if ($hack_pm_total 1) { 

Above this, add:

PHP Code:

 if (strpos($_SERVER['PHP_SELF'], "private.php" ) == false) { 

Then, find:

PHP Code:

    eval("\$headnewpm = \"".gettemplate('head_newpm')."\";"); 

Below this, add:

PHP Code:




The PM code will not show up when you are at private.php, preventing the 2 hacks from interfering with each other.

Erwin 05-17-2003 02:28 AM

Quote:

Today at 02:24 PM Boofo said this in Post #48
Isn't your code above the same code that was in the first message you posted it in?
Yes, it was. :) I took it out because I had to fix the global.php error, but put it back, when I realized the easier way to do it was keep the code the same, and just modify global.php.

Boofo 05-17-2003 02:35 AM

Thanks for sorting this out. Great idea! ;)

Also, I have the "Improved PM Popup Start" hack installed. This should all be ok together, shouldn't it?

Erwin 05-17-2003 02:39 AM

Not familiar with that hack, but if it's working, then it should be ok.

Smoothie 05-17-2003 02:44 AM

so wait, let me get this straight. if you get an email with the pm content, the code in post 41 makes it so the pm is automatically made read. Whats the code in post 44 do? Does it stop the pm pop-up from happening?

Erwin 05-17-2003 03:16 AM

Mmm... your post numbers are different to mine... the private.php code is like you say, to make the message read if email is sent.

The global.php is OPTIONAL and only if you get a global.php error - this hack may interfere with the PM popup direct PM link hack (at least here anyway) - if so, put that piece of code in to fix it.

Smoothie 05-17-2003 03:26 AM

ah, ok, but here the question. If you get email with the pm content, and the code you posted makes the pm automatically read, is there a way to not get the pm popup if you have email on pm's? It seems very redundant to get the email and the pm popup. I'm not talking about changing the setting in your user cp, but if a user has pm email notification set to yes, the pm pop-up would be turned off.


All times are GMT. The time now is 03:43 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01852 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete