Jump to content
Sign in to follow this  
Veramis

Trading System

Recommended Posts

Posted (edited)

Ok so back before MWG closed I had looked around for a trade system and couldn't find one, so I built one to suit my needs. So here it is

SQL For Trades

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Sql for Logs

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Create a file called trade.php if you are using Cronus's mod for the armory uncomment the part about check_loaned. Also if your global_func doesn't have an inv_dropdown I created one

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Inv_dropdown for your global_func.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

And for your staff_logs.php file

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

You'll want to add the link to your smenu staff_logs.php?action=tradelogs and of course the trade.php link to explore.

Edit* This was tested on base mccodes and it worked for me, I also stripped all the game specific css coding so it is barebones.

Edited by Veramis
  • Like 3

Share this post


Link to post
Share on other sites

Not bad but I would like to add a few suggestions if at all possible. All my suggestions are basically my preference:

1. In your JS change “var” to “let” or “const”. For most of them at least you would be safer with “let”.

Preface:

Over time every bit counts and I only get this from my little time with Laravel. With Eloquent in Laravel there is a handy method called “withTrashed()” and couple with “$table->softDeletes()” in the migration it creates a “deleted_at” column in the table. On your model when you use “withTrashed()” it will query all rows where the “deleted_at” column exists and != null and by default will just skip over those.

Now #2

Taking what I mentioned above, you can trash your logs table and add some sort of Boolean column in your modules table and query everything except for what you don’t want. Then in the staff logs portion you can query everything or just the ones that you want to see.

I hope that makes sense and do with what I said as you will.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...