You need a where statement in here:
PHP Code:
if($post['rel_yn']) // true
{
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "post SET rel_yn = 1 WHERE postid=$postid
");
}else{ // false
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "post SET rel_yn = 0 WHERE postid=$postid
");
}
I don't know that "WHERE postid=$postid" is the correct way to write it, but you need to update the table only where the postid is equal to the post you are submitting. If you added that to the post table, you should be able to just use the datamanager to set it. Something like:
PHP Code:
$threadman->set('rel_yn', $vbulletin->GPC['rel_yn']);
First you need to clean the variable and then set it in the correct place (I didn't look to see if newpost_complete is the correct location). It just needs to be before there is a statement like this instead of what you are doing (adding a query):
PHP Code:
$threadman->save();