PDA

View Full Version : request: Autumatic Thread Mover


spaceb
09-27-2002, 03:55 PM
i need automatic messages mover, it for my new game on my forum. :nervous:
i want this hack to move the message when some one reply to it and the reply contain special word, like yes. if the reply contain the word yes the message will be moved
to forum 'x'
if the reply cantaint the word no, the message will be moved to forum 'Y'.
and i want to be abble to choose in what forums it gonna be and to what forums it will move the messages thanx for the help. ;)

Logician
09-28-2002, 11:29 AM
I guess you should be asking this feature for "new threads" ONLY, if so edit newthread.php, find:

$message=trim($message);

after that add:

if (strpos(strtolower($message),"word"))
{$forumid=X;}

Replace X with your new forumid and "word" with your key word (write it in all lowercase)

spaceb
09-28-2002, 08:23 PM
hmm thank you very much for the help but i need it work only when some one reply to the message and his reply contain the word 'yes' or 'no'.

Logician
09-28-2002, 08:37 PM
but why dont you put this someone to a special usergroup (like Mods) and give the usergroup right to move threads? It would be easier to choose "Move Thread" instead of clicking reply, writing a special word and hacking the board to act so.

spaceb
09-29-2002, 12:09 AM
because the game is for all the members of my forum. and i have a lot of different groups i can't give them all the ability to move threads to another forum. so i want it to be automatic and the reply it's their answer there is only 2 possibilities, i hope you can help me with this :) thanx for your help

Logician
09-29-2002, 11:13 AM
well I dont know how well this would work. There can be some issues that would clash with the hack but here is the code anyway:

Edit newreply.php find:


// redirect
if ($visible) {


Before that add:


if (strpos(strtolower($message),"word"))
{
$DB_site->query("UPDATE thread SET forumid=X WHERE threadid=$threadid");
}

(Replace X with your new forumid)

I strongly suggest this to be used in a test board first! I havent tested it and it could have unwanted effects..

spaceb
09-29-2002, 11:32 AM
is it possible to do it only in certain forums?
and thank you very much for the help i will try it on a test board first

Logician
09-29-2002, 03:40 PM
Originally posted by spaceb
is it possible to do it only in certain forums?

yes.. Replace

if (strpos(strtolower($message),"word"))

as

if (strpos(strtolower($message),"word") AND $forumid==X)

spaceb
09-29-2002, 06:22 PM
o.k thank you very very much for the help :)