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]
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]