vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Help! Items showing 1 time on 1 page (https://vborg.vbsupport.ru/showthread.php?t=272424)

benny_quach 10-20-2011 02:40 PM

Help! Items showing 1 time on 1 page
 
1 Attachment(s)
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;
}
}
?>

Lynne 10-20-2011 02:50 PM

Questions/Problems regarding modifications/styles need to be asked in the modification/style thread or site forum. That is where the support for modification/style is - not out here in the main forums. Please note that if a modification/style is unsupported (or even if it says it is supported), you may be on your own if you chose to install it.

benny_quach 10-20-2011 05:08 PM

U will not understand the question if I post wrong place ? Or you dont want help ?
Please look at it if you don't want to help. Let others help me
ty

Lynne 10-20-2011 05:30 PM

This is the totally wrong place to post for help. Where did you get the modification? That is where you should be posting for help - in that exact thread where you downloaded it from.


All times are GMT. The time now is 11:55 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01004 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete