What I meant is something like this:
PHP Code:
global $vbulletin, $cache_telephone;
if (!isset($cache_telephone[$post['userid']]))
{
$fournisseur = $vbulletin->db->query_first("
SELECT telephone
FROM devis_fournisseurs
WHERE userid=$post[userid]
");
if (is_array($fournisseur))
{
$cache_telephone[$post['userid']] = $fournisseur[telephone];
}
}
if (isset($cache_telephone[$post['userid']]))
{
vB_Template::preRegister('postbit_legacy', array('telephone' => $cache_telephone[$post['userid']]));
}
But I remembered a better way that might work without adding a query. You can add on to the existing post query in showthread.php using a plugin on hook showthread_query_postids and code like this:
PHP Code:
$calc_found_rows .= ', devis_fournisseurs.telephone ';
$hook_query_joins .= ' LEFT JOIN devis_fournisseurs ON (devis_fournisseurs.userid = post.userid) ';
That should put the telephone field in $post without the other plugin.