vForums Support > Programming & Coding :: Code Requests & Support :: > ELITE group image in display name

ELITE group image in display name - Posted By Aiken (ionfortuna) on 23rd Aug 08 at 8:06am
I need a code that will put an image in front of the display name of anyone in an ELITE group...

Re: ELITE group image in display name - Posted By Aiken (ionfortuna) on 1st Sep 08 at 1:38am
It should be similar to the VIP code I was given but the group ID is entered instesd of the member name...

Re: ELITE group image in display name - Posted By Aiken (ionfortuna) on 4th Sep 08 at 7:38pm
bump

Re: ELITE group image in display name - Posted By Ross (admin) on 4th Sep 08 at 9:34pm
Hi, sorry for taking so long to get to this. I've had very limited Internet access all week {Smile}

Code: JavaScript
 
  1. <script type="text/javascript">
  2. /* Image Before Display Name for Groups */
  3.  
  4. var group_images = new Array(); var g = 0;
  5.     // group_images[g++] = new Array("GROUP ID", "IMAGE URL");
  6.     group_images[g++] = new Array("group1", "http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/vip.png");
  7.  
  8. var a = get('a','tag');
  9. for(i=0; i<a.length; i++) {
  10.     if(a.item(i).className && a.item(i).className.match(/group\d+/)) {
  11.         for(g=0; g<group_images.length; g++) {
  12.             if(a.item(i).className.match(new RegExp('(^|\\s)'+ group_images[g][0] +'(\\s|$)'))) {
  13.                 a.item(i).innerHTML = "<img src=\""+ group_images[g][1] +"\" alt=\"Elite Member\" />" + a.item(i).innerHTML;
  14.                 break;
  15.             }
  16.         }
  17.     }
  18. }
  19.  
  20. </script>