We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Advanced Award System v1.0; with tooltips
Topic Started: Nov 7 2009, 01:20 PM (46,984 Views)
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
What it Does: Adds awards to user's mini profiles (only in posts at the moment). When hovering over these awards, it will show a description of it and the date received in a tooltip.

I have tested this to work in the following browsers:
  • Google Chrome 2.0.172.43
  • Firefox 3.5.2
  • Internet Explorer 8.0.6001.18783 (lol)
  • Opera 9.26
  • Opera10.0
  • Safari 4.0


It works 100% in all of those browsers. Hopefully it works just as well in others, but I don't have them ready to test.

Preview: http://s1.zetaboards.com/zbAIO2/topic/2231766/1/

The Code:

Add the following Below The Board
Code:
 
<script type="text/javascript">
//<![CDATA[
var t_award = {
name : "Awards",
thumbnail : [20,20],
closeFunction : "fade",
users : [
[user id,"award name","award image","award description","award date"],
[user id,"award name","award image","award description","award date"],
[user id,"award name","award image","award description","award date"],
[user id,"award name","award image","award description","award date"]
]
}
//]]>
</script>
<script type="text/javascript" src="http://z3.ifrm.com/142/141/0/p239659/tooltipawards.js"></script>


That's the base of the script, but it needs to be edited when adding awards and such.

name : "Awards", - You can change "Awards" to whatever you want to call it, be it achievements, or whatever. Just make sure you wrap it with speech marks " and have a comma after the last speech mark.

thumbnail : [20,20], - These are the dimensions of the thumbnail versions of the award images. Change the first 20 to the width, and the second 20 the height.

closeFunction : "remove", - This is the animation used when you move your mouse out of the image (when hiding the information box). You can set this to either: "remove" (no animation) or "fade" (fades out) or "slide" (slides upwards). Once again, it must be wrapped with speech marks, and there must be a comma after the last speech mark.

Each award is set out like:
[user id,"award name","award image","award description","award date"],

You can add as many as you want after each other, which will automatically award someone. If you remove the award from the script, it will be removed from all of their posts as well. Note how each part is wrapped with speech marks besides the user id. User ID is the number you see in the URL when viewing their profile. For example, my account here has a user id of 230248. After each award, their should be a comma (after the closing square bracket ]). However, you do not put a comma at the end of the last award. Think of it as a list, use commas after each one, but not the last.

When filling out the information, put a backslash in front of all apostrophes and speech marks (besides the ones wrapping it). So, ' changes to \' and " changes to \". Last but not least, you cannot use line breaks (hitting the enter/ return key). If you need a line break, use \n instead, and that will be replaced by a real line break on the forum.

I realise that's a lot to take in, so if anything goes wrong, just post here :) .
Edited by slayer766, Nov 22 2009, 12:01 PM.
Offline Profile Quote Post Goto Top
 
Replies:
Mime.
Member
[ * ]
Anyone found the problem?
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
My bad, use this instead:

Code:
 
<script type="text/javascript">
//<![CDATA[
var t_award = {
name : "Awards",
thumbnail : [20,20],
closeFunction : "fade",
users : [
[945134,"Test Award","http://images.gojoin.com/images/layout/gojoin/icons/20x20/medal.gif","Test Award","2010"]
]
}
//]]>
</script>
Offline Profile Quote Post Goto Top
 
Mime.
Member
[ * ]
Cp -> Board Template -> Below the board.

Btw that code viral still not working..
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Did you try the second one I posted?
Offline Profile Quote Post Goto Top
 
Mime.
Member
[ * ]
Viral do you want to have a look into the CP to look at things closer?
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Oh, I see what's happening. You'll need to copy each line out individually because for some reason your browser is squashing everything on to one line. Make sure it's exactly as below:

Code:
 
<script type="text/javascript">
//<![CDATA[
var t_award = {
name : "Awards",
thumbnail : [20,20],
closeFunction : "fade",
users : [
[945134,"Test Award","http://images.gojoin.com/images/layout/gojoin/icons/20x20/medal.gif","Test Award","2010"]
]
}
//]]>
</script>
Offline Profile Quote Post Goto Top
 
Mime.
Member
[ * ]
Still not working viral could you log onto it as the owner and see whether you could fix it mate?
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Hmm, ok. Just pre-register an account for me with ACP access.
Offline Profile Quote Post Goto Top
 
Reid
Member Avatar
È una trappola!

Not a wise idea.
Code:
 
<script type="text/javascript">
/*<![CDATA[*/
var t_award = {
name : "Awards",
thumbnail : [20,20],
closeFunction : "fade",
users : [
[945134,"Test Award","http://images.gojoin.com/images/layout/gojoin/icons/20x20/medal.gif","Test Award","2010"]
]
}
//]]>
</script>
Try that. With the beginning line comment gone, it should work fine.

P.S.: Never give anyone ACP access unless you trust them 100%
Offline Profile Quote Post Goto Top
 
Mime.
Member
[ * ]
Thanks, but it still doesn't work.. im 100% confused?
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Reid that wouldn't work, since the last CDATA thing will comment the </script>.

Code:
 
<script type="text/javascript">/*<![CDATA[*/var t_award = {name : "Awards",thumbnail : [20,20],closeFunction : "fade",users : [[945134,"Test Award","http://images.gojoin.com/images/layout/gojoin/icons/20x20/medal.gif","Test Award","2010"]]}/*]]>*/</script>


That should work.
Offline Profile Quote Post Goto Top
 
Mime.
Member
[ * ]
It still isn't working viral, i put it in the 'Below board' section in board templates..

But is there a rules on what i can and cannot do when adding a script??

or not?

cuz this is like real important...

you got msn viral?
Offline Profile Quote Post Goto Top
 
Reid
Member Avatar
È una trappola!

Viral.
Jan 8 2010, 11:22 AM
Reid that wouldn't work, since the last CDATA thing will comment the </script>.
</script> isn't commented out because it's HTML. // only comments in JS.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Hmm good point.

Mime, can you add it to your forum so I can see what's going wrong?
Offline Profile Quote Post Goto Top
 
Mime.
Member
[ * ]
Viral **** it i trust you mate, i'll register a CP account for you
Virul i registered you an account, check your pm's for the username and password mate...

Edited by Mime., Jan 8 2010, 06:31 PM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply