View Full Version : Send author PM on thread move
Overgrow
03-02-2002, 10:00 PM
Disclaimer:
-No support is offered for this hack. If you PM or email for support, it will be joyfully ignored. When I have time, I will answer questions in this thread.
PM on Thread Move
Design Spec:
Alert users that their post has been moved by sending the original
author a private message. This helps prevent clogging the forums
with those ugly moved markers. An additional checkbox will be
shown allowing you to add the PM.
Steps for installation:
-edit one file 'postings.php'
-edit one template 'threads_move'
Tested: 2.2.1
Updated: Will now put a checkbox option to send the PM instead of changing the default move action.
Jadelit
03-03-2002, 07:16 AM
Thanks, it works great! You also seem to be on a roll on new hacks..
Overgrow
03-03-2002, 07:20 AM
Welcome.. It's all stuff I've already written for my site and that I'm in the process of transferring to a client's site. So as I'm transferring I'm writing them up for release. I have about 3 dozen more like this :D
Jadelit
03-03-2002, 07:33 AM
just keep posting dem!!! heheh
SWFans.net
03-03-2002, 07:37 AM
Very cool hack. :D Thanks.
Would it be possible to modify this so that there is still an option to just move the thread with no action accompanying it?
Overgrow
03-03-2002, 07:52 AM
Yes, I like that way much better. I've changed the text file up above so it provides a checkbox option, instead of changing the default action.
If you've already installed this: you'll have to revert your postings.php by deleting out the part you added and then following the instructions again. Same with the template.
SWFans.net
03-03-2002, 07:57 AM
Great! :)
I think there may be some kind of issue here with replacing already included attachment files. The attachment appears to be the same.
Overgrow
03-03-2002, 08:01 AM
OK, should be fixed, re-uploaded with a new name.
And here it is again in case your browser is caching the attachment file.
SWFans.net
03-03-2002, 08:04 AM
I was thinking renaming the file would be a work around too, but I still get the same file as before, name and all. I wonder if this is an issue only native to this board or if it affects all 2.2.1 boards? :\
X-Fan
03-03-2002, 10:47 AM
Very useful hack for a board with many forums, thanks Overgrow!!! :D
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:
$movemessage="Your thread entitled ".$threadinfo[title]." has been moved to the $bburl[/COLOR]/forumdisplay.php?forumid=".$foruminfo[forumid]."\"]".$foruminfo[title]." (\"/showthread.php?threadid=".$threadid."\"][COLOR=red]$bburl/showthread.php?threadid=".$threadid." (\",$firstpostinfo[userid],[COLOR=red]$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
Thanks a lot for the hack Overgrow, I have been waiting for this hack for 2 years (http://www.vbulletin.com/forum/showthread.php?threadid=4853)! 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 (https://vborg.vbsupport.ru/showthread.php?s=&threadid=34751), 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:
deletethread($threadid,$foruminfo[countposts]);
and BELOW it, add:
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 ;)
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
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:
(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!
NSeXcellent
04-02-2002, 10:40 PM
Thanks... I appreciate it...http://www.sportsnimports.com/forums/images/smilies/thumbsup.gif
inetd
05-18-2002, 10:04 AM
Overgrow, hi :)
You can make small add-on for this hack? I need send PM to all user's who replies in thread, if thread moving :)
If you can make this, please make :)
For those interested in having the Mod/Admin who moved the thread being the originator of the PM instead of Member #1 (or a set Member you choose) here's the change:
In postings.php Change This:$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,
fromuserid,title,message,dateline,showsignature,ic onid,messageread,folderid,receipt)
VALUES (NULL,$firstpostinfo[userid],$firstpostinfo[userid],1,'Your post has been
moved.','".addslashes($movemessage)."',".time().",0,9,0,0,0)");
To This:$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,
fromuserid,title,message,dateline,showsignature,ic onid,messageread,folderid,receipt)
VALUES (NULL,$firstpostinfo[userid],$firstpostinfo[userid],$bbuserinfo[userid],'Your post has
been moved.','".addslashes($movemessage)."',".time().",0,9,0,0,0)");
You just need to change the 1 in the original query for the fromuserid to the value for the userid in bbuserinfo. Make sure you do this all in one line, the added lines here are to keep everything from scrolling.
Hope this helps someone. Thanks for the great hack!
Learner29
08-18-2002, 09:12 PM
thank you thank you thank you
camoboy
08-25-2002, 01:10 AM
This is great but there is a slight issue with it...if the thread is moved to a private forum, the recipient gets told to visit the new thread in the private forum. Of course, then they click on the link and get Permission Denied.
It would be great if it was moved to a private forum, it just said "Your thread was removed" or something, instead of specifiying the new forum.
Thanks :D
Why would you move a user's thread to a forum they can't access in the first place?
yzztik
10-09-2002, 11:58 PM
Because you want it gone from public view but maybe want to save it for record keeping. I do the same in my forum and would love this add-on.
Also, is there a way to include a reason for the thread move in the PM?
Dynamic One
11-01-2002, 07:37 PM
Thanks you for this wonerfull hack Overgrow.
vicko
11-25-2002, 12:49 PM
that's very useful.thank u very much
i will try it now
tpearl5
11-29-2002, 03:25 PM
I also couldn't get the PM on delete to work. Anyone have any ideas? (I removed all line returns and tried adding a couple things)
Logikos
01-17-2003, 03:36 PM
Great Hack!
Keeps the forums nice and clean.
*Clicks Install* :D
Aaron1
02-02-2003, 11:18 AM
All worked well, but the only problem i have is the Post icon (<img src="" alt="" border="0">) won't show up, do you guys have any clue what caused that?
Check my attachement...
Draddog
07-19-2003, 06:13 AM
This works great. One thing I did was comment out the $movemessage in the postings.php edit. Then I added a text box called movemessage, so that I can customize the message every time. I've needed this forever!
Thanks!
bazpug
10-25-2003, 03:42 PM
Brilliant hack cheers :)
I am having the same problem as Aaron has mentioned above. Anyone know how to work around that?
Cheers Baz
xlguy
05-04-2004, 08:40 PM
Installed this on a hacked-up vb2.3.3 board and it works fine.
However, there is a typo in the install file which adds an extra 'http://' to the topic address which the system PMs them. To fix it look for this line in the instructions:
http://$bburl/showthread.php?threadid=".$threadid."[/url]
and remove the 'http://' so it becomes:
$bburl/showthread.php?threadid=".$threadid."[/url]
Also some other minor changes I made and though I would share:
- To make the PM icon change from a sad smilie to a ! (exclamation) mark, search for this part of code in the instructions:
".time().",0,9,0,0,0)");
and change the 9 to a 4...
".time().",0,4,0,0,0)");
To find the number for any other message icon, i.e. the happy smilie, just right click and view the properties of the relevant posticon image (you can find them on a start new thread page, i.e. they are 1.gif, 2.gif etc.).
- I also created a new user called "MoveAlert" and disabled PMs for him. I then made the hack use that ID for all messages... just for presentation really.
1. Add a new user
2. Make note of the User ID number
3. Find this line:
VALUES (NULL,$firstpostinfo[userid],$firstpostinfo[userid],1,'Your post has been moved.'
Change the 1 (just before 'Your post has been moved.' to the new users ID number.
Finally I put a pair of quote marks around the title as it appears in the private message to make it look neater...
Find:
$movemessage="Your thread entitled ".$threadinfo[title]."
and add a ' to either end, i.e...
$movemessage="Your thread entitled '".$threadinfo[title]."'
Hope this lots is helpful and thanks for the original hack - very cool :squareeyed:
TundraSoul
06-21-2004, 08:16 PM
Is there an update for this hack for VB3x ?
Thanks.
Boofo
06-22-2004, 07:04 AM
Is there an update for this hack for VB3x ?
Thanks.
A vB3 version of this was released on my site. ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.