Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Mottie (MVP) 7/2/2011 12:49 PM EST : Replace Missing Avatars
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Replace Missing Avatars

If you want to replace the avatar for the Member of the Month widget, you might need to use this code. I can't find anyone using it to test this code on 

So far this replaces missing avatars with a random one from the list. So far this code works in the shout box, officer contacts and new members widgets. It can potentially replace more.

Code
Add the following code to your custom scripting (Control Panel > Custom HTML & Script > Custom Javascript/jQuery > Document Ready Event)
var avatars = [
 'http://www.axiomfiles.com/Files/278466/avatar-Animal.jpg',
 'http://www.axiomfiles.com/Files/278466/avatar-bender.png',
 'http://www.axiomfiles.com/Files/278466/avatar-dalek.png',
 'http://www.axiomfiles.com/Files/278466/avatar-Gollum.jpg',
 'http://www.axiomfiles.com/Files/278466/avatar-hello-kitty2.png',
 'http://www.axiomfiles.com/Files/278466/avatar-snorlaxv.png'
];
// ***********************
// Don't change anything below
// ***********************

$('img[src*="empty-profile.png"]').each(function(){
 var rndm = Math.floor( Math.random() * (avatars.length) );
 $(this).attr('src', avatars[rndm]);
});
$('.gpWidget-officercontacts table.StyledList tbody tr').each(function(){
 var rndm = Math.floor( Math.random() * (avatars.length) );
 $(this).find('td:first:empty').html('<img align="left" style="height:32px;width:32px;border-width:0px;margin-right:3px;" src="' + avatars[rndm] + '">');
});
Customizing
  • Replace, or add more image urls (in orange) to pick from when replacing missing avatars.
  • Make sure that all lines, but the last, ends with a comma.
TopBottom

Nykeawyn (New Admin) 7/2/2011 2:48 PM EST : RE: Replace Missing Avatars
Nykeawyn
Posts: 246
Fingers of Fury!

Again, Completely AWESOME!!!
TopBottom

shadowstts (Guild Admin) 7/2/2011 6:13 PM EST : RE: Replace Missing Avatars
shadowstts
Posts: 364
Fingers of Fury!

ausome hope it works with forums soon 

also if it dose eventually able to work with forums can u add a way to disable it work certian ones cause i got pic of my guilds logo witch work great on the forums but looks ugly as the shoutbox picture

Asylum RULES!

TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%