MyBB-Plugins Forums

Full Version: [Release] Shop 1.7
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Description

Integrates a Shop system with NewPoints.

The Shop plugin comes with the following features:
  • Admin CP
    • Can create/edit/delete categories
    • Can create/edit/delete items
    • Settings:
      • Send Items - Allow users to send items to other users.
      • Sell Items - Allow users to sell items.
      • Last Purchases - Number of last purchases to show in statistics.
      • Sell Percentage - The (discounted) rate at which items can be sold for.
      • Can view others's inventories - Allow users to view other users' inventories. Note, admins always are able to view other users' inventories.
      • Items on profile - Number of items to show in profile page. Set to 0 to disable this feature.
    • Can edit user's inventories
  • Shop page
    • Items seperated by categories
    • Can buy items
    • Can view own inventory
    • Can view others's inventories (depending on the settings)
    • Can sell items (depending on the settings)
    • Can send items (depending on the settings)
    • Can view last purchases (from the statistics page)
  • Items have:
    • name
    • description
    • price
    • stock
    • icon
    • limit per user
    • an option to allow/disallow selling
    • an option to allow/disallow sending
    • an option to set if the item is hidden or not
    • an option to be PM items - that is, an item which contains a PM which is sent to whoever buys it.
  • Categories have:
    • name
    • description
    • icon
    • display order
    • an option to set which user groups can view the category and its items
    • an option to set if the category is hidden or not
  • Items can be shown in profile
  • Items can be shown in postbit

Screenshots - from 1.0 (a few things have changed in 1.1)
[Image: viewitem.th.png]
[Image: shoppage.th.png]
[Image: myitems.th.png]
[Image: admincpitems.th.png]
[Image: admincpcategories.th.png]

Installation/Upgrading
See readme.html

Converter

Convert MyPlaza Turbo Inventory items to NewPoints Shop items:
  • MAKE SURE YOU HAVE A WORKING NewPoints Shop INSTALLATION FIRST
  • MAKE SURE MYPLAZA TURBO and the Inventory module are INSTALLED AND ACTIVATED
  • Upload the file converter.php to the root of your MyBB installation and run it.
  • Follow the on screen instructions.
  • Delete the file from your server once the data has been converted.
  • Uninstall MyPlaza Turbo.
  • Move ALL icons from images/myplaza/inventory (or from the directory where you had the icons of inventory items) to images/newpoints.
  • Done!

Converted items are not given to those who have bought it as it would be very resource consuming.

Items stock are reset to 0 and set to infinite.


Thanks to
Thanks to:
Andrew
Glas
Mark.M
Xeronations

Change Log

1.7
Admins can now set a limit to the number of items of each type, one user can buy (individual setting for each item).
Admins can now edit the inventory of users by going to the user's profile and clicking "Edit Inventory".

1.6
Users can no longer send items to themselves.
Fixed a minor template problem.
Fixed a bug related to group rules and price rating.
Fixed an error in some MySQL installations.

1.5
Fixed a missing </td> in template newpoints_shop_view_item
Fixed a low security hole (XSS attack) in the ACP that would be open when deleting a category and an item.

(...)

Support

If you have any questions, ask them at MyBB-Plugins.

Download
Download is attached to this post.
I've just tested this and there's a little bug.

When you sell an Item that is in your inventory he says "Do you really want to sell this Item at FULL PRICE" instead of the real sell price..

For example if you had set the "Sell Percentage" something like 0.75 [default] and you have an item that cost 100 and you sell it, the message ask you if you want to sell it at 100, but when you sell it you get 75 (the right amount).

Sorry about my bad english but I'm Italian.
I hope you get the point..
I know what you mean, thanks, I'll wait one more week until some new bugs are reported so I can release 1.1
Thanks Smile
I just installed it on my forum along with the NewPoints Core. I put an item to sell in the store and every time I go to buy the item it get a database error. Do you know what could be causing this?

EDIT: After playing around with it i noticed that only items that i set a stock limit to have this problem if I leave it at infinite it works just fine.

Also I noticed that for the items there is no "Limit of items a user can buy" on this system, any chances of this feature coming back?
Just checked, I get it too

Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1146 - Table '---.mybb_newpoints_items' doesn't exist
Query:
UPDATE mybb_newpoints_items SET `stock`='9' WHERE iid='3'

EDIT:

@StitchRokcs:
To Fix open "newpoints_shop.php" , went to line 534, you should have this:
Quote:$db->update_query('newpoints_items', array('stock' => $item['stock']-1), 'iid=\''.$item['iid'].'\'');

Change it in this way:
Quote:$db->update_query('newpoints_shop_items', array('stock' => $item['stock']-1), 'iid=\''.$item['iid'].'\'');

It should work..
Yea but i noticed that when that happens it DOES add the item to your inventory but does NOT subtract the money.

Also I noticed that when you sell an item it gives you the full amount back rather than the 50% i set it so, however this bug has been reported before.

EDIT: Ahah! Kalastor's edit did work it no longer gives the error, it subtracts the money adds the item to the inventory and subtracts 1 item from the stocks! Thank you very much Smile
You have to change the line 759 too, so if you try to sell the item you don't get the previous error..

Change it from:
Quote:$db->update_query('newpoints_items', array('stock' => $item['stock']+1), 'iid=\''.$item['iid'].'\'');

to:
Quote:$db->update_query('newpoints_shop_items', array('stock' => $item['stock']+1), 'iid=\''.$item['iid'].'\'');

But I didn't get a thing, in the Admin Panel there's the option (on/off) to allow users to sell theirs items to other users.. But.. How do they do it?
Probably I've misunderstood something..
Thanks didnt even notice that.

I think he meant to sell it back to the store? I dont know but it does say sell to another user.
is their anyway to make it so the items show up in the in post user unfo like maybe under his user title or something?
Thanks for the bug reports guys, I'll release 1.1 soon with the bug fixes.
@Kalastor, I was going to add a sell to user feature, like a trading system but I decided to remove it and forgot to change that language var. Thanks. My next plugin will be a PayPal to Points and a Trading System for the Shop.

@vamp6x6x6x, I didn't add postbit items because it might make it look bad, I might just add something like "View Inventory (X items)"