Log in

View Full Version : help with editing newreply.php


harmor19
10-26-2005, 04:22 AM
I have added three radio button on the newreply template for random replies.
What it's supposed to do is get a random reply from another table and insert it into the post along with the message they typed.

first I need to make an if else statement

if ($_POST['random_reply'] == "pos")
{
$getrr = $db->query_read("SELECT * FROM " . TABLE_PREFIX ."random_reply WHERE ptext ORDER BY RAND()'");
$rr = $db->fetch_array($getrr);
}
elseif ($_POST['random_reply'] == "neg")
{
$getrr = $db->query_read("SELECT * FROM " . TABLE_PREFIX ."random_reply WHERE ntext ORDER BY RAND()'");
$rr = $db->fetch_array($getrr);
}


What I want to do is get a random message and insert it into the "pagetext" field on the "post" table.

I can't find where it inserts the query though.
I looked in "newreply.php", "functions_newpost.php", "functions_big_three.php".

Chris M
10-26-2005, 09:02 AM
Try class_dm_threadpost.php :)

Chris

harmor19
10-26-2005, 09:24 AM
Will do.
thanks.