Jump to content
MakeWebGames

Recommended Posts

Posted (edited)

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
Posted

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.

Posted (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 by Magictallguy
Posted
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)

Posted

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

  • 2 years later...
  • 3 weeks later...
Posted
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

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