Default Avatar

Guides & Snippets for phpBB3.
Try the Snippets here and share Your own Snippets

Re: Default Avatar

Post by Stoker »

Thanks Ashley, I have updated the code.

Re: Default Avatar

Post by Ashley.S. »

no problem :)

Re: Default Avatar

Post by Bullseye »

I used version 1.. but made my own default avatar :D

Image

Re: Default Avatar

Post 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

Post by Stoker »

I use the first one. Also read comments here: modsdb.php?mode=moddetail&m=58

Re: Default Avatar

Post by apnaitaly »

Edited
Last edited by apnaitaly on 10 Aug 2010, 20:35, edited 2 times in total.

Re: Default Avatar

Post 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

Post by Stoker »

Re: Default Avatar

Post by Eliram-p »

i just sets the Default Avatar for register user :D

Re: Default Avatar

Post 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'] ;
            }
         }   
      }