Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Pimp My Site! > Roster Icons
chefricochet (Guild Admin) 12/3/2008 2:34 AM EST : Roster Icons
chefricochet
Posts: 208
Fingers of Fury!

  Can anyone write a script to add class icons next to the characters names on the roster?
    Here's what we need for DDO rosters;
     Barbarian
  
     Bard

     Cleric

     Fighter

     Monk

     Paladin

     Ranger

     Rogue

     Sorcerer

     Wizard

 I have submitted it in the "what's missing from your game" forum, but I don't know the status of that request. Thanks.

Laggin
If you love something, set it free! If it doesn't come back; hunt it down, and kill it!
TopBottom

Mottie (MVP) 12/3/2008 3:52 AM EST : RE: Roster Icons
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Roster Icons: DDO | LOTRO

Hey Chefricochet!

I put this code together, but I didn't have much time to test it... tell me if it works.
<script type="text/javascript">
$(document).ready(function(){
 var tmp, cIcon = [];
 var iconHeight = 25;
 var iconWidth = 25;

 cIcon.push (["Barbarian","http://i299.photobucket.com/albums/mm299/chefricochet/chainmail/e7208559.png"]);      
 cIcon.push (["Bard","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_bard.png"]);      
 cIcon.push (["Cleric","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_cleric.png"]);      
 cIcon.push (["Fighter","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_fighter.png"]);      
 cIcon.push (["Monk","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_monk.png"]);      
 cIcon.push (["Paladin","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_paladin.png"]);      
 cIcon.push (["Ranger","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_ranger.png"]);      
 cIcon.push (["Rogue","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_rogue.png"]);      
 cIcon.push (["Sorcerer","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_sorcerer.png"]);
 cIcon.push (["Favored Soul","http://i299.photobucket.com/albums/mm299/chefricochet/chainmail/fvs.gif"]);            
 cIcon.push (["Wizard","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/class_wizard.png"]);      

 var iconImg = "<img style='vertical-align:middle' height='" + iconHeight + "' width='" + iconWidth + "' src='";
 var c2 = $.map(cIcon, function(n){ return n[0] }); // grab first entry of each cIcon so $.inArray can be used
 $(".gpWidget-rosterlrg").find("tr.NormGridRow,tr.AltGridRow").find("td:gt(2)").each(function(){
  tmp = $(this).text().replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g,'');
  if (tmp.length) {
   tmp = $.inArray( tmp, c2 );
   if ( tmp >= 0 ) {
    $(this).html(function(i,h){ return iconImg + cIcon[tmp][1] + "'> " + h; });
   }
  }
 })
});
</script>
Edit (6/13/2010): Improved the script to reduce the number of times you cycle through the roster (prevent IE error about slow script).
TopBottom

chefricochet (Guild Admin) 12/3/2008 8:43 AM EST : RE: Roster Icons
chefricochet
Posts: 208
Fingers of Fury!

 First of all thanks! Iinserted it into the css, no change! I then tried adding a new character to see if it worked, nope!
I'll kepp playing with it, maybe placing it in the footer?
I got this message! in the normal warning for enab;ed css.
The provided custom CSS contained invalid characters, such as HTML mark-up, that are not valid for a Cascading Style Sheet.  Please modify your code, removing any mark-up, before submitting.

Laggin
If you love something, set it free! If it doesn't come back; hunt it down, and kill it!
TopBottom

Mottie (MVP) 12/3/2008 9:21 AM EST : RE: Roster Icons
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

yeah sorry, it all goes into the header or footer... nothing for the custom stylesheet
TopBottom

chefricochet (Guild Admin) 12/3/2008 10:03 AM EST : RE: Roster Icons
chefricochet
Posts: 208
Fingers of Fury!

 Got it! Works great! it has to go in the banner area!
Thanks a bunch mottie.
 Be ready for the next befuddled leader here, to set up another issue! Using animations for the banner image!

Laggin
If you love something, set it free! If it doesn't come back; hunt it down, and kill it!
TopBottom

Gax_DDO (New Admin) 12/5/2008 10:45 AM EST : RE: Roster Icons
Gax_DDO
Posts: 396
Fingers of Fury!

Awsome Mottie!
Snagging that one.
TopBottom

Eochain (New Admin) 1/6/2009 4:16 AM EST : RE: Roster Icons

Image Blocked

Eochain
Posts: 518
Zomgawsh Poster

I tried this with my site but no success  - is it only for a D&D game site or could it be adopted to LOTRO?

I tried changing the name of the classes to what LOTRO uses but it still didnt click.

Help please.



Signature blocked by Forum Admin!
TopBottom

Mottie (MVP) 1/6/2009 5:26 AM EST : RE: Roster Icons
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Roster Icons: DDO | LOTRO

Hey Eochain,

I pulled the class icons from the LOTRO Lorebook... you can replace them if you desire. Anyway, here is the code:

LOTRO Roster Icons
<script type="text/javascript">
$(document).ready(function() {
 var tmp, cIcon = [];
 var iconHeight = 25;
 var iconWidth = 25;

 cIcon.push (["Burglar","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/burglar_icon64.png"]);
 cIcon.push (["Captain","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/captain_icon64.png"]);
 cIcon.push (["Champion","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/champion_icon64.png"]);
 cIcon.push (["Guardian","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/guardian_icon64.png"]);
 cIcon.push (["Hunter","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/hunter_icon64.png"]);
 cIcon.push (["Lore-master","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/lore_master_icon64.png"]);
 cIcon.push (["Minstrel","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/minstrel_icon64.png"]);
 cIcon.push (["Rune-keeper","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/runekeeper_icon64.png"]);
 cIcon.push (["Warden","http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/warden_icon64.png"]);

 var iconImg = "<img style='vertical-align:middle' height='" + iconHeight + "' width='" + iconWidth + "' src='";
 var c2 = $.map(cIcon, function(n){ return n[0] }); // grab first entry of each cIcon so $.inArray can be used
 $(".gpWidget-rosterlrg").find("tr.NormGridRow,tr.AltGridRow").find("td:gt(1)").each(function(){
  tmp = $(this).text().replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g,'');
  if (tmp.length) {
   tmp = $.inArray( tmp, c2 );
   if ( tmp >= 0 ) {
    $(this).html(function(i,h){ return iconImg + cIcon[tmp][1] + "'> " + h; });
   }
  }
 })
});
</script>
Edit (3/14/2009): Fixed the LotRO guardian icon... I corrected the spelling of the image and not the URL here LOL
Edit (6/13/2010): Improved the script to reduce the number of times you cycle through the roster (prevent IE error about slow script).
TopBottom

Eochain (New Admin) 1/7/2009 12:38 AM EST : RE: Roster Icons

Image Blocked

Eochain
Posts: 518
Zomgawsh Poster

Honestly there are no words that can truly describe the talents of Mottie the Magnificent!

If I hope this guy is huge because he sure is worth his weight in gold!

Thanks Mottie that worked perfectly


Signature blocked by Forum Admin!
TopBottom

Guppy Queen (New Admin) 9/17/2009 7:15 PM EST : RE: Roster Icons
Guppy Queen
Posts: 41034
Zomgawsh Poster

Is it possible to use this code for SWG icons in the roster?
TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%