My forum is using vbshop and I got trouble like this
Attachment 133966
Item are show under every post. I want each member's item just showing 1 time on 1 page. The forum will be slow in loading if that member talking many post in 1 page. I was successful with signnature but I cant do it with item.
Please help me to hide the items onder 2nd post
this is my postbit_display_complete (in hook fodel of vbshop)
Quote:
<?php
if (!VBSHOP::$postbitcache["$post[userid]"])
{
$vbshop_postbit = array();
//if ($this->registry->options['dbtech_vbshop_enablepoints'])
//{
($hook = vBulletinHook::fetch_hook('dbtech_vbshop_postbit') ) ? eval($hook) : false;
foreach ((array)VBSHOP::$cache['currency'] as $currencyid => $currency)
{
if (!$currency['active'])
{
// Inactive currency
continue;
}
// Set the points
$currency['points'] = doubleval(VBSHOP::$cache['currencies'][$post['userid']][$currencyid]);
// Create the main stats template
$templater = vB_Template::create('dbtech_vbshop_postbit_stats') ;
$templater->register('currency', $currency);
$vbshop_postbit['point'] .= $templater->render();
}
//}
// Ensure we have everything in order
VBSHOP::verify_purchases($post);
if (!is_array($post['dbtech_vbshop_purchase']))
{
// Just to be 100% sure
$post['dbtech_vbshop_purchase'] = array();
}
krsort($post['dbtech_vbshop_purchase'], SORT_NUMERIC);
$i = 0;
$feature = 'item';
//if ($this->registry->options["dbtech_vbshop_{$feature}s_postbit"])
//{
$purchases = '';
foreach ((array)$post['dbtech_vbshop_purchase'] as $purchaseid => $purchase)
{
if ($purchase['feature'] != $feature)
{
// We only want achievements atm
continue;
}
if (!$purchase['active'])
{
// We only want achievements atm
continue;
}
if ($purchase['hidden'])
{
// We only want achievements atm
continue;
}
if ($purchase['userid'] != $post['userid'])
{
// We're not displaying stuff not intended for us
continue;
}
// This is the info we need
$purchase = array_merge($purchase, (array)VBSHOP::$cache[$purchase['feature']][$purchase['featureid']]);
if ($i >= $this->registry->options['dbtech_vbshop_numgifts'])
{
// That's too many!
continue;
}
// Ensure this is set
$purchase['icon'] = ($purchase['icon'] ? $purchase['icon'] : 'unknown.gif');
// Create the achievement bit
$templater = vB_Template::create('dbtech_vbshop_postbit_purchas ebit');
$templater->register('purchase', $purchase);
$purchases .= $templater->render();
$i++;
}
if ($purchases)
{
$templater = vB_Template::create('dbtech_vbshop_postbit_purchas e');
$templater->register('phrase', $vbphrase["dbtech_vbshop_{$feature}s"]);
$templater->register('purchases', $purchases);
$vbshop_postbit["$feature"] = $templater->render();
if (intval($this->registry->versionnumber) == 3)
{
$vbshop_postbit["$feature"] = '<div>' . $vbshop_postbit["$feature"] . '</div>';
}
else
{
$vbshop_postbit["$feature"] = '<dd>' . $vbshop_postbit["$feature"] . '</dd>';
}
}
//}
// Cache this
VBSHOP::$postbitcache["$post[userid]"] = $vbshop_postbit;
}
VBSHOP::$postbitcache2 = VBSHOP::$postbitcache["$post[userid]"];
foreach (VBSHOP::$postbitcache2 as $feature => &$template)
{
// Ensure this is updated with the proper postid
//$template = str_replace('[postid]', $post['postid'], $template);
if ($this->registry->options["dbtech_vbshop_{$feature}s_postbit"] & 1)
{
// We're hooking into this location
//$template_hook['postbit_userinfo_left'] .= '<dl class="userinfo_extra">' . $template . '</dl>';
}
if ($this->registry->options["dbtech_vbshop_{$feature}s_postbit"] & 2)
{
// We're hooking into this location
$template_hook['postbit_signature_start'] .= $template;
}
if ($this->registry->options["dbtech_vbshop_{$feature}s_postbit"] & 4)
{
// We're hooking into this location
//$template_hook['postbit_userinfo_right'] .= '<div class="imlinks"><dl class="userinfo_extra">' . $template . '</dl></div>';
}
if ($this->registry->options["dbtech_vbshop_{$feature}s_postbit"] & 8)
{
// We're hooking into this location
//$template_hook['postbit_signature_start'] .= '<div class="userinfo"><dl class="userinfo_extra">' . $template . '</dl></div>';
}
if ($this->registry->options["dbtech_vbshop_{$feature}s_postbit"] & 16)
{
// We're hooking into this location
//$template_hook['postbit_signature_end'] .= '<div class="userinfo"><dl class="userinfo_extra">' . $template . '</dl></div>';
}
}
$vbshop_postbit = VBSHOP::$postbitcache2;
if (intval($this->registry->versionnumber) > 3)
{
vB_Template:PreRegister('postbit', array('vbshop_postbit' => VBSHOP::$postbitcache2));
vB_Template:PreRegister('postbit_legacy', array('vbshop_postbit' => VBSHOP::$postbitcache2));
}
if (class_exists('POSTBITTABS'))
{
if (!POSTBITTABS::$created['dbtech_vbshop'])
{
// DragonByte Tech: Postbit Tabs - registerView()
POSTBITTABS::registerView('dbtech_vbshop_points', 'DragonByte Tech: vBShop - Points Display', (intval($this->registry->versionnumber) == 3 ? '{$vbshop_postbit[point]}' : '{vb:raw vbshop_postbit.point}'));
POSTBITTABS::registerView('dbtech_vbshop_gifts', 'DragonByte Tech: vBShop - Items', (intval($this->registry->versionnumber) == 3 ? '{$vbshop_postbit[item]}' : '{vb:raw vbshop_postbit.item}'));
// Set created
POSTBITTABS::$created['dbtech_vbshop'] = true;
}
}
?>
|