I'm following the article here:
https://vborg.vbsupport.ru/showthread.php?t=165554
And am getting stuck on the last bit by Wayne. Here's my plugin right now, complete with default names.
Code:
$blocklist = array_merge($blocklist, array(
'mymodification' => array(
'class' => 'MyModification',
'title' => 'Gear Details',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_MyModification extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_mymodification';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['mymodification'] != '');
}
function prepare_output($id = '', $options = array())
{
$this->block_data['mymodification'] = 'Coming soon.';
}
}
The "Coming Soon" at the end is just so that there's some text in the tab. What I'd like in that spot is something like:
Code:
CPF1: $post[field5]<br />
CPF2 @post [field2]<br />
Etc, etc. However as one of the posters in the article mentions, it doesn't parse the fields, it just displays the actual string. If I follow Wayne's advice on setting up the prepare_output function, the tab disappears.
Here's my plugin according to the article, which doesn't work:
Code:
$blocklist = array_merge($blocklist, array(
'mymodification' => array(
'class' => 'MyModification',
'title' => 'Gear Details',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_MyModification extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_mymodification';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['mymodification'] != '');
}
function prepare_output($id = '', $options = array())
{
$this->block_data['custom'] = $this->profile->userinfo['field5'] : "Stuff: $this->profile->userinfo['field5']" ? "Nothing to see here";
}}
What am I missing? If I change the last bit to the colored code above, the tab goes away. If I change it back, I'm stuck with tabs that don't parse the CPF's.
Any insight would be appreciated.
--------------- Added [DATE]1206216937[/DATE] at [TIME]1206216937[/TIME] ---------------
I got this sorted out - using the first bit of code, I ended up putting the fields in the actual template.