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,963 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:
zbug
Member Avatar
Galaxy Friend
[ *  *  * ]
Okay, I approved you and gave you the rights to look at the admin cp
now you should be able to access the admin cp forgot to add the secondary 'staff' xD
Edited by zbug, Dec 23 2015, 05:42 PM.
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

The problem is [bbc_code]$("a.member[href="+main_url+"profile/"+award[0]+"/]").parent().parent().next().find("dl.user_info dd.spacer").before('<dt>'+t_award.name+':</dt><dd class="'+award[0]+'-awards"><img onmouseover="awards.tooltip.open(event,'+a+');" onmouseout="awards.tooltip.bye('+a+');" id="'+a+'-award" src="'+award[2]+'" alt="'+award[1]+'" width="'+t_award.thumbnail[0]+'px" height="'+t_award.thumbnail[1]+'px" /></dd>');[/bbc_code]the stuff in red. Viral would need to adjust either this code or Dynamo to fix it.

For Viral: The awards show up in both dl.user_info's (you made one for Dynamo). It should only show up in the first one.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Should be able to just swap the two codes around (put the award code above the other profile code).
Offline Profile Quote Post Goto Top
 
Harvyy
Member Avatar
Member
[ *  *  * ]
Can you make it so the awards can be seen on the user's profile? Example: i saw it on this forum http://prntscr.com/9i8is3
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
Not with this code
Offline Profile Quote Post Goto Top
 
zbug
Member Avatar
Galaxy Friend
[ *  *  * ]
Is there a way to make it as it's own little box?
Or even in the currency box?
Offline Profile Quote Post Goto Top
 
Darth Karzahni
Member Avatar
Member
[ * ]
What's the maximum amount of awards each user can have? On my forum it stopped working after a user got more than 35.
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Darth Karzahni
Jan 4 2016, 02:09 AM
What's the maximum amount of awards each user can have? On my forum it stopped working after a user got more than 35.
There should not be a maximum. Can you post the code for the user who has more than 35 awards? You may be missing a comma, closing quotation mark/apostrophe, or something else.
Offline Profile Quote Post Goto Top
 
Darth Karzahni
Member Avatar
Member
[ * ]
edit: Oh, I realised that the description of one award had quotation marks in it, that broke the code.
Thanks anyway! :D
Edited by Darth Karzahni, Jan 5 2016, 09:53 PM.
Offline Profile Quote Post Goto Top
 
Darth Karzahni
Member Avatar
Member
[ * ]
Hello I have a question:
Is it possible to add a scroll box, for when a member gets lots and lots of these?
Offline Profile Quote Post Goto Top
 
ChronoClepsydra
Member
[ * ]
So is it supposed to look like
[user id, \"award name \", \"award image \", \"award description \", \"award date \"]
or something because if that's the case it's now showing up for my board...
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

No need to escape the quotation marks in this case. :P
Offline Profile Quote Post Goto Top
 
ChronoClepsydra
Member
[ * ]
I'm just trying to figure out how this works, because I've seen both of the awards things and both of them don't work.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
Viral
[ *  *  *  *  *  * ]
[user id, "award name ", "award image ", "award description ", "award date "]

As DPM said, no need to escape the surrounding quotations.
Offline Profile Quote Post Goto Top
 
Sree
Member Avatar
Member
[ *  * ]
Is there a way that I can upload the details of the users to my forum and link it to the code?
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