I've had to make some modifications to get the member and private scripts to display properly:
Code:
global $vbulletin;
if (THIS_SCRIPT == 'private')
{
$tempuser=fetch_userinfo($pm['fromuserid']);
$tempuser['permissions'] = cache_permissions($tempuser);
$check_ugp = convert_bits_to_array($tempuser['permissions']['ces_parser_permissions'], $vbulletin->bf_ugp['ces_parser_permissions']);
}
elseif (THIS_SCRIPT != 'member')
{
global $newpost, $postinfo, $post;
// newthread, newreply uses $newpost
// editpost uses $postinfo
// showthread uses $post
$postusername = '';
if (THIS_SCRIPT == 'editpost')
{
$postusername = $postinfo['username'];
}
if (in_array(THIS_SCRIPT, array('newreply', 'newthread')))
{
$post = $newpost;
if ($post['username'] AND ($vbulletin->userinfo['username'] != $post['username']))
{
$postusername = $post['username'];
}
}
if (!$post['usergroupid'] AND $postusername != '')
{
$userinfo = $vbulletin->db->query_first("
SELECT userid, usergroupid, membergroupids
FROM " . TABLE_PREFIX . "user
WHERE username = '" . $vbulletin->db->escape_string($postusername) . "'
");
if (empty($post['permissions']))
{
$grab = true;
}
else
{
$userinfo['permissions'] = $post['permissions'];
}
}
else if (($post['usergroupid'] > 0))
{
$userinfo['userid'] = $post['userid'];
$userinfo['usergroupid'] = $post['usergroupid'];
$userinfo['membergroupids'] = $post['membergroupids'];
if (empty($post['permissions']))
{
$grab = true;
}
else
{
$userinfo['permissions'] = $post['permissions'];
}
}
else if (in_array(THIS_SCRIPT, array('newreply', 'newthread')))
{
$userinfo['userid'] = $vbulletin->userinfo['userid'];
$userinfo['usergroupid'] = $vbulletin->userinfo['usergroupid'];
$userinfo['membergroupids'] = $vbulletin->userinfo['membergroupids'];
if (empty($vbulletin->userinfo['permissions']))
{
$grab = true;
}
else if (empty($userinfo['permissions']))
{
$userinfo['permissions'] = $vbulletin->userinfo['permissions'];
}
}
if ($grab)
{
$userinfo['permissions'] = cache_permissions($userinfo);
}
if ($this->parse_userinfo['permissions'] != $userinfo['permissions'])
{
$this->set_parse_userinfo($userinfo, $userinfo['permissions']);
}
$check_ugp = convert_bits_to_array($this->parse_userinfo['permissions']['ces_parser_permissions'], $vbulletin->bf_ugp['ces_parser_permissions']);
} else {
$tempuser=fetch_userinfo($vbulletin->GPC['userid']);
$tempuser['permissions'] = cache_permissions($tempuser);
$check_ugp = convert_bits_to_array($tempuser['permissions']['ces_parser_permissions'], $vbulletin->bf_ugp['ces_parser_permissions']);
}
$bad_tags = explode(',', $vbulletin->options['bad_tags']);
$dobbcode = $do_bbcode ? $do_bbcode : $dobbcode;
$dosmilies = $do_smilies ? $do_smilies : $dosmilies;
$dobbimagecode = $do_smilies ? $do_bbimagecode : $dobbimagecode;
$dohtml = $do_html ? $do_html : $dohtml;
$dobbcode = ($check_ugp['can_bbcode_post'] AND $dobbcode);
$dosmilies = ($check_ugp['can_smilies_post'] AND $dosmilies);
$dobbimagecode = ($check_ugp['can_imgcode_post'] AND $dobbimagecode);
$do_bbcode =& $dobbcode;
$do_smilies =& $dosmilies;
$do_bbimagecode =& $dobbimagecode;
$do_html =& $dohtml;
if ($check_ugp['can_html_post'] AND $do_html)
{
$do_html = true;
foreach ($bad_tags AS $badtag)
{
$badtag = html_entity_decode($badtag);
$text = str_replace( '<' . trim($badtag), htmlspecialchars('<' . trim($badtag)), $text);
$text = str_replace( '</' . trim($badtag), htmlspecialchars('</' . trim($badtag)), $text);
}
unset($badtag, $badtags);
}
else
{
$do_html = false;
}
I'm not sure that this is entirely correct, but it's a start for me.