Code: Select all
function get_hiding_info_box($hiding_info, $simple=false, $buy_action='')
{
global $template, $lang, $phpEx;
if ( !empty($hiding_info['type']) )
{
$template->set_filenames(array(
'hidinginfo' => 'hiding_information.tpl')
);
$block_name = '';
if ( in_array($hiding_info['type'], array('Sale', 'Fortune') ) )
{
if ($hiding_info['cash_prefix'])
{
$prefix = $hiding_info['cash_name'] . ' ';
$postfix = '';
}
else
{
$prefix = '';
$postfix = ' ' . $hiding_info['cash_name'];
}
}
else
{
$prefix = '';
$postfix = '';
}
switch ( $hiding_info['type'] )
{
case 'Sale':
if ( empty($buy_action) )
$buy_action = "viewtopic.$phpEx";
if ( (!$simple) && ($hiding_info['state'] == 'Cannot_read') )
{
$block_name = 'selling';
$template->assign_block_vars('selling', array(
'L_SELL_DESCRIPTION' => $lang['Sale_info'][$hiding_info['state']],
'L_SELLING_PRICE' => $lang['Selling_price'],
'L_BUY' => $lang['Buy'],
'U_POST_ID' => $hiding_info['post_id'],
'S_BUYPOST_ACTION' => append_sid($buy_action),
'SELLING_PRICE' => $prefix . intval($hiding_info['hiding_condition_value']) . $postfix )
);
}
else
{
$block_name = 'bought';
$template->assign_block_vars('bought', array(
'L_BOUGHT_DESCRIPTION' => $lang['Sale_info'][$hiding_info['state']],
'L_SELLING_PRICE' => $lang['Selling_price'],
'SELLING_PRICE' => $prefix . intval($hiding_info['hiding_condition_value']) . $postfix )
);
}
break;
case 'Reply':
$block_name = 'simple_hiding_box';
$template->assign_block_vars('simple_hiding_box', array(
'L_HIDING_DESCRIPTION' => $lang['Reply_info'][$hiding_info['state']])
);
break;
case 'Posts':
case 'Fortune':
$block_name = 'simple_hiding_box';
$template->assign_block_vars('simple_hiding_box', array(
'L_HIDING_DESCRIPTION' => sprintf($lang[$hiding_info['type'] . '_info'][$hiding_info['state']], $prefix . intval($hiding_info['hiding_condition_value']) . $postfix) )
);
break;
default:
break;
}
$template->assign_var_from_handle('tmpHiding', 'hidinginfo');
if (!empty($block_name))
unset($template->_tpldata[$block_name]);
return $template->_tpldata['.'][0]['tmpHiding'];
}
else
return '';
}
This is from inculdes/template.php, hoping its waht you need, I dont understand php.
Code: Select all
/**
* Root-level variable assignment. Adds to current assignments, overriding
* any existing variable assignment with the same name.
*/
function assign_var($varname, $varval)
{
$this->_tpldata['.'][0][$varname] = $varval;
return true;
}