Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : DDO > DDO Roster Icons
Mottie (SuperAdmin) 1/5/2011 11:20 AM EST : DDO Roster Icons
ACK!
Mottie
Posts: 3884

0
Like

0
Dislike

Dungeon & Dragons Online Roster Icons

This script adds a class icon next to the class name in the roster. Add this code to your header area, footer or into a free form text/HTML box on your roster page. Make sure you switch to HTML mode () before pasting or right click in the editor and choose "Paste As Html".

GuildPortal admin site link to the original post

Code

<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"]);       

 // Don't change anything below
 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).
Edit (1/5/2010): Split into separate posts (removed LotRO stuff).
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%