Jump to content
MakeWebGames

[mccodes] Simple Theme Selector


Recommended Posts

Well its really simple this is why it is free.I know each year i come out with a new design for my game.Well using this this allows you to let your users select what they want their theme to be.Basically all about making the users happy.

(I know this is not the easiest way to do it, but hey it works so i really dont care)

First add this to your MySQL database

alter table users add`header` varchar(255) NOT NULL default 'header.php'

Now go open Your Preferences and add the fallowing

 

You're unable to view this code.

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

 

Then int he same file add this

You're unable to view this code.

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

 

 

You're unable to view this code.

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

 

NOTE:To add a new header edit this

You're unable to view this code.

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

 

Just rename the value to match what header file you want it to correspond to.

Now this part is the most time consuming(like i said im sure there is an easy way but i had to redo all my files to add a security fix to it so i weant ahead and did this.

In each file you have this

 

You're unable to view this code.

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

 

Change to this

You're unable to view this code.

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

 

Now you have a working Theme Selector

Link to comment
Share on other sites

Re: [mccodes] Simple Theme Selector

Yeah nice but you might want to add in array :P

$headers = array("header.php", "header1.php", "header2.php");

if(!in_array($_POST['header'], $headers))

{

echo 'Invalid Header!';

$h->endpage();

exit;

}

Also no need for the .php with the bit u added here

You're unable to view this code.

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

 

You can do

You're unable to view this code.

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

 

:p

Link to comment
Share on other sites

Re: [mccodes] Simple Theme Selector

 

Also no need for the .php with the bit u added here

You're unable to view this code.

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

 

You can do

You're unable to view this code.

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

 

spelling error :P

You're unable to view this code.

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

Link to comment
Share on other sites

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