Create A Forum - Support Forums

Support => Bugs => Topic started by: Damien on August 06, 2010, 05:37:02 am

Title: Werid Bug..
Post by: Damien on August 06, 2010, 05:37:02 am
(https://support.createaforum.com/proxy.php?request=http%3A%2F%2Fi37.tinypic.com%2F2lic39d.png&hash=419b24e43edc82a3892733fb88733804079d486b)(https://support.createaforum.com/proxy.php?request=http%3A%2F%2Fi36.tinypic.com%2Fina139.png&hash=3688c9db84828fda9cc421b4a3fea226ca5dc6c1)I did the Image Swap in the Footers and it doesn't show in topics and post... How I fix?
Title: Re: Werid Bug..
Post by: Fate on August 06, 2010, 02:05:33 pm
Please post the code you used so we can help you.
Title: Re: Werid Bug..
Post by: Damien on August 06, 2010, 03:28:36 pm
I added this in Footers,
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//staradmin.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_Owner.gif" ]

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>
<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//stargmod.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_F-Mod.gif" ]

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>
<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//1staraqua.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_Artist-1.gif" ]

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>
<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//1stargold.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_banned-1.gif" ]

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>
<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//1starlime.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_creator.gif" ]

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>
<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//1starorange.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_donator.png" ]

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>
<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//1starpink.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_gmod.gif" ]

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>
<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//1starpurple.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_RetiredStaff-1.gif" ]

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>
<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//1starred.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_S-Mod.gif" ]

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>
Title: Re: Werid Bug..
Post by: Fate on August 06, 2010, 03:39:38 pm
That seems to be a code for SMF For Free Forums.

You don't need to add a new code for each image, simply do this:

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_URL_HERE" , "YOUR_REPLACEMENT_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>

Replace ORIGINAL_URL_HERE with the url of the original image. (read what Seldom Fail said below)
Replace YOUR_REPLACEMENT_IMAGE_URL with the url of the image you want. (which you did correctly)

Instead of adding a new code each time, simply add more of this line under the first:
Code: [Select]
img_b[img_b.length++] = [ "ORIGINAL_URL_HERE" , "YOUR_REPLACEMENT_IMAGE_URL" ]
Title: Re: Werid Bug..
Post by: Seldom Fail on August 06, 2010, 05:36:20 pm
You have 2 backslashes in the image links for the images you're trying to replace.

http://images.smfboards.com/ranks//staradmin.gif (http://images.smfboards.com/ranks//staradmin.gif)

That should be changed to

http://images.smfboards.com/ranks/staradmin.gif (http://images.smfboards.com/ranks/staradmin.gif)



Also, using a seperate code for each image will work. But doing what Fate suggested is easier to edit.

It's really just a preference thing. Either way will work fine and is not the cause of the trouble you're having.
Title: Re: Werid Bug..
Post by: Damien on August 07, 2010, 05:19:41 am
Thank you guys,
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//staradmin.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_Owner.gif" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks//stargmod.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_F-Mod.gif" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks//1staraqua.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_Artist-1.gif" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks//1stargold.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_banned-1.gif" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks//1starlime.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_creator.gif" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks//1starorange.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_donator.png" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks//1starpink.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_gmod.gif" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks//1starpurple.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_RetiredStaff-1.gif" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks//1starred.gif" , "http://i305.photobucket.com/albums/nn207/damo_elms/th_S-Mod.gif" ]
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>

it's fixed! Locked this please.
Title: Re: Werid Bug..
Post by: Seldom Fail on August 07, 2010, 01:06:02 pm
You still have 2 backslashes.

Take one of the links and click on it... it doesn't show an image.

http://images.smfboards.com/ranks//staradmin.gif

If it doesn't show an image there, it won't work in the code.
Title: Re: Werid Bug..
Post by: Fate on August 07, 2010, 02:17:38 pm
You still have 2 backslashes.

Take one of the links and click on it... it doesn't show an image.

http://images.smfboards.com/ranks//staradmin.gif (http://images.smfboards.com/ranks//staradmin.gif)

If it doesn't show an image there, it won't work in the code.

Actually the image works perfectly fine in Firefox regardless - so it will "work" in the code.


If the images don't appear in other browsers however, then several of your members may not be able to see the images - so it might be a good idea to take Seldom's advice. ;)
Title: Re: Werid Bug..
Post by: Damien on August 07, 2010, 04:37:28 pm
Yes, i remove the "//"
There's only one "/" like you told me.
Thank you.
Title: Re: Werid Bug..
Post by: Seldom Fail on August 07, 2010, 07:28:03 pm
no fate. im using firfox and when you click the link it doesnt take you to the image.
Title: Re: Werid Bug..
Post by: Fate on August 08, 2010, 02:06:53 am
Strange, took me directly to it. Both- with two backslashes and with one backslash.
Title: Re: Werid Bug..
Post by: dstrickner on August 08, 2010, 04:02:11 am
Strange, took me directly to it. Both- with two backslashes and with one backslash.

Same here it took me right to the image with both. :)
Title: Re: Werid Bug..
Post by: Seldom Fail on August 08, 2010, 12:53:12 pm
This is what it takes me to

http://i34.tinypic.com/2ekkenq.png