PDA

View Full Version : problem with member info block


booktoweb
03-03-2009, 02:56 AM
hi,

i programed award hack when member get award the link of this award saved in additional field in userfield tabled called 'awardicon'
in (member_build_blocks_start) hook i using this code


$blocklist = array_merge($blocklist, array(
'myawards' => array(
'class' => 'my_awards',
'title' => $vbphrase['my_awards'],
'hook_location' => 'profile_left_last'
)));

class vB_ProfileBlock_my_awards extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_my_awards';

function confirm_empty_wrap()
{
return false;
}

function confirm_display()
{
return ($this->block_data['my_awards'] != '');
}

function prepare_output($id = '', $options = array())
{
global $show, $vbphrase, $stylevar, $vbcollapse, $bgclass, $vbulletin;

if($this->profile->userinfo['awardicon'])
{
// something her
}
}
}

but i see that it doesn't work with all
when i write this

$blocklist = array_merge($blocklist, array(
'myawards' => array(
'class' => 'my_awards',
'title' => $vbphrase['my_awards'],
'hook_location' => 'profile_left_last'
)));

class vB_ProfileBlock_my_awards extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_my_awards';

function confirm_empty_wrap()
{
return false;
}

function confirm_display()
{
return ($this->block_data['my_awards'] != '');
}

function prepare_output($id = '', $options = array())
{
global $show, $vbphrase, $stylevar, $vbcollapse, $bgclass, $vbulletin;

echo $this->profile->userinfo['awardicon']
}
}

i doesn't get any output with all ( have award or not )
when i test it in new test forum it working fine !!!

i think there are some thing in my forum doesn't load all additional userinfo field
because this work

echo $this->profile->userinfo['field1']

:confused::confused::confused:

Dismounted
03-03-2009, 04:37 AM
when i test it in new test forum it working fine !!!
Disable all other modifications on your board, and try again. (If you also have modifications on that test board, disable them and try again as well.)

Lynne
03-03-2009, 02:50 PM
There is an article in the articles forum on how to add tabs. Did you read that?