|
[ C ] Ferby's User Friendly Badge Edit
|
|
Topic Started: Mar 9 2014, 02:07 PM (482 Views)
|
|
Kankuro
|
Mar 9 2014, 02:07 PM
Post #1
|
- Posts:
- 1,092
- Group:
- Members
- Member
- #608,916
- Joined:
- May 25, 2013
- I'm Browsing With
- Chrome
- My Board URL
- http://gamesandanime.net/index/
- Latest Design
- http://if.invisionfree.com/topic/5195959/
|
Board Address: http://w11.zetaboards.com/Guardians_of_the_Orb/index/ Board Software: ZetaBoards Description: Modification of existing code
Would anybody be able to modify Ferby's Uder Friendly Badge & Award System so that I can have 2 areas that display instead of one? My idea is to have an area for "Awards" and another for "Badges"
Also note that you need to modify the code below since DPM and Ferby have already made quite a few modifications for me since the original code was made.
- Code:
-
<script type="text/javascript"> function addBadge(uid, name, desc, image, date) { var sysName = "Badges", maxHeight = "40px"; if ($('dl.user_info:nth-of-type(1) dd[name="badge-' + uid + '"]').length === 0) { if ((location.href.indexOf('/topic/') || location.href.indexOf('/single/')) !== -1) { $("td.c_username a[href*=/" + uid + "/]").parent().parent().next().find('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='badge-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } else if (location.href.indexOf('/profile/' + uid) !== -1) { $('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='badge-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } } $("dl.user_info dd[name=badge-" + uid + "]").prepend("<a href='#' onmousedown=\"badgePopup('" + name + "','" + desc + "','" + image + "','" + date + "')\" title='"+name+"'><img src='" + image + "' alt='Badge' style='height:20px;width:20px' /></a>"); } function badgePopup(n, d, img, da) { $("body").append("<div class='FpopupBG'><div class='Fpopup'><table><tr><th colspan='2' style='text-align:center'>" + n + "</th></tr><tr><td colspan='2' style='text-align:center'><img src='" + img + "' style='max-height:200px;max-width:200px' /></td></tr><tr><td>Name:</td><td>" + n + "</td></tr><tr><td>Description:</td><td>" + d + "</td></tr><tr><td>Date:</td><td>" + da + "</td></tr><tr><td colspan='2' style='text-align:center;'><a href='#' onmousedown='closeBadgePopup()'>Close</a></td></tr></table></div></div>"); } function closeBadgePopup() { $(".FpopupBG, .Fpopup").remove(); } </script> <script type="text/javascript"> addBadge(3793724,"Award Name Here","Description Goes Here","http://z5.ifrm.com/30294/18/0/f5260827/Nav.png","0/0/00"); </script>
|
|
|
| |
|
DaPizzaMan
|
Mar 9 2014, 04:52 PM
Post #2
|
#TeamSupport
- Posts:
- 5,109
- Group:
- Support Team
- Member
- #386,619
- Joined:
- September 28, 2010
- I'm Browsing With
- Safari · Chrome
- My Board URL
- http://s4.zetaboards.com/zbThemes/index/
|
It can be done, but is it necessary? Not that it's difficult, just wondering why you want to separate the two.
|
|
|
| |
|
Kankuro
|
Mar 9 2014, 04:56 PM
Post #3
|
- Posts:
- 1,092
- Group:
- Members
- Member
- #608,916
- Joined:
- May 25, 2013
- I'm Browsing With
- Chrome
- My Board URL
- http://gamesandanime.net/index/
- Latest Design
- http://if.invisionfree.com/topic/5195959/
|
- DaPizzaMan
- Mar 9 2014, 04:52 PM
It can be done, but is it necessary? Not that it's difficult, just wondering why you want to separate the two. I'm wanting the "Awards" to be earned while the "Badges" are bought.
|
|
|
| |
|
DaPizzaMan
|
Mar 9 2014, 05:02 PM
Post #4
|
#TeamSupport
- Posts:
- 5,109
- Group:
- Support Team
- Member
- #386,619
- Joined:
- September 28, 2010
- I'm Browsing With
- Safari · Chrome
- My Board URL
- http://s4.zetaboards.com/zbThemes/index/
|
- kankuro865
- Mar 9 2014, 04:56 PM
- DaPizzaMan
- Mar 9 2014, 04:52 PM
It can be done, but is it necessary? Not that it's difficult, just wondering why you want to separate the two.
I'm wanting the "Awards" to be earned while the "Badges" are bought. Fair enough.
Try adding the following to the top of your first <script> tag: - Code:
-
function addAward(uid, name, desc, image, date) { var sysName = "Awards", maxHeight = "40px"; if ($('dl.user_info:nth-of-type(1) dd[name="award-' + uid + '"]').length === 0) { if ((location.href.indexOf('/topic/') || location.href.indexOf('/single/')) !== -1) { $("td.c_username a[href*=/" + uid + "/]").parent().parent().next().find('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='award-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } else if (location.href.indexOf('/profile/' + uid) !== -1) { $('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='award-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } } $("dl.user_info dd[name=award-" + uid + "]").prepend("<a href='#' onmousedown=\"badgePopup('" + name + "','" + desc + "','" + image + "','" + date + "')\" title='" + name + "'><img src='" + image + "' alt='Badge' style='height:20px;width:20px' /></a>"); } Then, if you want to add an award, use addAward(STUFF GOES HERE, ETC, ETC, ETC); (otherwise, to add a badge stays the same).
|
|
|
| |
|
Kankuro
|
Mar 9 2014, 05:09 PM
Post #5
|
- Posts:
- 1,092
- Group:
- Members
- Member
- #608,916
- Joined:
- May 25, 2013
- I'm Browsing With
- Chrome
- My Board URL
- http://gamesandanime.net/index/
- Latest Design
- http://if.invisionfree.com/topic/5195959/
|
- DaPizzaMan
- Mar 9 2014, 05:02 PM
- kankuro865
- Mar 9 2014, 04:56 PM
- DaPizzaMan
- Mar 9 2014, 04:52 PM
It can be done, but is it necessary? Not that it's difficult, just wondering why you want to separate the two.
I'm wanting the "Awards" to be earned while the "Badges" are bought.
Fair enough. Try adding the following to the top of your first <script> tag: - Code:
-
function addAward(uid, name, desc, image, date) { var sysName = "Awards", maxHeight = "40px"; if ($('dl.user_info:nth-of-type(1) dd[name="award-' + uid + '"]').length === 0) { if ((location.href.indexOf('/topic/') || location.href.indexOf('/single/')) !== -1) { $("td.c_username a[href*=/" + uid + "/]").parent().parent().next().find('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='award-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } else if (location.href.indexOf('/profile/' + uid) !== -1) { $('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='award-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } } $("dl.user_info dd[name=award-" + uid + "]").prepend("<a href='#' onmousedown=\"badgePopup('" + name + "','" + desc + "','" + image + "','" + date + "')\" title='" + name + "'><img src='" + image + "' alt='Badge' style='height:20px;width:20px' /></a>"); }
Then, if you want to add an award, use addAward(STUFF GOES HERE, ETC, ETC, ETC); (otherwise, to add a badge stays the same). So the only changes I make to separate them is name is addBadge instead of addAward?
Also do I replace the code or just add this to it?
|
|
|
| |
|
DaPizzaMan
|
Mar 9 2014, 05:10 PM
Post #6
|
#TeamSupport
- Posts:
- 5,109
- Group:
- Support Team
- Member
- #386,619
- Joined:
- September 28, 2010
- I'm Browsing With
- Safari · Chrome
- My Board URL
- http://s4.zetaboards.com/zbThemes/index/
|
- kankuro865
- Mar 9 2014, 05:09 PM
- DaPizzaMan
- Mar 9 2014, 05:02 PM
- kankuro865
- Mar 9 2014, 04:56 PM
- DaPizzaMan
- Mar 9 2014, 04:52 PM
It can be done, but is it necessary? Not that it's difficult, just wondering why you want to separate the two.
I'm wanting the "Awards" to be earned while the "Badges" are bought.
Fair enough. Try adding the following to the top of your first <script> tag: - Code:
-
function addAward(uid, name, desc, image, date) { var sysName = "Awards", maxHeight = "40px"; if ($('dl.user_info:nth-of-type(1) dd[name="award-' + uid + '"]').length === 0) { if ((location.href.indexOf('/topic/') || location.href.indexOf('/single/')) !== -1) { $("td.c_username a[href*=/" + uid + "/]").parent().parent().next().find('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='award-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } else if (location.href.indexOf('/profile/' + uid) !== -1) { $('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='award-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } } $("dl.user_info dd[name=award-" + uid + "]").prepend("<a href='#' onmousedown=\"badgePopup('" + name + "','" + desc + "','" + image + "','" + date + "')\" title='" + name + "'><img src='" + image + "' alt='Badge' style='height:20px;width:20px' /></a>"); }
Then, if you want to add an award, use addAward(STUFF GOES HERE, ETC, ETC, ETC); (otherwise, to add a badge stays the same).
So the only changes I make to separate them is name is addBadge instead of addAward? Also do I replace the code or just add this to it? Add what I posted to the current code.
For an award, use addAward() (the information inside the parantheses); for a badge, the same except addBadge().
|
|
|
| |
|
Kankuro
|
Mar 9 2014, 05:15 PM
Post #7
|
- Posts:
- 1,092
- Group:
- Members
- Member
- #608,916
- Joined:
- May 25, 2013
- I'm Browsing With
- Chrome
- My Board URL
- http://gamesandanime.net/index/
- Latest Design
- http://if.invisionfree.com/topic/5195959/
|
- DaPizzaMan
- Mar 9 2014, 05:10 PM
- kankuro865
- Mar 9 2014, 05:09 PM
- DaPizzaMan
- Mar 9 2014, 05:02 PM
- kankuro865
- Mar 9 2014, 04:56 PM
- DaPizzaMan
- Mar 9 2014, 04:52 PM
It can be done, but is it necessary? Not that it's difficult, just wondering why you want to separate the two.
I'm wanting the "Awards" to be earned while the "Badges" are bought.
Fair enough. Try adding the following to the top of your first <script> tag: - Code:
-
function addAward(uid, name, desc, image, date) { var sysName = "Awards", maxHeight = "40px"; if ($('dl.user_info:nth-of-type(1) dd[name="award-' + uid + '"]').length === 0) { if ((location.href.indexOf('/topic/') || location.href.indexOf('/single/')) !== -1) { $("td.c_username a[href*=/" + uid + "/]").parent().parent().next().find('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='award-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } else if (location.href.indexOf('/profile/' + uid) !== -1) { $('dl.user_info:nth-of-type(1)').append("<dt>" + sysName + ":</dt><dd name='award-" + uid + "' style='max-height:" + maxHeight + "; overflow:auto;'></dd>"); } } $("dl.user_info dd[name=award-" + uid + "]").prepend("<a href='#' onmousedown=\"badgePopup('" + name + "','" + desc + "','" + image + "','" + date + "')\" title='" + name + "'><img src='" + image + "' alt='Badge' style='height:20px;width:20px' /></a>"); }
Then, if you want to add an award, use addAward(STUFF GOES HERE, ETC, ETC, ETC); (otherwise, to add a badge stays the same).
So the only changes I make to separate them is name is addBadge instead of addAward? Also do I replace the code or just add this to it?
Add what I posted to the current code. For an award, use addAward() (the information inside the parantheses); for a badge, the same except addBadge(). Perfect, thank you yet again
|
|
|
| |
|
Moonface
|
Mar 9 2014, 05:46 PM
Post #8
|
- Posts:
- 8,583
- Group:
- Support Team
- Member
- #133,038
- Joined:
- October 17, 2006
- I'm Browsing With
- Chrome
- My Board URL
- http://universalgaming.net
|
Completed!
Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
|
|
|
| |
| 1 user reading this topic (1 Guest and 0 Anonymous)
|