Default Avatar

Modifications for phpBB3.
Try the Mods here and share Your own Mods
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support

Default Avatar

Post by Stoker »

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.

Version 1 by blkjack-21

Open: includes/functions_display.php
Find:

Code: Select all

if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
	{
		return ''; 
In line find:

Code: Select all

		return '';
Replace with:

Code: Select all

	return '<img src="images/avatars/gallery/no_avatar.gif" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
no_avatar.gif

Version 2 by Stoker

Open prosilver/template/viewtopic_body.html
Find:

Code: Select all

<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{postrow.POSTER_AVATAR}</a><!-- ELSE -->{postrow.POSTER_AVATAR}<!-- ENDIF -->
In line add after:

Code: Select all

<!-- ELSE --><img src="{ROOT_PATH}images/gallery/no_avatar.gif" width="125" height="125" alt="" />

Open subsilver2/template/viewtopic_body.html
Find:

Code: Select all

			<!-- IF postrow.POSTER_AVATAR -->
				<tr>
					<td>{postrow.POSTER_AVATAR}</td>
				</tr>
Add after:

Code: Select all

			<!-- ELSE -->
				<tr>
					<td><img src="{ROOT_PATH}images/gallery/no_avatar.gif" width="125" height="125" alt="" /></td>
				</tr>
Save, upload changed files and refresh the templates
no_avatar.gif
You do not have the required permissions to view the files attached to this post.

Default Avatar

Post by Blackwolf »

Better late than never....super snippet, thanks Stoker