GuildPortal will be going offline (permanently) by the end of the month.
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
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.

Add the following code to your custom scripting (Control Panel > Custom HTML & Script > Custom Javascript/jQuery > Document Ready Event)
var avatars = [
// ***********************
// Don't change anything below
// ***********************

 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] + '">');
  • 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.

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

Again, Completely AWESOME!!!

shadowstts (Guild Admin) 7/2/2011 6:13 PM EST : RE: Replace Missing Avatars
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!


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