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
  • Pages:
  • 1
  • 2
Group Icons per member
Topic Started: Oct 21 2009, 11:48 PM (3,422 Views)
Holysavior-ZNR
Member Avatar
Member
[ *  *  *  *  * ]
Here is a member Icon code! want to give only acouple members a special icon? here you can!

Code:
 
<script type="text/javascript">
/* Created by HolySavior of ZNR */
mygroup = new Array();
// myusers[X]=["USER ID", "IMAGE URL"];
mygroup[0]=["177895", "URL HERE"];
mygroup[1]=["187000", "URL HERE"];

$(".usertitle").each( function() {

theid = $(this).parent("td.c_user").parent().prev().children(".c_username ").children().attr("href");
userid = theid.split("/");

for(x=0;x<mygroup.length;x++){
if(userid[4] == mygroup[x][0]) {
var ximage = mygroup[x][1];
$(this).append("<img src='"+ximage+"'>");
}
}
});
</script>
Edited by Reid, Jan 30 2010, 02:10 PM.
Offline Profile Quote Post Goto Top
 
Replies:
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type='text/javascript'>
var u_pips = [
[ '163057', 'http://z6.ifrm.com/8161/171/0/e5017145/brs.gif']
];
$('a.member').each(function () {
var l = u_pips.length, num = this.href.split('profile/')[1].split('/')[0];
while (l--) {
if (u_pips[l][0] === num) {
$(this).prepend("<img src='" + u_pips[l][1] + "' alt='' /> ");
break;
}
}
});
</script>
Try that, in the Below the Board wrapper.
Online Profile Quote Post Goto Top
 
akstylish-ZNR
Member
[ * ]
It works!..although I don't see exactly what you changed in the code.

I have another question: how do I make it appear below the box where post count, join date, etc. are instead of before the member name?
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I added an apostrophe and got rid of the comma.

That would require a whole new code. I personally know how to add images there with jQuery, but I don't know how to add an image for an individual user, so I suggest making a request for it.
Online Profile Quote Post Goto Top
 
akstylish-ZNR
Member
[ * ]
Will do it. Thank you!
Offline Profile Quote Post Goto Top
 
paradise.engineering
Member Avatar
Lowpoly Workshop Founder
[ *  *  * ]
what exactly is this? cause there is no demo
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It adds an icon to the left of a username for the member you specify in the code.
Online Profile Quote Post Goto Top
 
enias
Member
[ *  * ]
I want this but I dont want the icon appear next to the name but under the name as other I use for groups made by cory
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
By under the name do you mean directly under the name or where team icons usually appear?
Online Profile Quote Post Goto Top
 
enias
Member
[ *  * ]
yes where team icons usually appear, I use one you created for groups, so for example moderator has two icons, and icons dont mess up with the name
Edited by enias, Feb 27 2012, 02:19 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
function addIcon(group, icon) {
$('dl.user_info dt:contains(Group:) + dd:contains(' + group + ')').parent('dl.user_info').prev('div.usertitle').find('br:last').before('<br /><img src="' + icon + '" alt="Icon" />');
}

addIcon('GROUP_NAME', 'IMAGE_URL');
</script>
Change the capitalized text in the last line of code and you can repeat that line to add more additional team icons per group.
Online Profile Quote Post Goto Top
 
enias
Member
[ *  * ]
I had that, nut i wanted per member not per group, the one i found here mess up with the name, I wanted it to work like this that you just posted but per member
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
function addIcon(p_id, icon) {
$('td.c_username:has(a[href*="' + p_id + '"])').parent().next().find('td.c_user div.usertitle br:last').before('<br /><img src="' + icon + '" alt="Icon" />');
}

addIcon('PROFILE_ID', 'IMAGE_URL');
</script>
That will add the icon on a member-basis.
Online Profile Quote Post Goto Top
 
enias
Member
[ *  * ]
Perfect that is what I wanted... Gratitud Cory!!!!
How do I do to make appear the new Icon under the current ones, and not above as it is happening?
Edited by enias, Feb 29 2012, 01:25 PM.
Offline Profile Quote Post Goto Top
 
Joshua J
Member Avatar
Member
[ *  *  * ]
any way to get this to work with joinable groups
Offline Profile Quote Post Goto Top
 
Joshua J
Member Avatar
Member
[ *  *  * ]
<script type="text/javascript">
function addIcon(p_id, icon) {
$('td.c_username:has(a[href*="' + p_id + '"])').parent().next().find('td.c_user div.usertitle br:last').after('<br /><img src="' + icon + '" alt="Icon" />');
}

addIcon('PROFILE_ID', 'IMAGE_URL');
</script>
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply
  • Pages:
  • 1
  • 2