Page 2 of 3

Re: Default Avatar

Posted: 23 Jun 2010, 20:57
by Stoker
Thanks Ashley, I have updated the code.

Re: Default Avatar

Posted: 24 Jun 2010, 00:02
by Ashley.S.
no problem :)

Re: Default Avatar

Posted: 12 Jul 2010, 13:16
by Bullseye
I used version 1.. but made my own default avatar :D

Image

Re: Default Avatar

Posted: 09 Aug 2010, 16:20
by apnaitaly
Hey

first of all very nice Snippet,,

i want to ask to Stoker which modification you have used for Avatar of poster on Index and Viewforum ( by Lefty47 mod) , i mean which users dont have Avatar here showing for him no avatar image on index & viewforum ,, how you have done this ?

THanks in advance

Re: Default Avatar

Posted: 09 Aug 2010, 16:47
by Stoker
I use the first one. Also read comments here: modsdb.php?mode=moddetail&m=58

Re: Default Avatar

Posted: 09 Aug 2010, 17:09
by apnaitaly
Edited

Re: Default Avatar

Posted: 10 Aug 2010, 22:36
by apnaitaly
sorry stoker in viewforum its showing me big avatar like profile ,,

which modification i have to do for viewforum ?

thanks

Re: Default Avatar

Posted: 10 Aug 2010, 22:55
by Stoker

Re: Default Avatar

Posted: 10 Aug 2010, 23:08
by Eliram-p
i just sets the Default Avatar for register user :D

Re: Default Avatar

Posted: 10 Aug 2010, 23:19
by apnaitaly


Thanks Stokerr for Reply ,, but i cant understand 2nd comments,, how i can arjust the modification ? i mean where i have to edit or replace ? sorry but i have tried a lot but i cant understand

pse use the following code in viewforum.php instead

Code: Select all

      $avatar_img = '';
    $avatar_max_dimensions = $topic_last_poster_avatar_height = $topic_last_poster_avatar_width = $topic_first_poster_avatar_width = $topic_first_poster_avatar_height = 40;
      
      if ( !empty($row['topic_first_poster_avatar']) || !empty($row['topic_last_poster_avatar']))
      {
         $avatar_max_dimensions = 40; // here you can change the max-width you would like to have the avatars displayed
         
         if ( !empty($row['topic_first_poster_avatar']))
         {      
            if ( $row['topic_first_poster_avatar_width'] >= $row['topic_first_poster_avatar_height'] )
            {
               $topic_first_poster_avatar_width = ( $row['topic_first_poster_avatar_width'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_first_poster_avatar_width'] ;
               $topic_first_poster_avatar_height = ( $topic_first_poster_avatar_width == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_first_poster_avatar_width'] * $row['topic_first_poster_avatar_height']) : $row['topic_first_poster_avatar_height'] ;
            }
            else 
            {
               $topic_first_poster_avatar_height = ( $row['topic_first_poster_avatar_height'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_first_poster_avatar_height'] ;
               $topic_first_poster_avatar_width = ( $topic_first_poster_avatar_height == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_first_poster_avatar_height'] * $row['topic_first_poster_avatar_width']) : $row['topic_first_poster_avatar_width'] ;
            }
         }
      
         if ( !empty($row['topic_last_poster_avatar']))
         {      
            if ( $row['topic_last_poster_avatar_width'] >= $row['topic_last_poster_avatar_height'] )
            {
               $topic_last_poster_avatar_width = ( $row['topic_last_poster_avatar_width'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_last_poster_avatar_width'] ;
               $topic_last_poster_avatar_height = ( $topic_last_poster_avatar_width == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_last_poster_avatar_width'] * $row['topic_last_poster_avatar_height']) : $row['topic_last_poster_avatar_height'] ;
            }
            else 
            {
               $topic_last_poster_avatar_height = ( $row['topic_last_poster_avatar_height'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_last_poster_avatar_height'] ;
               $topic_last_poster_avatar_width = ( $topic_last_poster_avatar_height == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_last_poster_avatar_height'] * $row['topic_last_poster_avatar_width']) : $row['topic_last_poster_avatar_width'] ;
            }
         }   
      }