SMF For Free Support Forum
Signup For Free Forum
August 30, 2008, 12:54:25 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [Code] Avatar Gallery  (Read 373 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 623


Do not PM me for Code Support or Request


View Profile WWW
« on: May 05, 2008, 02:29:33 pm »

Footers:
Code:
<script>
var n = 0;
var Gallery = new Array();
var GName = new Array();
GName = ["GALLERY NAME1","GALLERY NAME2"];

Gallery[n++] = ["GALLERY NAME1","IMAGE NAME","IMAGE"];

if(location.href.match(/sa=forumProfile/i)){
for(i=0;i<GName.length;i++){
//Created by Agent Moose (smcodes.smfforfree3.com)
if(GName[i].match(/ /i)){
var ID1 = GName[i].split(" ").join("");
}else{
var ID1 = GName[i];
};
document.getElementById("cat").innerHTML += "<option value='http://smcodes.smfforfree3.com' id='" + ID1 + "' onclick='Images(this);'>[" + GName[i] + "]</option>";
};
};
function Images(WORK){
for(x=0;x<Gallery.length;x++){
if(WORK.id == Gallery[x][0]){
document.getElementById("file").innerHTML += "<option value='" + Gallery[x][2] + "' onclick='Gal(this);'>" + Gallery[x][1] + "</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 code is just like "Add More Avatars", but better name, and it is just better Tongue
Unlike Add More Avatars code, you can add more than just one gallery for this one.

GALLERY NAME = The Names of the Gallery.  To add more gallerys, just add more (,"")
So, for example, it would be like this:
Code:
GName = ["GALLERY NAME1","GALLERY NAME2","I Add This"];

The Second GALLERY NAME would be for the gallery you want the images to be in.
IMAGE NAME = The Name for the image.
IMAGE = The URL of that image.

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

Again, Change GALLERY NAME to the gallery you would like the images to be in Smiley


Enjoy Smiley
« Last Edit: May 05, 2008, 02:31:06 pm by Agent Moose » Logged

Eternal Flame Coming Soon

SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.
pker own
SMF For Free Sr. Member
*
Offline Offline

Posts: 372


View Profile WWW
« Reply #1 on: May 05, 2008, 02:35:59 pm »

Wow very nice code AM come in handy XD. avatars is a little bugged atm but SMF will fix it. but Gj!
Logged

Gary
SMF For Free Full Member
*
Offline Offline

Posts: 189


Have a nice day!


View Profile
« Reply #2 on: May 06, 2008, 08:21:57 am »

Moose, This is not working for me. Can you tell me whats wrong with it..?

Code:
<script>
var n = 0;
var Gallery = new Array();
var GName = new Array();
GName = ["Avatar Gallery","Avatars"];

Gallery[n++] = ["Avatar Gallery","

Battle Angel Avatars","http://avatars.animeserve.com/d/1320-5461/BattleAngel.gif"];

if(location.href.match(/sa=forumProfile/i)){
for(i=0;i<GName.length;i++){
//Created by Agent Moose (smcodes.smfforfree3.com)
if(GName[i].match(/ /i)){
var ID1 = GName[i].split(" ").join("");
}else{
var ID1 = GName[i];
};
document.getElementById("cat").innerHTML += "<option value='http://smcodes.smfforfree3.com' id='" + ID1 + "' onclick='Images(this);'>[" + GName[i] + "]</option>";
};
};
function Images(WORK){
for(x=0;x<Gallery.length;x++){
if(WORK.id == Gallery[x][0]){
document.getElementById("file").innerHTML += "<option value='" + Gallery[x][2] + "' onclick='Gal(this);'>" + Gallery[x][1] + "</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>

Logged

Vice
SMF For Free Full Member
*
Offline Offline

Posts: 136


Photoshop Userbars :d


View Profile WWW
« Reply #3 on: May 06, 2008, 12:30:48 pm »

Nice work moose im always impressed by your amazing work
Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 623


Do not PM me for Code Support or Request


View Profile WWW
« Reply #4 on: May 06, 2008, 02:44:04 pm »

Gary, You cant have any line breaks (enters) in the image name:

Code:
<script>
var n = 0;
var Gallery = new Array();
var GName = new Array();
GName = ["Avatar Gallery","Avatars"];

Gallery[n++] = ["Avatar Gallery","Battle Angel Avatars","http://avatars.animeserve.com/d/1320-5461/BattleAngel.gif"];

if(location.href.match(/sa=forumProfile/i)){
for(i=0;i<GName.length;i++){
//Created by Agent Moose (smcodes.smfforfree3.com)
if(GName[i].match(/ /i)){
var ID1 = GName[i].split(" ").join("");
}else{
var ID1 = GName[i];
};
document.getElementById("cat").innerHTML += "<option value='http://smcodes.smfforfree3.com' id='" + ID1 + "' onclick='Images(this);'>[" + GName[i] + "]</option>";
};
};
function Images(WORK){
for(x=0;x<Gallery.length;x++){
if(WORK.id == Gallery[x][0]){
document.getElementById("file").innerHTML += "<option value='" + Gallery[x][2] + "' onclick='Gal(this);'>" + Gallery[x][1] + "</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>

And thanks Vice and pker own Smiley
Logged

Eternal Flame Coming Soon

SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.
Gary
SMF For Free Full Member
*
Offline Offline

Posts: 189


Have a nice day!


View Profile
« Reply #5 on: May 07, 2008, 03:48:27 am »

Thanks Moose, Really Appreciated. Smiley
Logged



Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.222 seconds with 16 queries.