Magictallguy Posted March 9, 2013 Share Posted March 9, 2013 I have absolutely no idea whether this has been done before, so here's my version of a Game Rules overhaul. Keep in mind, I did develop this originally for MTG Codes, figured it may be useful to someone, and converted it to MC Craps v2 - any errors, give me a shout. The usage is simple: Upload this gamerules.php, (be sure to make a copy of your current rules), run the SQL, continue as normal. gamerules.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. SQL You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Now, for those of you using the bog standard rules, simply run this SQL *AFTER* running the previous one to create the table to insert the standard rules. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. You will also need to upload 3 icons (from http://famfamfam.com 's Silk collection - add.png, edit.png, delete.png Quote Link to comment Share on other sites More sharing options...
Spudinski Posted March 9, 2013 Share Posted March 9, 2013 Step 1: Replace You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. With You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Your "algorithm" for sanitizing a simple input variable is excessive, and mostly bad/wrong. -2. Don't overwrite globals. -1. Don't mute functions. 0. Use a proper coding style, PEAR or OTB. 1. Don't do things that call for overhead, e.g. DIRNAME(__FILE__) - use __DIR__ 2. Learn to use printf related functions, i.e. w.r.t. "echo sprintf" 3. Use double quotes for HTML attributes. 4. Learn about when it's useful to use PHP close tags when templating. I'm not trying to jack this thread or be mean, but please, since you joined again you might as well know that I(and others) personally hate MCCodes style code. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 9, 2013 Author Share Posted March 9, 2013 (edited) Step 1: Replace You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. With You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Your "algorithm" for sanitizing a simple input variable is excessive, and mostly bad/wrong. -2. Don't overwrite globals. -1. Don't mute functions. 0. Use a proper coding style, PEAR or OTB. 1. Don't do things that call for overhead, e.g. DIRNAME(__FILE__) - use __DIR__ 2. Learn to use printf related functions, i.e. w.r.t. "echo sprintf" 3. Use double quotes for HTML attributes. 4. Learn about when it's useful to use PHP close tags when templating. I'm not trying to jack this thread or be mean, but please, since you joined again you might as well know that I(and others) personally hate MCCodes style code. Sounds fair enough. I'll update now. It's not I was only trying to give someone else a script to use on MC Craps with their style or anything :P Thanks for the pointers though, I didn't know filter_input existed! *updates all codes to reflect new knowledge* Edited March 9, 2013 by Magictallguy Quote Link to comment Share on other sites More sharing options...
peterisgb Posted March 10, 2013 Share Posted March 10, 2013 (edited) This is a very good mod. much better than the default page. Edited March 10, 2013 by peterisgb Quote Link to comment Share on other sites More sharing options...
LT-DeLuXeR Posted March 10, 2013 Share Posted March 10, 2013 Parse error: syntax error, unexpected end of file in \gamerules.php on line 168 Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 10, 2013 Author Share Posted March 10, 2013 Parse error: syntax error, unexpected end of file in \gamerules.php on line 168 I've just tested the code and it works fine, make sure you copy the entire code (this forum's syntax highlighter appears to be a little .. odd) Quote Link to comment Share on other sites More sharing options...
Uridium Posted March 10, 2013 Share Posted March 10, 2013 tell me about it only way i can copy any code on here is if i go into edit mode on a persons post then copy it that way... Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 10, 2013 Author Share Posted March 10, 2013 tell me about it only way i can copy any code on here is if i go into edit mode on a persons post then copy it that way... For us non-moderators, there's a quote function that'll help ;) Quote Link to comment Share on other sites More sharing options...
LT-DeLuXeR Posted March 10, 2013 Share Posted March 10, 2013 I tried quote copying etc, but still didn't help, tried to mess around with the code but still couldn't get it to work, not sure what might be wrong. Quote Link to comment Share on other sites More sharing options...
peterisgb Posted March 10, 2013 Share Posted March 10, 2013 i was able to copy it perfectly fine with no problems. I've Zipped it for users who can't copy. http://www.vote.infamous-wars.com/download/ Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 10, 2013 Author Share Posted March 10, 2013 i was able to copy it perfectly fine with no problems. I've Zipped it for users who can't copy. http://www.vote.infamous-wars.com/download/ Thank you. You've given me an idea for my gallery too ;) Quote Link to comment Share on other sites More sharing options...
LT-DeLuXeR Posted March 11, 2013 Share Posted March 11, 2013 Tried your download link and yet I still get the same error. I totally have no idea what is wrong. :D But oh well seems like a nice mod. ^^ Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 11, 2013 Author Share Posted March 11, 2013 If you would like some help installing, send me a message :) Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 11, 2013 Share Posted March 11, 2013 Its probably not the script but a combo of this and your header file. Have you tried removing the $h-> endpage()? Sometimes that may do the trick or try throwing in a } before or after the endpage. These are just a couple of ideas Quote Link to comment Share on other sites More sharing options...
peterisgb Posted March 11, 2013 Share Posted March 11, 2013 Thank you. You've given me an idea for my gallery too ;) and idea for you gallery, this will be a must see. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 11, 2013 Author Share Posted March 11, 2013 (edited) and idea for you gallery, this will be a must see. I meant -->this<--, but still. I may re-create the in game I used to have. Edited March 11, 2013 by Magictallguy Made the URL on "this" stand out Quote Link to comment Share on other sites More sharing options...
peterisgb Posted March 11, 2013 Share Posted March 11, 2013 oh right, a dumb moment haha, nice work. Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 1, 2019 Author Share Posted March 1, 2019 Code updated Quote Link to comment Share on other sites More sharing options...
MajikalJoker Posted August 26, 2021 Share Posted August 26, 2021 i know this is a bit old but the page just wont load up. line for line copy, the page does not load Quote Link to comment Share on other sites More sharing options...
Canjucks Posted August 26, 2021 Share Posted August 26, 2021 just as easy to make hard coded with a little html ... Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted September 17, 2021 Author Share Posted September 17, 2021 On 8/26/2021 at 7:08 AM, Canjucks said: just as easy to make hard coded with a little html ... True! This grants those who prefer an in-site GUI over opening an editor that ability and was originally written with that in mind Quote Link to comment Share on other sites More sharing options...
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.