PDA

View Full Version : E-mail users when their thread is moved


01-20-2001, 08:30 PM
Wrote this hack because people on my forum were complaining that there was no closed thread saying "Your thread was moved because of ....", so I decided to have the forum e-mail them when a mod/admin moved their thread.

EDIT POSTINGS.PHP


Find (around ln 287)
$threadinfo=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$threadid");
$curforumid=$threadinfo[forumid];

Add after it
$threadtitle=$threadinfo[title];
$curforum=$DB_site->query_first("SELECT title FROM forum WHERE forumid=$curforumid");
$targetforum=$DB_site->query_first("SELECT title FROM forum WHERE forumid=$forumid");
$curforumtitle=$curforum[title];
$targetforumtitle=$targetforum[title];


Find (around ln 334)
$DB_site->query("UPDATE forum SET replycount=$numberposts,threadcount=threadcount-1,lastpost=$lastpost,lastposter='".addslashes($lastposter)."' WHERE forumid=$curforumid");

Add after it
$firstpostinfo=$DB_site->query_first("SELECT userid FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
$threadstarter=$DB_site->query_first("SELECT email FROM user WHERE userid=$firstpostinfo[userid]");

$emailsubject=$bbtitle;
$emailmsg="Your thread on the $bbtitle, " . $threadtitle . ", has been moved from the " . $curforumtitle . " forum to the " . $targetforumtitle . " forum. Do not respond to this e-mail, as it will not yield any follow-up answers.";
mail($threadstarter[email],$emailsubject,$emailmsg,"From: \"$bbtitle Post Manager\" <$webmasteremail>");

hope this helps somebody :)

[Edited by Emul8or on 01-20-2001 at 05:34 PM]

01-20-2001, 09:40 PM
nice hack. :)

01-20-2001, 10:46 PM
hi Emul8or
the ver1.1.5 do not work "$threadtitle"
thanks

01-20-2001, 11:06 PM
Oh, sorry, I was working off the 1.1.2 codebase.

01-20-2001, 11:13 PM
thanks

Only Vars $threadtitle not working

01-20-2001, 11:26 PM
Originally posted by Emul8or
Oh, sorry, I was working off the 1.1.2 codebase.

You need to pirate a more recent copy.

01-20-2001, 11:28 PM
lol......................

01-21-2001, 12:46 AM
You need to pirate a more recent copy.

I think the correct spelling is pir8

01-25-2001, 02:25 AM
Be nice to have it for 1.1.4