Click On Avatar In Viewtopic »  Show posts from    to     

Icy Phoenix


Old Support Topics - Click On Avatar In Viewtopic



DWho [ Wed 09 Jul, 2008 21:45 ]
Post subject: Click On Avatar In Viewtopic
Hi

I was wondering if anyone knew if it was possible to click on a users avatar in viewtopic and the image will show on a new page...

I tried coding this in viewtopc.php

Code: [Hide] [Select]
'AVATAR_IMGA' => $board_config['avatar_path'] . '/',


and in viewtopic.tpl

Code: [Hide] [Select]
<span class="post-images"><a href="{AVATAR_IMGA}">{postrow.POSTER_AVATAR}</a></span>


but so far it just shows the avatar folder and not the image of the user...

Thanks for reading and any help.



Artie [ Wed 09 Jul, 2008 23:30 ]
Post subject: Re: Click On Avatar In Viewtopic
I think what you are doing will only work for an uploaded avatar. You need more php code to check for remote, default avatars, or one selected from the avatar gallery.

That said.... try this

Code: [Hide] [Select]
'AVATAR_IMGA' => $board_config['avatar_path'] . '/' . $postrow[$i]['user_avatar'],


Code: [Hide] [Select]
<span class="post-images"><a href="{postrow.AVATAR_IMGA}">{postrow.POSTER_AVATAR}</a></span>


DWho [ Wed 09 Jul, 2008 23:39 ]
Post subject: Re: Click On Avatar In Viewtopic
Thank you so much ....

Worked exactly as I would like...



Mighty Gorgon [ Thu 10 Jul, 2008 00:29 ]
Post subject: Re: Click On Avatar In Viewtopic
Or you can just edit this function by adding the ANCHOR in the generated code... so it will be applied not only in viewtopic, but in every page where an avatar is...

Code: [Hide] [Select]
function user_get_avatar($user_id, $user_avatar, $user_avatar_type, $user_allow_avatar, $path_prefix = '')
{
global $board_config;
$user_avatar_link = '';
if ($user_avatar_type && ($user_id != ANONYMOUS) && $user_allow_avatar)
{
switch($user_avatar_type)
{
case USER_AVATAR_UPLOAD:
$user_avatar_link = ($board_config['allow_avatar_upload']) ? '<img src="' . $path_prefix . $board_config['avatar_path'] . '/' . $user_avatar . '" alt="" />' : '';
break;
case USER_AVATAR_REMOTE:
$user_avatar_link = resize_avatar($user_avatar);
break;
case USER_AVATAR_GALLERY:
$user_avatar_link = ($board_config['allow_avatar_local']) ? '<img src="' . $path_prefix . $board_config['avatar_gallery_path'] . '/' . $user_avatar . '" alt="" />' : '';
break;
case USER_GRAVATAR:
$user_avatar_link = ($board_config['enable_gravatars']) ? '<img src="' . get_gravatar($user_avatar) . '" alt="" />' : '';
break;
default:
$user_avatar_link = '';
}
}

if ($user_avatar_link == '')
{
$user_avatar_link = get_default_avatar($user_id, $path_prefix);
}

return $user_avatar_link;
}


DWho [ Thu 10 Jul, 2008 01:02 ]
Post subject: Re: Click On Avatar In Viewtopic
wow very nice thanks very much





Powered by Icy Phoenix