Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Widgets > Member of the Month - Fix Missing Avatar Image
_Shulkie_ (Member) 5/8/2010 8:57 AM EST : Member of the Month - Fix Missing Avatar Image
_Shulkie_
Posts: 467

0
Like

0
Dislike

It breaks my heart when i see the broken/missing image icon on one of my pages and it seems that the new Member of the Month widget doesn't currently sets the <img src=""> when no avatar has been set in the member's character settings. I am sure this will be resolved in a future update and it will degrade gracefully...

however I am not a patient sort and like to tinker so here is a little fix you can add to your custom html footer

<script>
$(document).ready(
function(){
var altstring = 'No Avatar in Profile - Please check your character settings!';
if ($(".gpWidget-monthlymember img.mAll").attr("src").length == 0) {
    $(".gpWidget-monthlymember img.mAll").attr("src", noavatar);
    $(".gpWidget-monthlymember img.mAll").attr("alt", altstring);
    $(".gpWidget-monthlymember img.mAll").attr("title", altstring);
}
});
</script>

The red text above can be altered to use your own default missing avatar image, and alt/title text that pops up when you hover over the image or you can go ahead and use the one i have uploaded 


Edit: Realised selecting by ID was problematical if you have the widget on multiple pages - the image gets a different id. ho hum. anyway now the selection is done using the widget and the img.mAll class
Cheers, Shulkie
TopBottom

Mottie (SuperAdmin) 5/8/2010 9:22 AM EST : RE: Member of the Month - Fix Missing Avatar Image
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Shulkie!

LOL Very nice! Just in case you want alternative avatars, I found this site with 69 alternative facebook profile pictures. 
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Nykeawyn (Applicant) 7/1/2011 3:31 PM EST : RE: Member of the Month - Fix Missing Avatar Image
Nykeawyn
Posts: 246

0
Like

0
Dislike

I wasn't able to get this to work unfortunately.  Which is a shame cause I have a lot of members in my kin that don't have avatars and I have some really funny ones to use.

I have another question though and don't know if I should start a new thread.  Is it possible to write something that will remove certain groups from voting.  Groups like Super-Admin and officer?  Just a thought since you are so awesome!!!

Thanks
TopBottom

Mottie (SuperAdmin) 7/2/2011 1:03 PM EST : RE: Member of the Month - Fix Missing Avatar Image
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Nyjeawyn!

Hmm, I don't know if I can mess around with voting stuff like that... maybe, but it might be better to put in a support ticket with GP.

And as for the avatars, I updated the code above so it should work and I added a new post/script here for other widgets.
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Nykeawyn (Applicant) 7/2/2011 2:24 PM EST : RE: Member of the Month - Fix Missing Avatar Image
Nykeawyn
Posts: 246

0
Like

0
Dislike

Has anyone ever told you how awesome you are.  It worked like a charm and now all my kinnies have avatars.  If they don't like them, they can change them at a later time.  I really appreciate all the help you have given this NOOB.  You truely are great!!!
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%