MyBB Community Forums

Full Version: Pictures for the "Inventory Shop 1.1.0" by Ryan Ashbrook
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I'm a new member of the MyBB community and I don't have great knowledge of coding or putting in some plug-ins, but I'm learning. :-)

I downloaded the Inventory Shop 1.1.0 modification and installed it. Now I want to put in pictures for the items you can buy.

The pictures shall appear in the main list of the item shop where it's splitted into different categories (the pictures shall appear next to "Weapons", "Armory" and so on) and they shall appear in the lists of the sub categories, so that every different item has its own picture.

Also the items you've bought shall be displayed under your nickname next to the field which you wrote in after you answered a thread.

Click here if you need an example (maybe you've to register): ---> Please, click me! <---

I hope you can help me. That would be really, really great. :-)



Regards,
JooL
This is a feature that is planned for the next major version (2.0.0).
Hello!

Thanks for the answer.

When do you think will version 2.0.0 come out? :-)



Regards,
JooL
It's all dependent on when MyBB 1.4 is to be released.

I'll first release 1.2 which'll be a placeholder for those who wish to upgrade to 1.4 but want to keep using the Shop Plugin.

But again how fast it gets released is dependent on when I can get my hands on MyBB 1.4.
Ryan Ashbrook Wrote:But again how fast it gets released is dependent on when I can get my hands on MyBB 1.4.

Yeah I wish I could get it too just so I could rewrite plugins BEFORE it's released. I know there is going to be mass confusion and a rush to update a lot of work when 1.4 is released. I am expecting chaos.
Hello everyone!

I heard that it's possible to put in pictures next to the item's name when you use a short and simple HTML code.

Could you tell me if it's true?
(It would be too great if you could tell me the HTML code.)



Regards,
JooL
Oh, of course it's possible, but it requires a few template edits as well as modifications to the inventoryshop.php plugin file, you'll also need to get your own images. And make sure they are .gif's.

But the way I've planned on doing it (without adding additional fields to the Database) is this:

1. Name each image the same name of the item with an underscore (_) in front of it.

Upload them to ./images/shopitems/

Note: This is untested, it should work but I have not actually done it myself, so I can't guarantee it'll work.

Then, modify the following templates:

In shop_itembits replace the entire thing with this:

<tr>
<td class="{$altbg}"><a href="shop.php?do=buy&iid={$item['iid']}"><img src="images/shopitems/_{$item['name']}.gif" alt="" /> {$item['name']}</a></td>
<td class="{$altbg}">{$price}</td>
<td class="{$altbg}">{$item['description']}</td>
</tr>

Then in ./inc/plugins/inventoryshop.php find this (around line 822):

$items .= "<br />".$lang->$id.": ".$post[$id]."";

And replace it with this:

$items .= "<br />".$lang->$id.": <img src=\"images/shopitems/_".$post[$id]."\" alt=\"\" /> ".$post[$id]."";

And that should work.

Just remember, I have no item images to provide for you, so you'll have to either make your own or find them from somewhere then edit them to match the item names with underscores in front of them. (for example, one would be called "_Broad Sword.gif")

And they need to be in the .gif format.

And again, this feature will be default in Inventory Shop 2.0.0.
Hi!

Thanks for the answer. I will try it when I've got the time to.

Could you tell me how to edit user's money? Maybe I'm blind, but I can't find this option. :-)

Edit:
I heard it's possible to edit user's money with phpMyAdmin.
Would be so great if you could tell me how to edit with phpMyAdmin.



Regards,
JooL
The functionality to Edit Users Money was removed because it relied on editing core files to add a particular hook, plus it was bugged.

To edit money via phpMyAdmin you just follow these steps:

Go to your Database > mybb_users table (may be named different depending on your table prefix) > click Browse > find the user you wish to edit and click the edit button > find the "money" field > edit > save.

A little tedious but this feature will be re-added in 1.2.0, so it'll be much faster.
Hello, Ryan!

Thank you very, very much for answering my questions. :-D

And thanks for the informations, too.

I can't wait to get the new version of the Inventory Shop.



Regards,
JooL