WebShop:Allow users to buy blocks from your server website!

Discussion in 'WIP and Development Status' started by Jonchun, Aug 16, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Jonchun

    Idea:
    This is a "clone" of ThisIsAreku's webshop idea but since his script is not released for public use, I've been writing my own. This makes use of his awesome InventorySQL plugin so check it out! So far, I have it set up so that I can buy items, money will be subtracted from my database, and the item will be given in game. It's pretty much set up except for a good interface and extras (update total price when you choose amount of blocks, etc)

    The basics work so far.

    Demo: JagCraft Shop
    (P.S. We are looking for more members and staff at JagCraft [just created! hosted on a 4GB RAM VPS from meteorvps] so if you are interested, just give me a pm!)

    Images are taken from here.
    (I'm simply using their images. I can easily set up a different version with all the images downloaded locally)

    The shop prices and ids are listed in this format (if you want to prepare for the release and create your own price list)
    [id],[data value],[BlockName],[priceperblock]/n

    Here is the beginning of my list.
    Code:
    "1,0,Stone,16/n
    2,0,Grass,4/n
    3,0,Dirt,4/n
    4,0,Cobblestone,8/n"
    In order for my script to work, the list needs to be flawless. You can't forget any /n's or any commas. You also shouldn't have any spaces between commas. (it's ok to have spaces in the block name e.g. Lapis Lazuli Block)
    If anyone is interested in this script, I'll get ready with a release version soon.

    Downsides: This will only work with economy systems that use and SQL database. (I use a custom economy with a php backend so it's not a problem for me but this will definitely not be BOSeconomy compatible unless the creators decide to make it SQL compatible.)

    Also, if anyone is good with javascript, I could really really use some help! I want it so that when users select the number of blocks they want to buy, they are notified of the cost. Of course I can make it so it redirects them to a verification screen with transaction details before they accept but I'm fairly certain that will get annoying. If anyone wants to help with a shopping cart system, I'm up for that as well.

    Note: My code is VERY messy! I'm a self-taught php dev who learned from simply common sense and reading other people's code. I've never trained myself to write with the formal standards and my code is often messy even after using a code cleaner. Still, since I'm not good with advanced features, I always end up using workarounds with less advanced features so my code shouldn't be too hard to figure out. Well, reply if you're interested :D

    Donate!
    It'll really get me going on this! I need more donations to help pay off my server fees and less worrying about server fees will bring about a fast release :D

    [​IMG]
     
  2. Offline

    MCManager

    Omg this is awesome
     
  3. Offline

    Jonchun

    thanks haha. I'm still working on it :). It's functional but the formatiing is a bit icky. I just got pagination working too :D
     
  4. Offline

    tyzoid

    I'm pretty good at JS.

    PM me the HTML/PHP file. I'll do the javascript price changer.
     
  5. Offline

    Jonchun

    well i'm thinking about either javascript (with the price change) or a mini shopping cart. What would be more effective? Combination of both?
     
  6. Offline

    tyzoid

    It would be both on the same page.

    You are thinking of something like this, right?
    BTW... underscores represent textboxes.







    StoneQTY:______Price: 0 Credits
    DirtQTY:______Price: 0 Credits
    CobblestoneQTY:______Price: 0 Credits
    WoodQTY:______Price: 0 Credits
    SaplingQTY:______Price: 0 Credits
    SandQTY:______Price: 0 Credits
     
  7. Offline

    zebras

    I don't know if You do this or You already doing this, but I want to give You a suggestion how could it work.
    1. Create Stand-alone InventorySQL page, like you already created.
    2. Make registration into it (user-panel)(and authentication could be in game, web generate a code and in 1 hour you must to approve it by going into game and getting that code (I think, that "offline" plugin would help you here)), that every user could give himself an item (explain how in further steps)(InventorySQL nicknames should be same as in game)(also it would be awesome if IP could be tracked).
    3. Make web credits, for exchanging them to items.
    4. Then you should create admin-panel, with it help to grant credits or delete users.
    5. Users that were granted by credits, go to exchange panel and buy items.

    It's hard, but it's possible. And of course I gonna donate for this project.
     
  8. Offline

    Jonchun

    Well thanks to InventorySQL, I've already integrated this webshop with my custom CMS. It basically works with ANY SQL database as long as it contains a column named "money." The web credits on my website are called JagBucks and they are obtainable by voting on any of the 3 toplists JagCraft.tk is registered at. (Although it can't verify a vote, it ensures that the system can't be abused by making sure one user can't get his points more than once every 24 hours). The Admin panel wouldn't be too hard. I can simply hardcode a password in (configurable) or I can add a webadmin column to the users table.

    I'm not really sure about all your steps. Especially 2 and 5. (wording was kinda confusing). I'm still working on this but it does work already. If you want, you can register at jagcraft.tk just to see how it works. (I didn't protect the webshop page against non-logged in users so you people on the bukkit forums can view it)
     
  9. Offline

    zebras

    step 5: Users who were granted credits from admin, could go to exchange panel and exchange credits to items.
    step 2: How registration would work:
    1. User requesting registration (user write his server nickname and password which he want to use in empty tabs).
    2. Now user authenticating with server help. When user registered, he must confirm, that he is his server nickname owner.
    3. So secret code generating in web and sending to a player in game.
    4. Player getting that code, when joining the game and using it for validation in web.
    (my optional request: track every user ip)
    I don't know, maybe this will be much more explainable than what I wrote before :D

    Edit: went to your webpage, where registration is located and only now noticed, that you must /register in game to login in web. If I'm right the process is like this:
    1. Going to server and registering.
    2. Going to web and using that nickname and password which you used in game?
    If this right, then all my confusing language in step 2 is nonsense and can be ignored :D
     
  10. Offline

    Jonchun

    lol. Basically for jagcraft, you login, type "/register [password]" and you are registered into my system. Then, users are forced to go to my website, click on the Rules page, and click "I Accept" in order to gain build rights. It's not a foolproof greylist system but I figure it stops idiots and a lot of griefers who like to target less customized servers. Once you are registered and verified in my system, you can easily vote for credits and buy stuff from the webshop.
     
  11. Offline

    zebras

    Yap, just tested it, works greatly :D and why I didn't noticed it earlier D: So, my only request would only be, that you could create admin panel for web shop and IP tracker :D
     
  12. Offline

    Jonchun

    Well I'm not sure what the IP tracker would be used for. (What do you mean by this)
    Admin Panel? What would the Admin Panel accomplish?
     
  13. Offline

    zebras

    Because I don't know how will you publish your project (all web like yours or only stand-alone web shop with registration), and admin panel in which you could grant players credits (because I'm don't know if you already have or not similar this function). IP tracker would be used for players IP library. Because I running a server in offline mode, anyone can join to it and ip banning is the only useful for judgment. So when user register or log-in to web, ip would be stored and could be easily viewed from admin panel.
     
  14. Offline

    Jonchun

    Yea. that's perfect :)

    I see. So you're looking for a standalone webshop? (It shouldn't be too hard. In fact maybe I'll make a demo release tonight. That way I'll get more donations/support/devs to help out)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  15. Offline

    zebras

    Yep, looking in stand-alone more, because all my server chained webs are placed in the same machine with the server, like statistics :D. So I don't need any function except those, which I mentioned :D. And I'll be so exited if you will make it tonight. Don't want to be a Pain in as*, but if ya need any tester, I could help you day and night :D
     
  16. Offline

    Jonchun

    cool lemme try to get a standalone webshop running right now. You can contact me in-game. :)
     
  17. Offline

    adenslayer

    How is this coming along?
     
  18. Offline

    Sushi

    It probably isn't coming along. You just bumped a thread that hasn't been updated in more than a year.
     
Thread Status:
Not open for further replies.

Share This Page