Jump to content
MakeWebGames

Recommended Posts

Posted

Hello again everyone.

Now I know what you're thinking when you read the subject for this thread, "There are already 2 or 3 of these out there." But this one uses JQuery. :D I've recently been developing my JQuery skills so I can create an updates page which is all done using JQuery.

Description

This mod will allow the admin to add new banners to the game. They type in the name of the banner, the href (path) of the banner and select whether it is available for players to choose. You will have to upload the image to your public_html folder via your cPanel or whatever you use, but that's not much of a hassle. Checks are made upon entering the name and path to make sure there are no other banners with the same path and name.

Editing a banner's details also uses JQuery (mostly). This, too, ensures that the name entered doesn't match any other banner name. Likewise with the path. Obviously, if they aren't changed, no comparison will be made.

Deleting a banner also uses JQuery and will delete the banner from the DB. But the image itself won't be deleted. Any user with that banner selected will be reverted back to the default banner, so as you can guess, you cannot delete the first banner you enter.

Installation (Part 1)

Step 1

Run the following SQLs in your PHPMYADMIN. Remember to change the yourbannerhere.png to your default banner.

You're unable to view this code.

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

 

Step 2

Create a file called choosebanner.php and paste this into it.

You're unable to view this code.

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

Edit lines 90 and 91 to change the size of the banner preview. Make sure it's scaled down from the main banner image, otherwise it'll look odd.

Part 2 next

Posted

Installation (Part 2)

Step 3

Create a file called staff_banner.php and paste this into it:

You're unable to view this code.

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

 

Step 4

Go into your header.php and find the bit where your banner is displayed. Add this code to it, before the image is shown:

You're unable to view this code.

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

and then replace the <img src = 'yourbannerhere.png' /> with <img src = '". $image ."' alt = 'Banner' />

Step 5

Go into preferences.php and add in the link so players can change their banner:

You're unable to view this code.

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

 

Step 6

Go into smenu.php and add in the following links somewhere:

You're unable to view this code.

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

 

And I believe you're done! :)

Oh, if for some reason when you add the field into the users table, the banner isn't set to the default for the users, run this in PHPMYADMIN (if you didn't know how to):

You're unable to view this code.

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

 

That should do the trick.

 

Please give me any type of feedback, but please don't flame. You wouldn't like it if one of us flamed your post or idea. ;) I'll gladly fix any bugs or errors that come up, but I've tested it and haven't received any.

Cheers,

War_Hero

Edit: Screw the screen shots. I just spent 10 minutes sorting them out only to be greeted by a Fatal Error page. That's frustrated me, so I'll post them later maybe.

Posted

I Love the concept of this modification, Gives the players of your game even more to edit the game to their preferences..

Great code, Great modification, Well done!...

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