MyBB Community Forums

Full Version: MyPlaza - Inventory Items in Postbit > Sig
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm running MyPlaza on my MyBB 1.2 board, and there are SO many inventory items (and many active members). Also, since there are many categories of items, and I have them 1 cat/line (necessary for neatness), the postbit takes up a lot of vertical space. I was wondering if instead of being in the postbit, I could place it just above the users sig and have an <hr> above and below it (placing the items horizontally across, and now not seperating 1 cat/line). This would save a TON of space and has been requested by members who have 20+ items. I have tried programming this myself but I can't seem to get it to work.

An alternate solution I made was just text in the postbit saying "View Inventory" and onmouseover it changed the inventory items (wrapped in a hidden div) to visible. But as soon as I implemented this on the board I got complaints from members saying that they want people to see them and not have to mouseover.

Any help on this would be most appreciated,
Thanks~
Yes, you can put the inventory items almost anywhere.
I don't have the time (right now), or perfect memory, to tell you exactly how, but here's enough to get you started.

1) Look in your templates to find the showthread_postbit related template (I'll check the exact name later, if you still need help)
2) Look for a variable in the current postbit template with the name "myplaza items", "myplaza inventory", or very similar.
3) Cut / paste that variable out of postbit and into the sig template, or into a showthread template directly under (or above) the variable "user_sig".
4) The <hr> can be added too.

## The above details aren't perfect, but now you almost know how. Smile
The following is in my global templates:

postbit_inventory
<div style="white-space: normal; margin-left: 5px; margin-right: 5px;"><a href="{$mybb->settings['bburl']}/plaza.php?action=page&amp;p=inventory&amp;uid={$post['uid']}">{$itemscode}</a></div>

postbit_inventory_item
<img src="{$mybb->settings['bburl']}/images/myplaza/{$postitem['icon']}" title="{$postitem['name']}" alt="{$postitem['name']}" /> 

postbit_inventory_view
<span class="smalltext">[<a href="{$mybb->settings['bburl']}/plaza.php?action=page&amp;p=inventory&amp;uid={$post['uid']}">{$lang->view_inventory}</a>]</span>


And then in my theme (Hero v101) template:

postbit:
<tr><td class="{$altbg}"  valign="top" style="width:180px;white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a><div style="width:180px">
{$post['user_details']}
<br /><span class="smalltext"><a href="{$mybb->settings['bburl']}/plaza.php">BFC Bux</a>: <span id="postmoney_{$post['pid']}">{$post[MYPLAZA_MONEY_COLUMN]}</span></span><br>{$post['invitems']}</div></td>
<td class="{$altbg}" width="85%" valign="top">
<table width="100%">
<tr><td>{$post['posturl']}{$post['icon']}<span class="smalltext"><strong> {$post['subject']}</strong></span>
<br /><div id="pid_{$post['pid']}">
<p>{$post['message']}</p></div>
{$post['attachments']}{$post['signature']}
<div style="text-align: right; vertical-align: bottom;">
{$post['editedmsg']}{$post['iplogged']}
</div></td></tr></table></td></tr><tr>
<td class="{$altbg}" height="18" style="white-space: nowrap; text-align: center;"><span class="smalltext">{$post['postdate']} {$post['posttime']}</span></td>
<td class="{$altbg}" width="100%" valign="middle" height="18">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td align="left" ><span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}</span></td>
<td align="right"><span class="smalltext">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['thanks']}{$post['button_multiquote']}{$post['button_report']}
</span></td></tr></table></td></tr>

postbit_signature
<hr size="1" width="95%"  align="left" />
{$post['signature']}



About a month ago I remember trying to include the global stuff like {$itemscode} in the postbit_signature, but it only appear on the forum as "{$itemscode}" (as text). I'm actually leaving now to write a calculus exam but I'll be back in 3-4 hours to do some testing.

Thanks for your help and any future help as well ~
Hi,

In > Post Bit Templates >> postbit
If you experiment with moving this one variable, it might take care of what you need.
{$post['invitems']}

#####

I have personally spent more time 'customizing' the exact format of the money$ display...

ie... <a href="{$mybb->settings['bburl']}/plaza.php">{$lang->money}</a>: <span id="postmoney_{$post['pid']}">{$post[MYPLAZA_MONEY_COLUMN]}

...so maybe you will end up teaching me something. Smile


EDIT:
I see it now...

In (Hero v101) template:

postbit:
Quote:<tr><td class="{$altbg}" valign="top" style="width:180px;white-space: nowrap; text-align: center;"><a name="pid{$post['pid']}" id="pid{$post['pid']}"></a><div style="width:180px">
{$post['user_details']}
<br /><span class="smalltext"><a href="{$mybb->settings['bburl']}/plaza.php">BFC Bux</a>: <span id="postmoney_{$post['pid']}">{$post[MYPLAZA_MONEY_COLUMN]}</span></span><br>{$post['invitems']}</div></td>
<td class="{$altbg}" width="85%" valign="top">
<table width="100%">
<tr><td>{$post['posturl']}{$post['icon']}<span class="smalltext"><strong> {$post['subject']}</strong></span>
<br /><div id="pid_{$post['pid']}">
<p>{$post['message']}</p></div>
{$post['attachments']}{$post['signature']}
<div style="text-align: right; vertical-align: bottom;">
{$post['editedmsg']}{$post['iplogged']}
</div></td></tr></table></td></tr><tr>
<td class="{$altbg}" height="18" style="white-space: nowrap; text-align: center;"><span class="smalltext">{$post['postdate']} {$post['posttime']}</span></td>
<td class="{$altbg}" width="100%" valign="middle" height="18">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="bottom">
<td align="left" ><span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}</span></td>
<td align="right"><span class="smalltext">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['thanks']}{$post['button_multiquote']}{$post['button_report']}
</span></td></tr></table></td></tr>

postbit_signature
Quote:<hr size="1" width="95%" align="left" />
{$post['signature']}
{$post['invitems']}


/Should work, let me know.
//Good luck on your exam too.
Yeah I'd already tried that a while ago, but using the {$post['invitems']} from the global template in the Hero template resulted in nothing showing up at all. I wrapped it in <hr>'s and it just produced 2 lines with nothing in between. Not sure why this is happening though...
Any ideas? I've tried a few more things but to little avail. I'm thinking maybe I could reassign variables to global ones in the php files but I dunno...
manually editing the php i was able to add it into the sig XD
thanks for your help everyone!
Haven't read everything, but the reason it doesn't work by simply moving it to the signature template is that the plugin hook is called after it. Sticking it in the postbit template (under signature perhaps?) should ensure it always works.