Ecco questa mod totalmente rielaborata da me, rendendola una barra di Bentornato!
Visualizza tutta una serie di statistiche, prettamente inerenti l'utente.
Autore: alex75
Versione phpbb : 3.0.11
Difficoltà: facile meno di 5 minuti
Apri: index.php
Trova:
Codice: Seleziona tutto
// Assign index specific vars
Codice: Seleziona tutto
// BEGIN Welcome Mod
//--Welcome_Mod--get the hour number-->
$date = $user->format_date(time(), 'H');
if ($user->data['is_registered'])
{
$u_user_name = get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']);
}
else
{
$u_user_name = $user->lang['WELCOME_GUEST'];
}
switch (true)
{
case ($date < 1):
// if the hour is 11am-12am (18-23)
$s_welcome = sprintf($user->lang['GOOD_NIGHT'], $u_user_name);;
break;
case ($date < 4):
// if the hour is 1-3 am
$s_welcome = sprintf($user->lang['UP_LATE'], $u_user_name);
break;
case ($date < 8):
// if the hour is 4-7 am
$s_welcome = sprintf($user->lang['UP_EARLY'], $u_user_name);
break;
case ($date < 12):
// if the hour is 8-11 am
$s_welcome = sprintf($user->lang['GOOD_MORNING'], $u_user_name);
break;
case ($date < 18):
// if the hour is 12-5pm
$s_welcome = sprintf($user->lang['GOOD_AFTERNOON'], $u_user_name);
break;
case ($date < 24):
// if the hour is 6pm-11pm
$s_welcome = sprintf($user->lang['GOOD_EVENING'], $u_user_name);;
break;
}
// how long a member for
$member_for = '';
if ($user->data['is_registered'] && !$user->data['is_bot'])
{
$member_length = time() - $user->data['user_regdate'];
$years = $months = $days = 0;
$member_for = '';
if ($member_length)
{
if ($member_length >= 31536000)
{
$years = floor($member_length / 31536000);
$member_length = $member_length - ($years * 31536000);
$member_for .= $years > 1 ? ($years . ' ' . $user->lang['WELCOME_YEARS'] . ', ') : ($years . ' ' . $user->lang['WELCOME_YEAR'] . ', ');
}
$months = floor($member_length / 2628000);
if ($months)
{
$months = $months > 1 ? ($months . ' ' . $user->lang['WELCOME_MONTHS'] . ', ') : ($months . ' ' . $user->lang['WELCOME_MONTHS'] . ', ');
$member_length = $member_length - ($months * 2628000);
$member_for .= $months;
}
$days = floor($member_length / 86400);
if ($days)
{
$days = $days > 1 ? ($days . ' ' . $user->lang['WELCOME_DAYS']) : ($days . ' ' . $user->lang['WELCOME_DAY']);
$member_for .= $days;
}
}
}
//END Welcome Mod
// INIZIO - Ultimi Topic Utente -- by Sir Xiradorn
$sql_lastusertopic = 'SELECT topic_id, forum_id, topic_title, topic_time, topic_moved_id FROM '.TOPICS_TABLE.'
WHERE topic_moved_id = 0 AND topic_poster = '.$user->data['user_id'].'
ORDER BY topic_time
DESC LIMIT 0,50';
$risultato_lastusertopic = $db->sql_query($sql_lastusertopic);
$ltucount = 0;
while ($row_lastusertopic = $db->sql_fetchrow($risultato_lastusertopic))
{
$time_lastusertopic = $user->format_date($row_lastusertopic['topic_time']);
if ($ltucount < 5) {
if ($auth->acl_get('f_read', $row_lastusertopic['forum_id']) == 1) {
$template->assign_block_vars('lastusertopic', array(
'LASTUSERTOPIC_LINK' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row_lastusertopic['forum_id'] . "&t=" . $row_lastusertopic['topic_id']),
'LASTUSERTOPIC_TITOLO' => $row_lastusertopic['topic_title'],
'LASTUSERTOPIC_TIME' => $time_lastusertopic,
));
}
$ltucount = $ltucount + 1;
}
}
$db->sql_freeresult($risultato_lastusertopic);
// FINE - Ultimi Topic Utente --
Codice: Seleziona tutto
'LEGEND' => $legend,
Codice: Seleziona tutto
// BEGIN Welcome Mod
'S_WELCOME' => $s_welcome,
'S_JOINED_DATE' => $user->lang['JOINED'] . ': ' . $user->format_date($user->data['user_regdate']),
'USER_AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
'MEMBER_FOR' => (!empty($member_for)) ? $user->lang['MEMBER_FOR'] . ' ' . $member_for : '',
// END Welcome Mod
Apri: styles/prosilver/template/overall_header.html
Trova ed elimina queste righe:
Codice: Seleziona tutto
<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
<ul class="linklist leftside">
<li class="icon-ucp">
<a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="e">{L_PROFILE}</a>
<!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->
<!-- IF S_DISPLAY_SEARCH --> •
<a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a>
<!-- ENDIF -->
<!-- IF U_RESTORE_PERMISSIONS --> •
<a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a>
<!-- ENDIF -->
</li>
</ul>
<!-- ENDIF -->
apri: styles/prosilver/template/index_body.html
trova:
Codice: Seleziona tutto
<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p>
<!-- IF U_MCP --><p>{CURRENT_TIME} <br />[ <a href="{U_MCP}">{L_MCP}</a> ]</p><!-- ELSEIF S_USER_LOGGED_IN --><p>{CURRENT_TIME}</p><!-- ENDIF -->
Codice: Seleziona tutto
<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
<dl class="icon">
<dt>Bentornato! su {SITENAME}</dt>
</dl>
</li>
</ul>
<ul class="topiclist forums">
<li>
<dl>
<dd style="padding:5px; text-align: center; border:none;">
<!-- IF USER_AVATAR --><br />{USER_AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF -->
</dd>
<dd class="lastpost" style="padding:5px; width:25%;">
<p>{S_WELCOME}</p>
<span><!-- IF S_USER_LOGGED_IN -->• {LAST_VISIT_DATE}<br />• {CURRENT_TIME}<!-- ELSE -->• {CURRENT_TIME}<!-- ENDIF --><!-- IF S_USER_LOGGED_IN --><br />• {S_JOINED_DATE}<br />• {MEMBER_FOR}<!-- ENDIF -->
<li class="lastpost">
<a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="e"><br />• {L_PROFILE}<!-- IF U_MCP --></a><br /><a href="{U_MCP}">• {L_MCP}<!-- ENDIF --><!-- IF U_ACP --></a><br /><a href="{U_ACP}">• {L_ACP}</a><!-- ENDIF -->
<!-- IF S_DISPLAY_PM --><br />• (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->
<!-- IF S_DISPLAY_SEARCH --><br />•
<a href="{U_SEARCH_SELF}">Tutti i tuoi Posts</a>
<!-- ENDIF -->
</li></span>
</dd>
<dd class="lastpost" style="padding:5px; width:35%;"><span>• {TOTAL_POSTS} </br>• {TOTAL_TOPICS}<br />• {TOTAL_USERS}<br />• {NEWEST_USER}
<!-- IF U_VIEWONLINE --></br></br><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF -->
<!-- IF S_DISPLAY_ONLINE_LIST --><br />• {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<!-- ENDIF -->
</br><!-- IF S_DISPLAY_BIRTHDAY_LIST -->
<h3>• {L_BIRTHDAYS}</h3>
<p><!-- IF BIRTHDAY_LIST -->{L_CONGRATULATIONS}: <strong>{BIRTHDAY_LIST}</strong><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p>
<!-- ENDIF --></span>
</dd>
<dd style="width: 15%; padding: 5px; margin-top: -20px;">
<!-- IF .lastusertopic -->
<h3>I Tuoi Ultimi 5 Topics</h3>
<!-- BEGIN lastusertopic -->• <b><a href="{lastusertopic.LASTUSERTOPIC_LINK}">{lastusertopic.LASTUSERTOPIC_TITOLO}</a></b><br />» {lastusertopic.LASTUSERTOPIC_TIME}<br /><!-- END lastusertopic -->
<!-- ENDIF -->
</dd>
</dl>
</li>
</ul>
<span class="corners-bottom"><span></span></span></div></div>
<!-- ENDIF -->
apri: language/it/common.php
trova:
Codice: Seleziona tutto
?>
Codice: Seleziona tutto
// BEGIN Welcome Mod
$lang = array_merge($lang, array(
'UP_LATE' => 'Sei in ritardo %1$s, Dove ti eri addormentato?!',
'UP_EARLY' => 'Buon Giorno %1$s, Venuto presto stamattina eh?!',
'GOOD_MORNING' => 'Buon Giorno %1$s, Che mattina meravigliosa!',
'GOOD_AFTERNOON' => 'Buon Pomeriggio %1$s, Finalmente sei qui',
'GOOD_EVENING' => 'Buona Sera %1$s, E\' un piacere vederti qui',
'GOOD_NIGHT' => 'Buona Notte %1$s, E\' ora di andare a letto',
'MEMBER_FOR' => 'Iscritto da:',
'WELCOME_GUEST' => 'Ospite',
'WELCOME_HOUR' => 'Ora',
'WELCOME_HOURS' => 'Ore',
'WELCOME_DAY' => 'Giorno',
'WELCOME_DAYS' => 'Giorni',
'WELCOME_MONTH' => 'Mese',
'WELCOME_MONTHS' => 'Mesi',
'WELCOME_YEAR' => 'Anno',
'WELCOME_YEARS' => 'Anni',
));
// END Welcome Mod
copiate il file no_avatar.gif in allegato su styles/prosilver/theme/images
Aggiornate il template, svuotate la cache. Fine della mod