Hi,
Thanks now I had success, here is the code I use to show avatar of the member everywhere I want in the main.tpl:
Add in include/template/main.tpl (where you want to show the avatar)
<pun_include "myfile.php">
Make a new PHP file with this code :
<?php
// Load the profile.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/profile.php';
if ($pun_user['is_guest'])
{ // If it's a visitor, nothing...
$user_avatar = '';
}
else
{ // If it's a member
if ($pun_config['o_avatars'] == '1' && $pun_user['show_avatars'] != '0')
{ // If the admin allowed members to use avatar AND member has an avatar
if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user['id'].'.gif'))
$user_avatar = '<a href="profile.php?section=personality&id='.$pun_user['id'].'"><img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user['id'].'.gif" '.$img_size[3].' alt="" /></a>';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user['id'].'.jpg'))
$user_avatar = '<a href="profile.php?section=personality&id='.$pun_user['id'].'"><img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user['id'].'.jpg" '.$img_size[3].' alt="" /></a>';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user['id'].'.png'))
$user_avatar = '<a href="profile.php?section=personality&id='.$pun_user['id'].'"><img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user['id'].'.png" '.$img_size[3].' alt="" /></a>';
}
else
// If the admin allowed members to use avatar AND member has NO avatar
$user_avatar = '<a href="profile.php?section=personality&id='.$pun_user['id'].'">'.$lang_profile['No avatar'].'</a>';
}
// Show the result
echo $user_avatar;
?>
RENAME your new PHP file 'myfile.php' and SAVE it to /include/user/