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.

Erwin 05-17-2003 05:12 AM

With the changes as above, if the message is made read, the PM popup will not popup anyway, as there will be no new mesages. So there's no need to turn off pm popup. See?

Smoothie 05-17-2003 05:31 AM

ya, I see, but I am still getting the pm pop-up after I get the email.

Smoothie 05-17-2003 08:14 AM

hmmm, still not working right. I am still getting the messages as not being "read".

Erwin 05-17-2003 08:58 AM

It works here. Try PMing yourself.

Boofo 05-17-2003 02:37 PM

All of the pms now have [deny receipt] after them. Like this:

From the desk of Boofo [deny receipt]

even after logging onto the site and reading them.

This is happening on here, too. ;)

Smoothie 05-17-2003 03:45 PM

right, thats what I'm saying, plus, if i go to message tracking, it says the messages are still unread by receipient, and still getting the stupid pop-up.

Boofo 05-17-2003 04:10 PM

My message tracking (on vb.org here) shows only 3 messages as not read yet but in the private message listing I have about 10 messages with the [deny receipt] still after them (all made after this hack was installed here this morning).

Erwin 05-18-2003 01:04 AM

To fix the deny receipt problem, we have to actually specify the receipt SQL part, so do this:

Find:

PHP Code:

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

Change to:

PHP Code:

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

That should fix it. :)

Erwin 05-18-2003 01:04 AM

I will fix my previous post to reflect this.

Smoothie 05-18-2003 01:46 AM

hmm, ok, but i am still getting the pop-ups for new PM's...

Erwin 05-18-2003 01:52 AM

Here, or at your own site?

Smoothie 05-18-2003 04:58 AM

at Macfora.com

Smoothie 05-18-2003 05:04 AM

I'm using this hack;
https://vborg.vbsupport.ru/showthrea...threadid=51963

plus this: $message in the emailsubject_pmreceived template

Erwin 05-18-2003 05:14 AM

And you've made the changes in my post here as well?

Mmm... the popup shouldn't happen if the message is read, that's the thing... what about you, Boofo, do you have the same problem?

Smoothie 05-18-2003 05:20 AM

yes, I applied this code change from here;
https://vborg.vbsupport.ru/showthrea...011#post396011

and I am still getting PM pop-ups. For some reason, the PM is not being marked as read when the email is sent.

Erwin 05-18-2003 06:01 AM

This line

$the_pm_id = $DB_site->insert_id();

is added ABOVE this line:

// enhanced
if ($prevmessageid) {

NOT BELOW - if you put it below, the code won't work. Did you do that correctly?

Erwin 05-18-2003 06:02 AM

Like I said, the PMs are marked READ here and at Boofo's site, so the code works.

Boofo 05-18-2003 07:00 AM

Erwin, the code works great at my site (as well as here) now. Thanks for the fix. ;)

Smoothie, did you also add the code from this post?

https://vborg.vbsupport.ru/showthrea...017#post396017

Smoothie 05-18-2003 04:12 PM

Quote:

Today at 05:00 AM Boofo said this in Post #68
Erwin, the code works great at my site (as well as here) now. Thanks for the fix. ;)

Smoothie, did you also add the code from this post?

https://vborg.vbsupport.ru/showthrea...017#post396017

No, because in this post:
https://vborg.vbsupport.ru/showthrea...031#post396031

Erwin says:
Quote:

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.
And I was not getting any errors.

Smoothie 05-18-2003 04:13 PM

Quote:

Today at 04:01 AM Erwin said this in Post #66
This line

$the_pm_id = $DB_site->insert_id();

is added ABOVE this line:

// enhanced
if ($prevmessageid) {

NOT BELOW - if you put it below, the code won't work. Did you do that correctly?

Yes, it was correct, but I will re-check.

Smoothie 05-18-2003 04:14 PM

Boofo-

You added both chunks of code? I only added the first code to private.php

Smoothie 05-18-2003 04:37 PM

hmmm, ok, now the message appears to be marked read, but still getting the pop-ups for a new PM.

Boofo 05-18-2003 04:48 PM

I wasn't getting any errors either but I added both codes just to be safe. Try it and see if that fixes the pop-up problem. The pop-up will only be gone when you are in the private.php. It will still work everywhere else. ;)

Smoothie 05-18-2003 04:55 PM

But, if I add that code, what about users who don't have get email on new PM selected in the User CP? Will they still get pop-ups for new PM's?

Boofo 05-18-2003 05:10 PM

That will only work if they have email notification set to on. Otherwise it works as normal. Besides, it only stops the pop-ups while you are in the private.php (your messages). You really don't need it there anyway, right? ;)

Smoothie 05-18-2003 07:17 PM

I guess I might not be making my problem clear. The new PM popup happens on forumhome, even though I have selected yes to the email notification for new pms, and receive them via email.

Does the code that is added to global.php stop the new PM pop-ups on forumhome, if you select to receive pms via email?

Boofo 05-18-2003 07:26 PM

No, it only stops it if you are in your private messages. The only way to stop it on the forumhome is to turn it off in your options. Is that what you are trying to do? Turn it off on forumhome, too?

Smoothie 05-18-2003 07:31 PM

No, I guess I may have miss-understood what the extra code does. If we are making the PM's read once the email is sent, it makes no sense to also get a pop-up for the same PM on forumhome. I thought that was taken care of with the code changes....

Boofo 05-18-2003 07:38 PM

Well, I just tried it and I don't get the pop-up on forumhome with the email turned on. With it turned off, I do. I also have a blinking "You've got mail" type message whenever there is a new message and it doesn't blink with email turned on, so it is working as it is supposed to. Did you use the new code (with receipt=2 in it) for the query? That code should cancel any pop-ups at all since it actually queries the db to say that message has been received. You must have something else going on somewhere.

Erwin 05-18-2003 07:43 PM

I don't get it too. The popup should not happen if the PM is read.


All times are GMT. The time now is 02:09 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.02011 seconds
  • Memory Usage 1,826KB
  • 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
  • (10)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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