PDA

View Full Version : signature in user control panel and parse bbcode


The Wise One
10-20-2005, 01:01 AM
im trying to get the users signature to show in the user control panel (usercp.php) below the subscriptions and reputation tables. i created a plugin using the usercp_start hook with the following code (taken from member.php):

if ($userinfo['signature'])
{
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$userinfo['signature'] = $bbcode_parser->parse($userinfo['signature'], 0, true);

$show['signature'] = true;
}
else
{
$show['signature'] = false;
}
i then edited the USERCP template with the following code (taken from the memberinfo template):

<!-- ####### MEMBER'S SIGNATURE IN USER CP ####### -->
<if condition="$show['signature']">
<!-- signature row -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead">$vbphrase[signature]</td>
</tr>
<tr>
<td class="alt1" title="$vbphrase[signature]">$userinfo[signature]</td>
</tr>
</table>
<!-- / signature row -->
<br />
</if>
<!-- ##### END MEMBER'S SIGNATURE IN USER CP ###### -->
this combination results in nothing displayed in the usercp page. ive tried changing $show['signature'] to $bbuserinfo['signature'] and $userinfo[signature] to $bbuserinfo[signature] in the USERCP template code. this got the signature to show, but bbcode wont parse. can anyone tell me what im doing wrong?

TIA

Evil X
10-20-2005, 01:10 AM
wronge forum, this is the how-to's and this is more of a questions type thread homie

Andreas
10-20-2005, 01:16 AM
It's $vbulletin->userinfo['signature'] for the PHP

The Wise One
10-20-2005, 01:28 AM
It's $vbulletin->userinfo['signature'] for the PHP
sorry about the wrong forum...must of had a brain fart or something.

thanks Andreas. i did try $vbulletin->userinfo['signature'] but not in the right combinations. changing the php code to this:

if ($vbulletin->userinfo['signature'])
{
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$vbulletin->userinfo['signature'] = $bbcode_parser->parse($vbulletin->userinfo['signature'], 0, true);

$show['signature'] = true;
}
else
{
$show['signature'] = false;
}
and changing $userinfo[signature] to $bbuserinfo[signature] in the USERCP code was all that was needed. thanks for the help :)

Boofo
04-27-2006, 08:53 AM
sorry about the wrong forum...must of had a brain fart or something.

thanks Andreas. i did try $vbulletin->userinfo['signature'] but not in the right combinations. changing the php code to this:

if ($vbulletin->userinfo['signature'])
{
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$vbulletin->userinfo['signature'] = $bbcode_parser->parse($vbulletin->userinfo['signature'], 0, true);

$show['signature'] = true;
}
else
{
$show['signature'] = false;
}
and changing $userinfo[signature] to $bbuserinfo[signature] in the USERCP code was all that was needed. thanks for the help :)

This adds 2 queries to the User CP. Is there any way around those 2 queries? ;)