Author Topic: [Req] I may have missed this..  (Read 2448 times)

0 Members and 0 Guests are viewing this topic.

Offline Fate

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
  • Gender: Male
  • US Navy Seal - Commander Fate
    • View Profile
    • CIA
Re: [Req] I may have missed this..
« on: August 14, 2010, 02:00:55 am »
This is the code for using your own rank images:

Code: [Select]
<script type='text/javascript'>
/* Image Changes on Page
SMF For Free 2009 - WWX */
function swap_img(){
var img_b = new Array();
img_b[img_b.length++] = [ "ORIGINAL_IMAGE_URL" , "NEW_IMAGE_URL" ]

var a_i = document.getElementsByTagName('IMG');
for(i=a_i.length-1;i>=0;i--) for(j=0;j<img_b.length;j++) if(a_i[i].src == img_b[j][0]) a_i[i].src = img_b[j][1];
}
swap_img();
</script>


If you want to replace several images, simply add more of this line under the first:

img_b[img_b.length++] = [ "ORIGINAL_IMAGE_URL" , "NEW_IMAGE_URL" ]



Here is an example with the image you want changed:


Code: [Select]
<script type='text/javascript'>
 /* Image Changes on Page
 SMF For Free 2009 - WWX */
 function swap_img(){
 var img_b = new Array();
 img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/dl_ranks2/rank_0.gif" , "http://i36.tinypic.com/af9d02.jpg" ]
 
 var a_i = document.getElementsByTagName('IMG');
 for(i=a_i.length-1;i>=0;i--) for(j=0;j<img_b.length;j++) if(a_i[i].src == img_b[j][0]) a_i[i].src = img_b[j][1];
 }
 swap_img();
 </script>