public function fixNodeLast($nodeid) { $db = vB::getDbAssertor(); $result = $db->assertQuery('vBForum:node', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_SELECT, vB_dB_Query::CONDITIONS_KEY => array('parentid' => $nodeid, 'showpublished' => 1, 'showapproved' => 1), vB_dB_Query::PARAM_LIMIT => 1, vB_dB_Query::COLUMNS_KEY => array('lastcontent', 'lastcontentid', 'lastcontentauthor', 'lastauthorid')), array('field' => array('lastcontent', 'lastcontentid'), 'direction' => array(vB_dB_Query::SORT_DESC, vB_dB_Query::SORT_DESC))); if ($result and $result->valid()) { $row = $result->current(); return $db->update('vBForum:node', $row, array('nodeid' => $nodeid)); } else { return $db->assertQuery('vBForum:updateLastContentSelf', array('nodeid' => $nodeid, 'excluded' => vB_Node::getExcludedTypes())); } }