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

VIP image in display name - Posted By Aiken (ionfortuna) on 23rd Aug 08 at 8:04am
I need a code that will put my VIP image in the beggining of the display name of anyone that is a VIP...

Re: VIP image in display name - Posted By Ross (admin) on 26th Aug 08 at 8:38am
Hi, is there any chance you can post your forums URL so I can set this up for you? {Smile}

Re: VIP image in display name - Posted By Aiken (ionfortuna) on 27th Aug 08 at 4:49am
Yeah, I'm using the muli color name code temorarily...

http://theanimehideout.vforums.co.uk/

Re: VIP image in display name - Posted By Ross (admin) on 30th Aug 08 at 7:59pm
Hi,

Is this the kind of thing you were thinking of?

Code: JavaScript
 
  1. <script type="text/javascript">
  2. /* VIP Image Before Display Name */
  3.  
  4. var vip_image = "http://i266.photobucket.com/albums/ii280/Ryuzaki_Master/vip.png";
  5. var vips = Array(
  6.     'admin',
  7.     'nekosakurachan' // no comma on last list
  8. );
  9.  
  10. var a = get('a','tag');
  11. for(i=0; i<a.length; i++) {
  12.     if(a.item(i).href.match(/view_profile\/user\/(\w+)(\/|$|#)/)){
  13.         var user = RegExp.$1;
  14.         for(v=0; v<vips.length; v++) {
  15.             if(vips[v] == user) {
  16.                 a.item(i).innerHTML = "<img src=\""+ vip_image +"\" alt=\"VIP\" />" + a.item(i).innerHTML;
  17.             }
  18.         }
  19.     }
  20. }
  21.  
  22. </script>
 


It would go in the global footer and you'd just enter the user names into the bit which looks like this:

var vips = Array(
'admin',
'nekosakurachan' // no comma on last list
);