Jump to content
MakeWebGames

[mccode] Icons


Recommended Posts

Guest Anonymous
Posted

This, I'm sure has been done before, however I just I'd post my version... Nothing special really, just a little set of colorful icons above the menu as indicators. When you "mouse-over" each icon you get a little descriptive tooltip.

There are icons for : Announcements, Events, Mail, Bank (Standard + Cyber), Job, and Education.

It is of course simple to extend... But I will leave that up to you.

Screenie and images from http://nyna.co.uk/gallery/ (DBS/MCcode Mods -> Icons)

Installation:

1. Upload the 6 small images (glyphs) to an icons folder in your public html folder.

2 . Make the following changes to header.php

a) Add the following to the <style>...</style> block:

 

You're unable to view this code.

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

 

b) Add the following line to just after the large print statement in the function userdata()

 

You're unable to view this code.

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

 

c) Add the following function to the headers class itself:

 

You're unable to view this code.

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

 

8 Lines of code ... Hmm, how's that for small :D

Enjoy folks

  • Replies 81
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Re: Free 2 - Icons

Add this code in global_func.php

 

You're unable to view this code.

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

 

Add this code where you want to display it:

 

You're unable to view this code.

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

 

Then by adding this to your header.php <style> tags:

 

You're unable to view this code.

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

 

And your done.

Guest Anonymous
Posted

Re: Free 2 - Icons

Wrong...

 

You're unable to view this code.

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

 

  • display_icons() returns a void - not valid text
  • display_icons should explicitly be in the headers class - hence the use of $this->
  • In my view, this is not a global function - it's specific to the display headers, hence it's location
Guest Anonymous
Posted

Re: Free 2 - Icons

It's 8 lines - how complex can that be?

My instructions are plain .. read through them carefully, ignore Killah's post, he's obviously got the wrong end of the stick.

I can't tell you *exactly* where to put things - I don't have access to your source code. I suspect you have all modified your source files rather a lot (at least I hope so).

Posted

Re: Free 2 - Icons

Well I installed everything I'm having trouble on knowing were to place the...

 

You're unable to view this code.

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

Posted

Re: Free 2 - Icons

 

You're unable to view this code.

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

 

Thats how I have mine set up..but it is not showing pictures now..on images should I add /images/?

Guest Anonymous
Posted

Re: Free 2 - Icons

Modifications to headers.php

You're unable to view this code.

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

This may be different on your system ... I don't know. I have no idea what changes you have made (or for that matter how different my version is from the original)

Posted

Re: Free 2 - Icons

Why not just make it a global func and allow them to put where ever they want? like

 

You're unable to view this code.

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

 

Then to display:

 

You're unable to view this code.

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

 

Would be much easier.

Posted

Re: Free 2 - Icons

hey nyna, i tried that in ma game which is mccodes v2. but the icons won't show, but the text is there to be seen. i've created an "icons" folder as well and placed all the icons in the folder. can u help me and lemme know what i did wrong. cause everything had been set as u've mentioned above.

Posted

Re: Free 2 - Icons

I got the same problem, what i did was change the folder name to images and then in the code its self change the directory or images/blah.png instead of icons/blah.png

hope this help :)

Guest Anonymous
Posted

Re: Free 2 - Icons

Well assuming

a) you have not changed the contents of the function display_icons()

b) you are running on a V2 system

c) have placed the display_icons() function in the headers class as instructed

Then there is a problem...

But as you have not posted your code -- only the bits that I created, I can't tell what the problem is...

As a hint... true adding a line as the last line in display_icons() :

You're unable to view this code.

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

 

If your output does not change, then you are not calling display_icons() correctly.

btw. global_func is NOT the place to put this function... there is good reason for having it in the headers class.

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