Cette astuce permet d'ajouter dans le profil un lien vers la dernière discussion créée par le membre.
Dans le fichier profile.php
Chercher
$last_post = format_time($user['last_post']);
Ajouter après
/* Astuce dernier topic */
$result = $db->query('SELECT t.id, subject, posted FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND poster = ''.$db->escape($user['username']).'' AND t.moved_to IS NULL ORDER BY posted DESC LIMIT 1') or error('Impossible de recuperer la derniere discussion creee', __FILE__, __LINE__, $db->error());
if($db->num_rows($result))
{
$last_topic_row = $db->fetch_assoc($result);
$last_topic = format_time($last_topic_row['posted'])." - <a href='viewtopic.php?id=".$last_topic_row['id']."'>".pun_htmlspecialchars($last_topic_row['subject'])."</a>";
}
/* Fin Astuce dernier topic */
Chercher
if ($user['num_posts'] > 0)
{
$user_activity[] = '<dt>'.$lang_common['Last post'].'</dt>';
$user_activity[] = '<dd>'.$last_post.'</dd>';
}
Ajouter après
/* Astuce dernier topic */
if(isset($last_topic))
{
$user_activity[] = '<dt>'.$lang_common['Last topic'].'</dt>';
$user_activity[] = '<dd>'.$last_topic.'</dd>';
}
/* Fin Astuce dernier topic */
Chercher
<p><?php printf($lang_profile['Last post info'], $last_post) ?></p>
Ajouter après
<!-- Astuce dernier topic --> <?php echo (isset($last_topic) ? '<p>'.$lang_profile['Last topic'].' : '.$last_topic.'</p>' : '') ?> <!-- Fin Astuce dernier topic -->
Ouvrir le fichier lang/French/profile.php Chercher :
'Last post info' => 'Dernier message : %s',
Ajouter après :
'Last topic' => 'Dernières discussion créée : ',
Si vous souhaitez en discuter sur le forum : Dernier topic créé dans le profil