Les archives de FluxBB.fr
Vous n'êtes pas identifié(e).
Merci pour ce mod
Dernière modification par kankan (30-05-2010 23:40:05)
Hors ligne
Merci pour cette mod, je viens de m'amuser à la modifier.
Pour ceux qui aurait installé la mod avatar par url, il faut faire ces modif en plus :
#### Dans le viewforum.php : ####
**********Chercher :***************
// Without "the dot"
$sql = 'SELECT u.id AS uid, t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'users AS u ON t.last_poster=u.username WHERE t.forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
}
else
{
// With "the dot"
switch ($db_type)
{
case 'mysql':
case 'mysqli':
$sql = 'SELECT u.id AS uid, p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' LEFT JOIN '.$db->prefix.'users AS u ON t.last_poster=u.username WHERE t.forum_id='.$id.' GROUP BY t.id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
break;
case 'sqlite':
$sql = 'SELECT u.id AS uid, p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' LEFT JOIN '.$db->prefix.'users AS u ON t.last_poster=u.username WHERE t.id IN(SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'].') GROUP BY t.id ORDER BY t.sticky DESC, t.last_post DESC';
break;
default:
$sql = 'SELECT u.id AS uid, p.poster_id AS has_posted, t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$pun_user['id'].' LEFT JOIN '.$db->prefix.'users AS u ON t.last_poster=u.username WHERE t.forum_id='.$id.' GROUP BY t.id, t.subject, t.poster, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to, p.poster_id ORDER BY sticky DESC, '.(($cur_forum['sort_by'] == '1') ? 'posted' : 'last_post').' DESC LIMIT '.$start_from.', '.$pun_user['disp_topics'];
break;
}
}
******************Ajouter dans chaque requete avant le "FROM '.$db->prefix.'topics"********************************
,u.avatar_link (avec la virgule)
*******************Chercher :***********************
//-------------------------
//Modification personnel pour affichage avatar
//-------------------------
// Retrieve the id for the avatar (and their respective poster/online status)
if ($pun_config['o_avatars'] == '1' && $pun_user['show_avatars'] != '0')
{
if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.gif'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.gif" class = "maxavatar" alt="" />';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.jpg'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.jpg" class = "maxavatar" alt="" />';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.png'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.png" class = "maxavatar" alt="" />';
**********Ajouter ensuite :***********************
else if($img_size[0] <= $pun_config['o_avatars_width'] && $img_size[1] <= $pun_config['o_avatars_height'])
$user_avatar = '<img src="'.$cur_topic['avatar_link'].'" '.$img_size[3].' class = "maxavatar" alt="" />';
#### Dans le index.php : ####
************ Chercher : ***************
// Print the categories and forums
****** Dans la requete qui suit ($result = $db->qyuery .... etc), après "SELECT c.id AS cid," , ajouter : **********
u.avatar_link,
************ Chercher : ***************
if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_forum['uid'].'.gif'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_forum['uid'].'.gif" class = "maxavatar" alt="" />';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_forum['uid'].'.jpg'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_forum['uid'].'.jpg" class = "maxavatar" alt="" />';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$cur_forum['uid'].'.png'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$cur_forum['uid'].'.png" class = "maxavatar" alt="" />';
********* Ajouter ensuite : **************
else if($img_size[0] <= $pun_config['o_avatars_width'] && $img_size[1] <= $pun_config['o_avatars_height'])
$user_avatar = '<img src="'.$cur_forum['avatar_link'].'" '.$img_size[3].' class = "maxavatar" alt="" />';
#### Dans le userlist.php : ####
************ Chercher : ***************
// Grab the users
****** Dans la requete qui suit ($result = $db->qyuery .... etc), après "'SELECT u.id," , ajouter : **********
u.avatar_link,
************ Chercher : ***************
// Retrieve the id for the avatar (and their respective poster/online status)
if ($pun_config['o_avatars'] == '1' && $pun_user['show_avatars'] != '0')
{
if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.gif'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.gif" class = "maxavatar" alt="" />';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.jpg'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.jpg" class = "maxavatar" alt="" />';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$user_data['id'].'.png'))
$user_avatar = '<img src="'.$pun_config['o_avatars_dir'].'/'.$user_data['id'].'.png" class = "maxavatar" alt="" />';
********* Ajouter ensuite : **************
else if($img_size[0] <= $pun_config['o_avatars_width'] && $img_size[1] <= $pun_config['o_avatars_height'])
$user_avatar = '<img src="'.$user_data['avatar_link'].'" '.$img_size[3].' class = "maxavatar" alt="" />';
****** Uploader sur le serveur, c'est fini !! *******J'espère que ca servira à quelqu'un 
EDIT : Il semble que ca bug toujours, mais c'est un bon debut deja 
Dernière modification par WinuX (03-11-2010 17:12:11)
Hors ligne
Bonjour,
J'ai suivi toutes les instructions, mais les avatars ne sont pas redimenssionés.
Ca fait des avatars d'une taille de 150*150 sur l'index 
J'ai mis le bout de code css dans base.css, mais ça ne fonctionne pas 
Quelqu'un aurait-il une solution ?
Merci
Edit : C'est réglé, j'ai mis le code dans monthème.css, et non dans base.css et ça fonctionne 
Merci pour la mod c'est top !
Dernière modification par Bonhomme (18-06-2011 09:50:43)
Fondateur d'EvoCar
Hors ligne