Lilith Posted August 27, 2010 Posted August 27, 2010 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. Quote
Wazam Posted August 27, 2010 Posted August 27, 2010 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. :) Quote
sniko Posted August 27, 2010 Posted August 27, 2010 May want to structure your code, ill show you on MSN my preference. Anyway, good modification idea. -sniko Spiedex Corp. Founder Quote
Lilith Posted August 27, 2010 Author Posted August 27, 2010 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. Quote
Dominion Posted August 27, 2010 Posted August 27, 2010 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 Quote
Wazam Posted August 27, 2010 Posted August 27, 2010 It's probably a problem when he pasted it into the Type box. Quote
Lilith Posted August 27, 2010 Author Posted August 27, 2010 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. Quote
CJ - Twitch Posted August 27, 2010 Posted August 27, 2010 Looks good. ;) Try using pastbin. But good work bud. Quote
Djkanna Posted August 27, 2010 Posted August 27, 2010 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. Quote
Lilith Posted August 27, 2010 Author Posted August 27, 2010 um,,, ok, noobie showing here, but what is pastbin? Quote
Djkanna Posted August 27, 2010 Posted August 27, 2010 http://www.pastebin.com Code pasting and generally text pasting online service. You may want to move from Notepad (I think that's what you're coding in now) and go to something more advance like notepad++ Quote
Lilith Posted August 27, 2010 Author Posted August 27, 2010 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! Quote
Spydre452 Posted August 27, 2010 Posted August 27, 2010 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 ;] Quote
Djkanna Posted August 27, 2010 Posted August 27, 2010 Not only that but things like notepad no matter how you style it in notepad it becomes squished on MWG and anywhere else you may post it Quote
Dominion Posted August 27, 2010 Posted August 27, 2010 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 Quote
The Spirit Posted August 27, 2010 Posted August 27, 2010 I learnt form your post Dominion, thanks :thumbup: Quote
Djkanna Posted August 27, 2010 Posted August 27, 2010 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. Quote
Wazam Posted August 27, 2010 Posted August 27, 2010 Hmmm.. Some useful information there Dominion. @ What most useful. :) Quote
Dominion Posted August 27, 2010 Posted August 27, 2010 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 Quote
sniko Posted August 28, 2010 Posted August 28, 2010 You could use a terny You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Lilith Posted August 28, 2010 Author Posted August 28, 2010 sits here patiently with notepad and pencil taking notes. Quote
Dominion Posted August 28, 2010 Posted August 28, 2010 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 :) Quote
sniko Posted August 28, 2010 Posted August 28, 2010 Yea array() is a good function indeed. Good work Dom and sweet for the modification Quote
Tony_Montana06 Posted September 1, 2010 Posted September 1, 2010 so what is the correct code for this whole mod?? Quote
Lilith Posted September 2, 2010 Author Posted September 2, 2010 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.