Jump to content
MakeWebGames

Recommended Posts

Posted

for v2.1

What it does

This is a donator market with the following features

Donators may sell donator days

Game managers determine the price of each donator day (currently set to $2000)

How it can benefit the users

donator days seem to pile up on the guys who donate, but are impossible to come by for those who do not donate.

Ive played other games where you can buy donator packs that other players have purchased, but the prices are hardly worth the effort

The set price helps deter inflation that can be caused by donator items

This keeps donators donating, and non donators playing and able to keep up with a little extra effort

How this was created

I have taken several examples of a crystal market from the free mods here on MWG and modified them to become a market for donator days.

I also refrenced somerandombastard's donator days market for the sql information (but havent compaired to see how close to the same they turned out)

This mod has contributions and ideas from many coders across MWG who helped me figure it out, and is (in my mind at least) comunity property.

I know its not the latest or greatest mod, and there are probably some security issues, but I wanted to give something back to the community.

Query to create the sql table and feilds

[mysql]CREATE TABLE `ddaysmarket` ( `ddID` int(11) NOT NULL auto_increment, `ddQTY` bigint(20) NOT NULL default '0', `ddADDER` int(11) NOT NULL default '0', `ddPRICE` bigint(20) NOT NULL default '2000', //change '2000' to the price you want DDays to sell / buy for PRIMARY KEY (`ddID`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;[/mysql]

 

Name: dmarket.php

You're unable to view this code.

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

 

DDayss.png

DDayss2.png

DDayss3.png

Posted

Suggestions:

  • Select what's needed
  • Your code is Cramped - Can't see it really
  • Secure your $_GET['ID'] with Abs

Apart from that, seems like an ordinary DDM. But very good effort though bud. :)

Posted

most of the structure issues are due to my ability (or lack there of) in these forums, I haven't figured out how to get it to display in these forums the same as it does in my files. IF anyone wants a copy of this that is lass cramped, PM me and ill be happy to send a copy that is easier to read.

Posted

is it me or is it missing the include 'globals.php' and a php open tag (was it cut out when you posted ?) i have not looked over it but the include i assume it needs as its a v2 mod

Posted

it wasn't you, it did get cut in the copy paste process, but has been added back! thanks greatly, that would have been a nightmare for me to find. On the bright side, im trying.

Posted

You're unable to view this code.

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

I think everything is still in there, I may have got confused half way through.

Lilith, for your first modification, this is good well done.

Posted

im actualy using CONtext, but beyond the idea that it colors the code making it easier to read, its not much better than notepad, thanks much for the link!

Posted

Nice Lilith :D

I agree with Djk, either Notepad ++ or Crimson Editior (As it highlights the syntax's (if thats the right word :S))

@OP: As said before well done Lilith - great start ;]

Posted

just a few small things 1st off you could secure the switch in an array

 

You're unable to view this code.

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

 

something i picked up off zero's old posts if its not in the array its not vaild kill the page no risk

 

2nd when doing

 

You're unable to view this code.

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

 

you may want to change it to something such as

 

You're unable to view this code.

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

 

this will make sure when being used the $id is always abs(intval ($id)) this is since the cmarket is not always "user friendly" and tends not to change every $_GET (not sure why when it should but thats mccodes) i assume this market would follow the same rule

you also would not need the "@" there since intval does not error would give 0 if nothings in it etc just a few small things more down to personal style then anything else but good work on the mod looks good :)

the editer side of things look at Text Editors

Posted
just a few small things 1st off you could secure the switch in an array

You're unable to view this code.

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

something i picked up off zero's old posts if its not in the array its not vaild kill the page no risk

2nd when doing

You're unable to view this code.

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

you may want to change it to something such as

You're unable to view this code.

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

this will make sure when being used the $id is always abs(intval ($id)) this is since the cmarket is not always "user friendly" and tends not to change every $_GET (not sure why when it should but thats mccodes) i assume this market would follow the same rule

you also would not need the "@" there since intval does not error would give 0 if nothings in it etc just a few small things more down to personal style then anything else but good work on the mod looks good :)

the editer side of things look at Text Editors

Just don't use abs(@intval()) period...

Also no need for the in_array() function on the switch cases as if it's not an available case it will go straight to the default.

Posted

well the abs(intval thing is true theres the filters and even

 

You're unable to view this code.

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

 

would see if its a number so yea i know but you still don't need the @

and the array better to be safe then sorry after messing with mccodes i tend not to leave anything open no matter what things seem to slip past when they would not with anything else

Posted

the following will not work for this mod just so people know its not worth trying

 

You're unable to view this code.

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

 

i use arrays to stop members using the staff functions on pages such as monorail (i have "addcity" function on that page now) this helps with security i also check the id's in an array of people i allow to add citys so well you could go with

 

You're unable to view this code.

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

 

that would not help with locking people out of set functions i always find arrays better in any case but that may just be me :)

Posted

the original actual works, however people have suggested improvements and better ways of coding this. Better is always a matter of opinion, so that said, Id use the clean copy DJK posted as it is easier to read. Then simply add the improvements posted here that you feel suit how you want to code.

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.

×
×
  • Create New...