function process_message_preview($message){ global $vbulletin, $vbphrase, $stylevar, $show; require_once(DIR . '/includes/class_bbcode.php'); $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $previewhtml = ''; if ($previewmessage = $bbcode_parser->parse($message['pagetext'], 'socialmessage', $message['disablesmilies'] ? 0 : 1)) { $previewhtml = $previewmessage; } return $previewhtml;}
querythen while ($message = $vbulletin->db->fetch_array($messagelist)) {..... $message['pagetext'] = process_message_preview($message);eval template that uses $message['pagetext'];}