SOLVED Click On Avatar In Viewtopic


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: [Download] [Hide] [Select]
'AVATAR_IMGA' => $board_config['avatar_path'] . '/',


and in viewtopic.tpl

Code: [Download] [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.

:D

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: [Download] [Hide] [Select]
'AVATAR_IMGA' => $board_config['avatar_path'] . '/' . $postrow[$i]['user_avatar'],


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

Profile PM  
Subject: Re: Click On Avatar In Viewtopic
Thank you so much ....

Worked exactly as I would like...

:D :D

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: [Download] [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;
}

Subject: Re: Click On Avatar In Viewtopic
wow very nice thanks very much

:D :D


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.733s (PHP: 4% SQL: 96%)
SQL queries: 13 - Debug Off - GZIP Enabled