vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Send author PM on thread move (https://vborg.vbsupport.ru/showthread.php?t=35644)

Jawelin 03-03-2002 12:13 PM

Very useful hack.

Just I found should be better replace the main two lines in postings.php with the following:

Code:

    $movemessage="Your thread entitled ".$threadinfo[title]." has been moved to the $bburl[/COLOR]/forumdisplay.php?forumid=".$foruminfo[forumid]."\"]".$foruminfo[title]." forum. You can find it by clicking:\n\n$bburl[/COLOR]/showthread.php?threadid=".$threadid."\"]$bburl/showthread.php?threadid=".$threadid."\n\nThis is an automated message, DO NOT REPLY.\n";

    $DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid,receipt) VALUES (NULL,$firstpostinfo[userid],$firstpostinfo[userid],$bbuserinfo[userid],'Your post has been moved.','".addslashes($movemessage)."',".time().",0,9,0,0,0)");

(I put in color the differences...)

First, of couse, cause mine .txt linked to YOUR homepage...
Second, because I didn't like any move thread PM should sent with the same Admin (user 1) author... I'd prefer the original mover as the sender of the PM.

Thanks.
Bye

dost 03-03-2002 12:41 PM

Thanks a lot for the hack Overgrow, I have been waiting for this hack for 2 years! I have a question and a suggestion for you:
1. What happens if the person has disabled using PM's?
2. This shouldn't be very hard for you, can you make a different version of the hack so that it will send a PM on deleting the thread? My request can be found here, I just posted it a month ago.

Thanks

Overgrow 03-03-2002 02:20 PM

>>What happens if the person has disabled using PM's?

Admins don't care if people have their PMs disabled :) They get the PM anyway.. they'll have to turn them on to read it.

>>different version of the hack so that it will send a PM on deleting the thread?

No sweat.. in postings.php, find this twice:

PHP Code:

deletethread($threadid,$foruminfo[countposts]); 

and BELOW it, add:

PHP Code:

  if ($firstpostinfo[userid]=="") {
    
$firstpostinfo=$DB_site->query_first("SELECT userid FROM post WHERE threadid='$threadid
ORDER BY dateline LIMIT 1"
);
}

$movemessage="Your thread entitled ".$threadinfo[title]." has been deleted.
\n\nThis is an automated message, DO NOT REPLY."
;

$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,
message,dateline,showsignature,iconid,messageread,folderid,
receipt) VALUES (NULL,
$firstpostinfo[userid],$firstpostinfo[userid],1,
'Your post has been deleted.','"
.addslashes($movemessage)."',".time().",0,9,0,0,0)");

if (
$noshutdownfunc) {
    
$DB_site->query("UPDATE user SET pmpopup=2 WHERE userid=$firstpostinfo[userid]");
} else {
    
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=2 WHERE userid=$firstpostinfo[userid]";


This is untested but should be fine.

>>cause mine .txt linked to YOUR homepage...

OOPS! Sorry, I had fixed that once. I will fix it again.. Sly aren't I? Getting people to register on MY board from your error ;)

dost 03-03-2002 05:33 PM

Well, actually it does not. I'd really appreciate it if you could test it and maybe release as a different hack when you have time :)

Thanks

Overgrow 03-03-2002 07:44 PM

What doesn't work about that? What is the error? Deleting threads causes big delays on my site so I don't want to test this since I don't want to install it. The code looks like it should work, what goes wrong?

SWFans.net 03-03-2002 09:34 PM

I have one more request for an addition to this hack. One I think may be easy, but I could be wrong.

Would it be possible for his hack to also perform an email notification of the PM by default as well?

I noticed that while doing some testing that even when the recipient has email notify turned on for their PMs, this particular hack skips that and does not send an email notification.

I really like this hack a lot and thank you for providing it as well as modifying it to be a selectable option. :)

Overgrow 03-03-2002 09:41 PM

Tell me if this works?

find:

}

// END PM HACK

above it put

PHP Code:

if ($firstpostinfo[emailonpm]) {
          eval(
"\$emailmsg = \"".gettemplate("email_pmreceived",1,0)."\";");
          eval(
"\$emailsubject = \"".gettemplate("emailsubject_pmreceived",1,0)."\";");
          
mail($firstpostinfo[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
        } 


SWFans.net 03-03-2002 09:57 PM

Nope, it didn't work. =/

I moved a thread with the options selected, got the PM and checked my mail, no message. I waited a few minutes and still no mail, so I sent myself a PM to check and make sure the mail system was functioning alright and recieved the email notify for it in seconds.

NSeXcellent 04-02-2002 08:31 PM

Apparently the $userid that this PM is coming from, is 1, however, I am user #2 and i wish for the PM to come from my name. Can you tell me where to change that? Thanks

Okiewan 04-02-2002 10:32 PM

NSex...
look for this:
Code:

(NULL,$firstpostinfo[userid],$firstpostinfo[userid],1,'Your post has been moved.'
I can verify that the delete PM doesn't work... no error message, just ignores the hack.


Good stuff overgrow, thanks!


All times are GMT. The time now is 08:24 PM.

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.01168 seconds
  • Memory Usage 1,764KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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