No database needed. What I meant by caching is to keep previous answers in a global variable, because you're only caching for a single page view. I was thinking something like this:
PHP Code:
global $field16_cache;
if (!is_array($field16_cache))
{
$field16_cache = array();
}
if (!isset($field16_cache[$user['userid']]))
{
$row = $vbulletin->db->query_first(sprintf("SELECT field16 FROM " . TABLE_PREFIX ."userfield WHERE userid = %d", $user['userid']));
$field16_cache[$user['userid']] = $row['field16'];
}
$field = $field16_cache[$user['userid']];