Simple Machine Codes

Forum Coding => SMF For Free Codes => Topic started by: Agent Moose on May 01, 2008, 07:57:22 pm



Title: Add More Avatars
Post by: Agent Moose on May 01, 2008, 07:57:22 pm
Footers:
Code:
<script>
var n = 0;
var Gallery = new Array();
var GalName = "GALLERY NAME";
Gallery[n++] = ["IMAGE NAME","IMAGE URL"];

document.getElementById("cat").innerHTML += "<option value='http://smcodes.smfforfree3.com' id='NewGallery'>[" + GalName + "]</option>";
document.getElementById("NewGallery").onclick = function(){
for(x=0;x<Gallery.length;x++){
document.getElementById("file").innerHTML += "<option value='" + Gallery[x][1] + "' onclick='Gal(this);'>" + Gallery[x][0] + "</option>";
};};
function Gal(Image){
document.getElementById("avatar").src = Image.value;
var UserPic = document.getElementsByTagName("input");
for(x=0;x<UserPic.length;x++){
if(UserPic[x].name == "userpicpersonal"){
UserPic[x].value = Image.value;
};};
document.getElementById("avatar_choice_external").checked = "true";
};
</script>
This lets you add more Avatars to the galleries already there.

GALLERY NAME = the Name for the new gallery
IMAGE NAME = The name for the image
IMAGE URL = The URL of the image

To add more images, add more of these lines:
Code:
Gallery[n++] = ["IMAGE NAME","IMAGE URL"];

Enjoy :)


Title: Re: Add More Avatars
Post by: GodGurl25 on May 01, 2008, 10:31:25 pm
Oh! This one is cool! I'll try it later, hehe...  ;)


Title: Re: Add More Avatars
Post by: legend 1234 on May 02, 2008, 04:03:26 am
oo sweet man thanks

legend 1234


Title: Re: Add More Avatars
Post by: robo123 on May 07, 2008, 01:06:19 pm
great code , thanks, you da best 8)


Title: Re: Add More Avatars
Post by: Agent Moose on May 07, 2008, 01:07:41 pm
Glad you like it :)

I would recommend this one though, it lets you add more than just one gallery:
http://smcodes.smfforfree3.com/index.php/topic,885.0.html (http://smcodes.smfforfree3.com/index.php/topic,885.0.html)