Link Mod: http://www.phpbb.com/community/viewtopi ... &t=2101603
Cominciamo:
1) 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
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
Trova:
Codice: Seleziona tutto
?>
Codice: Seleziona tutto
// BEGIN Welcome Mod
$lang = array_merge($lang, array(
'UP_LATE' => 'You\'re up late %1$s, Shouldn\'t you be sleeping?',
'UP_EARLY' => 'Good Morning %1$s, You\'re up early today',
'GOOD_MORNING' => 'Good Morning %1$s, What a lovely morning it is',
'GOOD_AFTERNOON' => 'Good Afternoon %1$s, Finally you are here',
'GOOD_EVENING' => 'Good Evening %1$s, Nice to see you here',
'GOOD_NIGHT' => 'Good Night %1$s, time to go to bed',
'MEMBER_FOR' => 'Member For:',
'WELCOME_GUEST' => 'Guest',
'WELCOME_HOUR' => 'Hour',
'WELCOME_HOURS' => 'Hours',
'WELCOME_DAY' => 'Day',
'WELCOME_DAYS' => 'Days',
'WELCOME_MONTH' => 'Month',
'WELCOME_MONTHS' => 'Months',
'WELCOME_YEAR' => 'Year',
'WELCOME_YEARS' => 'Years',
'WELCOME_TO_MOD' => 'Welcome to',
));
// END Welcome Mod
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
Trova:
Codice: Seleziona tutto
<!-- INCLUDE overall_header.html -->
Codice: Seleziona tutto
<!-- IF not S_IS_BOT -->
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
<dl class="icon">
<dt>{L_WELCOME_TO_MOD} {SITENAME}</dt>
</dl>
</li>
</ul>
<ul class="topiclist forums">
<li>
<dl>
<dd style="padding:5px; text-align: center; border:none;">
<!-- IF USER_AVATAR -->{USER_AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF -->
</dd>
<dd class="lastpost" style="padding:5px; width:40%;">
<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 /><br />{S_JOINED_DATE}<br />{MEMBER_FOR}<!-- ENDIF --></span>
</dd>
<dd class="lastpost" style="padding:5px; width:36%;"><span>{TOTAL_POSTS} • {TOTAL_TOPICS}<br />{TOTAL_USERS}<br />{NEWEST_USER}
<!-- IF S_DISPLAY_ONLINE_LIST --><br /><br />{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<!-- ENDIF --></span>
</dd>
</dl>
</li>
</ul>
<span class="corners-bottom"><span></span></span></div></div>
<!-- ENDIF -->
Salvare i file modificati, caricarli, eliminare le cache e aggiornare il modello.