Jump to content
MakeWebGames

Game Rules overhaul


Magictallguy

Recommended Posts

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.

 
Edited by Magictallguy
Updated code
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Magictallguy
Link to comment
Share on other sites

  • 2 years later...
  • 3 weeks later...

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...