PDA

View Full Version : Problem populating custom tabs with custom profile fields


Chris-777
Sat 22nd Mar '08, 3:20pm
I'm following the article here:

http://www.vbulletin.org/forum/showthread.php?t=165554

And am getting stuck on the last bit by Wayne. Here's my plugin right now, complete with default names. ;)

$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:

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:

$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.

Floris
Sun 23rd Mar '08, 2:16am
For support on customizations please post on vBulletin.org - this thread is from vBorg, best is to follow up on it there too.

Makc666
Wed 9th Apr '08, 12:24pm
For support on customizations please post on vBulletin.org - this thread is from vBorg, best is to follow up on it there too.
The problem is that no one replies about prepare_output and <hookname>member_build_blocks_start</hookname> in thread:
http://www.vbulletin.org/forum/showthread.php?p=1486638#post1486638