Merci seo,
Voila le mod complet avec quelques corrections mineures sur l'affichage,
MOD USER COUNT : EXCLUSIVITE PHPBB SEO
Description: affiche un compteur dans le profil chaque membre, qui comptabilise ses connexions
FAIRE UN BACKUP COMPLET DE VOS FICHIERS ET BASE SQL AVANT 1) Création d'un nouveau champs "user_online_count" (ds la table phpbb_users) pour comptabiliser les connexions pour chaque membre
SQL
*** I have considered the table prefix as "phpbb_". If your table prefix is different the replace accordingly.
- Code: Tout sélectionner
ALTER TABLE phpbb_users ADD user_online_count mediumint(8) UNSIGNED NOT NULL DEFAULT 0;
2) Emplacement du compteur dans le profil des membres
Open: styles/prosilver/template/memberlist_view.html
Find
Tip: This may be a partial find and not the whole line.
- Code: Tout sélectionner
<dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
- Code: Tout sélectionner
<dt>{L_TOTAL_ONLINE_COUNT_LEGEND}:</dt> <dd>{TOTAL_ONLINE_COUNT}</dd>
3) Variable texte
Open: language/fr/common.php
Find
Tip: This may be a partial find and not the whole line.
- Code: Tout sélectionner
'TOTAL_NO_PM' => '0 message privé',
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
- Code: Tout sélectionner
//START MOD USER COUNT
'TOTAL_ONLINE_COUNT_LEGEND' => 'Connexions',
//END MOD MOD USER COUNT
4) requête pour afficher la valeur du champs "user_online_count" au travers de la variable "{TOTAL_ONLINE_COUNT}"
Open: memberlist.php
Find
Tip: This may be a partial find and not the whole line.
- Code: Tout sélectionner
'LOCATION' => ($data['user_from']) ? $data['user_from'] : '',
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
- Code: Tout sélectionner
// START MOD USER COUNT
'TOTAL_ONLINE_COUNT' => $data['user_online_count'],
// END MOD USER COUNT
5) incrémenter le champs "user_online_count" de chaque membre à chacune de ses connexions
Open: includes/functions.php
Find
Tip: This may be a partial find and not the whole line.
- Code: Tout sélectionner
// Special case... the user is effectively banned, but we allow founders to login
if (defined('IN_CHECK_BAN') && $result['user_row']['user_type'] != USER_FOUNDER)
{
return;
}
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
- Code: Tout sélectionner
// STARD MOD USER COUNT
$sql = "UPDATE " . USERS_TABLE . "
SET user_online_count = user_online_count + 1
WHERE user_id = " . (int) $result['user_row']['user_id'];
$db->sql_query($sql);
// END MOD USER COUNT
Voila tout marche parfaitement
