I am trying to update a field I added to the thread table from a set of plugins that will be called whenever a post is edited or a new thread created. There is nothing to display. If the current post contains an image or an attachment, I want to copy the postid to my new field.
I think I need to preregister the node in the $thread array, but I am not sure how to do that. Can I freely reference an existing array in the preregister method?
Here is the code I have now. The commented line is what I would expect the eventual sql statement to be.
Code:
if (!$thread['thumbpostid']) //there is no thumbpost defined
{
if ((strpos($post['pagetext'], '[/IMG]') or ($post['attach']) ) // post has an attachment or there is an [img] tag
{
// $vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."thread SET thumbpostid = ".$postid." WHERE threadid = ".$threadid);
$threadman->setr('thumbpostid', $postid);
}
}