Default Avatar

Guides & Snippets for phpBB3. Try the Snippets here and share Your own Snippets
There is no support here! Only Read Access!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Default Avatar

Post by Stoker »

Thanks Ashley, I have updated the code.
Board rules! No PM support
User avatar
Ashley.S.
BBCoder II
BBCoder II
Posts: 36
Joined: 05 Mar 2010, 12:24
Location: Falmouth, Cornwall, UK
Contact:

Re: Default Avatar

Post by Ashley.S. »

no problem :)
Regards,
-Ashley.S. [ Pluto Hosting Managing Director & ProphpBB Moderator ]
User avatar
Bullseye
BBCoder IV
BBCoder IV
Posts: 153
Joined: 02 Apr 2010, 20:49
Location: England

Re: Default Avatar

Post by Bullseye »

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

Image
apnaitaly
BBCoder II
BBCoder II
Posts: 28
Joined: 05 Mar 2010, 23:09
Contact:

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
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Default Avatar

Post by Stoker »

I use the first one. Also read comments here: modsdb.php?mode=moddetail&m=58
Board rules! No PM support
apnaitaly
BBCoder II
BBCoder II
Posts: 28
Joined: 05 Mar 2010, 23:09
Contact:

Re: Default Avatar

Post by apnaitaly »

Edited
Last edited by apnaitaly on 10 Aug 2010, 22:35, edited 2 times in total.
apnaitaly
BBCoder II
BBCoder II
Posts: 28
Joined: 05 Mar 2010, 23:09
Contact:

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
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Default Avatar

Post by Stoker »

Board rules! No PM support
Eliram-p
BBCoder I
BBCoder I
Posts: 3
Joined: 10 Aug 2010, 13:39

Re: Default Avatar

Post by Eliram-p »

i just sets the Default Avatar for register user :D
apnaitaly
BBCoder II
BBCoder II
Posts: 28
Joined: 05 Mar 2010, 23:09
Contact:

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