Page 1 of 3

Default Avatar

Posted: 06 Apr 2010, 14:23
by Stoker
Default Avatar
Written by blkjack-21 and Stoker

Moved here: viewtopic.php?f=45&t=1254

Re: Default Avatar

Posted: 06 Apr 2010, 15:46
by Fire-Fox
Nice one !

Re: Default Avatar

Posted: 08 Apr 2010, 07:29
by kevinviet
Thanks Stoker

Re: Default Avatar

Posted: 11 May 2010, 18:58
by Mario14125
1. We have chosen an avatar upload to any directory on your server. I suggest that you upload it to the folder in which there are other avatars: /images/avatars/gallery/
2. For this avatar should be access via the link http://www.twojeforum.pl/images/avatars ... avatar.png (of course replace the underlined name of the proper name for our server, and file an avatar
3. Open the file includes/functions_user.php and change the default values:

Code: Select all

'user_avatar'                   =>'',
'user_avatar_type'              => 0,
'user_avatar_width'             => 0,
'user_avatar_height'    => 0,
on

Code: Select all

'user_avatar'                   => 'http://www.twojeforum.pl/images/avatars/gallery/avatar.png',
'user_avatar_type'             => 2,
'user_avatar_width'             => 128,
'user_avatar_height'    => 128,
By changing the correct path to the avatar. Remember to include the default size of an avatar. In this case it is 128×128th If your avatar is a different size, enter the correct aspect ratio.

Changing the default avatar on existing users
If you want to set the default avatar of all those who do not have an avatar in general need to perform such a SQL query

Code: Select all

UPDATE `phpbb_users` SET `user_avatar` = 'http://www.twojeforum.pl/images/avatars/gallery/avatar.png',
`user_avatar_type` = '2',
`user_avatar_width` = '128',
`user_avatar_height` = '128'
WHERE `user_avatar` = '' ;
By changing the correct path to the avatar. Remember to include the default size of an avatar. In this case it is 128×128th If your avatar is a different size, enter the correct aspect ratio.

This method works "one time" - if the user removes the avatar from the profile it will not show him anything. So it is not forced upon anyone that does not want to have as an avatar is a must use "the default avatar.

///sorry for my bad english

Re: Default Avatar

Posted: 11 May 2010, 19:03
by cisco007
that is a lot of steps, where as the first post is easier, simpler, and no sql statements!

Re: Default Avatar

Posted: 11 May 2010, 19:53
by Mario14125
But I just wrote a another way of how you can make a default avatar... You do not need to scream...

Re: Default Avatar

Posted: 26 May 2010, 19:10
by Georgio
Stoker » 06 Apr 2010, 14:23 wrote:Default Avatar
Written by blkjack-21 and Stoker

This snippet will give users a default avatar. Off course only if they haven't chosen one in UCP :)
First version by blkjack-21 will display the default avatar everywhere on the board, the second version by Stoker will only display default avatar on viewtopic. [...]
[profile]Stoker[/profile], what's the difference between v1 & v2, i want to chose your version; ¿what you recommend me?
[hrc=red]2[/hrc]
what do you mean with "every where on the board" ? Do you mean down at "who's on line" at index??

Re: Default Avatar

Posted: 26 May 2010, 19:31
by cisco007
it's up to you which one you want, it depends on which one you feel comfortable with, read the description it tells you the difference between the two!

Re: Default Avatar

Posted: 22 Jun 2010, 23:48
by billoo
first one worked better for me
second one didnt work
when i used both the name of user was misplaced then i removed second one thanks

Re: Default Avatar

Posted: 23 Jun 2010, 14:51
by Ashley.S.
don't know if you lot are aware or not, but the second ways find does not work in the latest version of phpBB3, instead you need to instead find:

Code: Select all

	if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
	{
		return '';
	}
as posted here: http://www.phpbb.com/community/viewtopi ... #p11276755