Let's assume you have the userid stored in $userid (and the name of your new column is "new_column), then you could use the queries:
PHP Code:
$pinfract_this_year = $vbulletin->db->query_first("
SELECT COUNT(*) AS infract_count
FROM " . TABLE_PREFIX . "infraction AS infraction
WHERE userid = " . $userid . "
AND dateline >= " . (TIMENOW - 365*86400) . "
AND expires = 0
");
if ($pinfract_this_year['infract_count'])
{
c_value = 1;
}
else
{
c_value = 0;
}
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET new_column = " . $c_value . "
WHERE userid = " . $userid
);