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:
Locked Topic
[ C ] Ferby's User Friendly Badge Edit
Topic Started: Mar 9 2014, 02:07 PM (482 Views)
Kankuro
Member Avatar
かんくろ
[ *  *  *  *  * ]
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>
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

It can be done, but is it necessary? Not that it's difficult, just wondering why you want to separate the two.
Offline Profile Goto Top
 
Kankuro
Member Avatar
かんくろ
[ *  *  *  *  * ]
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.
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

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).
Offline Profile Goto Top
 
Kankuro
Member Avatar
かんくろ
[ *  *  *  *  * ]
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?
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

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().
Offline Profile Goto Top
 
Kankuro
Member Avatar
かんくろ
[ *  *  *  *  * ]
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 :)
Offline Profile Goto Top
 
Moonface
Member Avatar


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.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic