View Single Post
  #1  
Old 10-20-2011, 02:40 PM
benny_quach benny_quach is offline
 
Join Date: Jul 2011
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help! Items showing 1 time on 1 page

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;
}
}
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01269 seconds
  • Memory Usage 1,824KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete