Cominciamo:
1) Apri: index.php
Trova:
Codice: Seleziona tutto
// Assign index specific vars
$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'LEGEND' => $legend,
Codice: Seleziona tutto
// Assign index specific vars
// 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 6pm-11pm (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 (12-17)
$s_welcome = sprintf($user->lang['GOOD_AFTERNOON'], $u_user_name);
break;
case ($date < 24):
// if the hour is 6pm-11pm (18-23_
$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
//Avatar Fusion Welcome Mod controll - Sir Xiradorn
$avatar_width_new = $user->data['user_avatar_width'];
$avatar_height_new = $user->data['user_avatar_height'];
if ($avatar_width_new > 150 || $avatar_height_new > 200)
{
if ($avatar_width_new > $avatar_height_new)
{
$avatar_height_new = (($avatar_height_new * 200) / $avatar_width_new);
$avatar_width_new = 150;
}
else
{
$avatar_width_new = (($avatar_width_new * 200) / $avatar_height_new);
$avatar_height_new = 150;
}
}
//Avatar Fusion Welcome Mod controll - Sir Xiradorn
$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'LEGEND' => $legend,
// 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']),
'USER_AVATAR_NEW' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $avatar_width_new, $avatar_height_new),
'MEMBER_FOR' => (!empty($member_for)) ? $user->lang['MEMBER_FOR'] . ' ' . $member_for : '',
// END Welcome Mod
Codice: Seleziona tutto
// Output page
Codice: Seleziona tutto
// INIZIO - Topic più Visto
$sql = "SELECT topic_id, forum_id, topic_title, topic_views FROM " . TOPICS_TABLE . " ORDER BY topic_views DESC LIMIT 0,5";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
if ($auth->acl_get('f_read', $row['forum_id']) == 1) {
$template->assign_block_vars('topicvisto', array(
'LINK' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row['forum_id'] . "&t=" . $row['topic_id']),
'TITOLO' => $row['topic_title'],
'VIEWS' => $row['topic_views'])
);
}
}
$db->sql_freeresult($result);
// FINE
// INIZIO - Ultimi Topic -- by Sir Xiradorn
$sql_lasttopic = "SELECT topic_id, forum_id, topic_title, topic_time, topic_moved_id FROM ".TOPICS_TABLE."
WHERE topic_moved_id = 0
ORDER BY topic_time
DESC LIMIT 0,15";
$risultato_lasttopic = $db->sql_query($sql_lasttopic);
$ltcount = 0;
while ($row_lasttopic = $db->sql_fetchrow($risultato_lasttopic))
{
$time_lasttopic = $user->format_date($row_lasttopic['topic_time']);
if ($ltcount < 5) {
if ($auth->acl_get('f_read', $row_lasttopic['forum_id']) == 1) {
$template->assign_block_vars('lasttopic', array(
'LASTTOPIC_LINK' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=" . $row_lasttopic['forum_id'] . "&t=" . $row_lasttopic['topic_id']),
'LASTTOPIC_TITOLO' => $row_lasttopic['topic_title'],
'LASTTOPIC_TIME' => $time_lasttopic,
));
}
$ltcount = $ltcount + 1;
}
}
$db->sql_freeresult($risultato_lasttopic);
// FINE
// INIZIO - Top Posters -- by Sir Xiradorn
$sql_topposter = "SELECT user_id, username, user_posts, user_colour FROM ".USERS_TABLE." WHERE group_id != 6 AND group_id != 1 ORDER BY user_posts DESC LIMIT 0,10";
$risultato_topposter = $db->sql_query($sql_topposter);
while ($row_topposter = $db->sql_fetchrow($risultato_topposter))
{
$template->assign_block_vars('topposter', array(
'TOPPOSTER' => get_username_string('full', $row_topposter['user_id'], $row_topposter['username'], $row_topposter['user_colour']),
'TOPPOSTER_NUM' => $row_topposter['user_posts'],
));
}
$db->sql_freeresult($risultato_topposter);
// FINE
// INIZIO - Last Sign Members List -- by Sir Xiradorn
$sql_lastusersign = "SELECT user_id, username, user_regdate, user_colour FROM ".USERS_TABLE." ORDER BY user_regdate DESC LIMIT 0,10";
$risultato_lastusersign = $db->sql_query($sql_lastusersign);
while ($row_lastusersign = $db->sql_fetchrow($risultato_lastusersign))
{
$template->assign_block_vars('lastusersign', array(
'LASTUSERSING' => get_username_string('full', $row_lastusersign['user_id'], $row_lastusersign['username'], $row_lastusersign['user_colour']),
));
}
$db->sql_freeresult($risultato_lastusersign);
// 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
// FINE
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',
));
// 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
<!-- Wellcome_mod -->
<!-- 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>Benvenuti in {SITENAME}</dt>
</dl>
</li>
</ul>
<ul class="topiclist forums" style="background-color: #EEF5F9">
<li class="row">
<dl>
<dd style="padding:5px; text-align: center; border:none;">
<!-- IF USER_AVATAR_NEW -->{USER_AVATAR_NEW}<!-- ELSE --><img src="{ROOT_PATH}images/no_avatar.png" width="100" height="100"/><!-- ENDIF -->
</dd>
<dd class="lastpost" style="padding:5px; width:35%;">
<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:30%;"><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>
<dd class="lastpost" style="padding:5px; width:15%; float:right;">
<object width="120" height="120" border="0" align="left" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://xiradorn.it/forum/images/clock21.swf" name="movie">
<param value="High" name="quality"> <param value="#003300" name="bgcolor">
<param value="transparent" name="wmode">
<param value="false" name="menu">
<embed width="120" height="120" menu="false" wmode="transparent" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#003300" quality="High" src="http://xiradorn.it/forum/images/clock21.swf">
</object>
</dd>
</dl>
</li>
<li class="row">
<dl>
<dd style="width: 23%; padding: 5px; margin-top: -20px;">
<!-- IF .topicvisto -->
<h3>Topic più visti</h3>
<!-- BEGIN topicvisto -->• <b><a href="{topicvisto.LINK}">{topicvisto.TITOLO}</a></b> - [{topicvisto.VIEWS}]<br /><!-- END topicvisto -->
<!-- ENDIF -->
</dd>
<dd style="width: 23%; padding: 5px; margin-top: -20px;">
<!-- IF .lastusertopic -->
<h3>Ultimi Topic Utente</h3>
<!-- BEGIN lastusertopic -->• <b><a href="{lastusertopic.LASTUSERTOPIC_LINK}">{lastusertopic.LASTUSERTOPIC_TITOLO}</a></b><br />» {lastusertopic.LASTUSERTOPIC_TIME}<br /><!-- END lastusertopic -->
<!-- ENDIF -->
</dd>
<dd style="width: 23%; padding: 5px; margin-top: -20px;">
<!-- IF .lasttopic -->
<h3>Ultimi Topic</h3>
<!-- BEGIN lasttopic -->• <b><a href="{lasttopic.LASTTOPIC_LINK}">{lasttopic.LASTTOPIC_TITOLO}</a></b><br /><!-- END lasttopic -->
<!-- ENDIF -->
</dd>
<dd style="width: 23%; padding: 5px; margin-top: -20px;">
<!-- IF .topposter -->
<h3>Top Posters</h3>
<p><!-- BEGIN topposter --><img src="{T_THEME_PATH}/images/icon_members.gif" width="16" height="14" /> <b>{topposter.TOPPOSTER}</b> [{topposter.TOPPOSTER_NUM}]<br /><!-- END topposter --></p>
<!-- ENDIF -->
</dd>
<dd style="width: 23%; padding: 5px; margin-top: -20px;">
<!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH -->
<div id="search-box">
<form action="{U_SEARCH}" method="post" id="search">
<fieldset>
<input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
<input class="button2" value="{L_SEARCH}" type="submit" /><br />
<a href="{U_SEARCH}" style="color: #105289;" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_SEARCH_HIDDEN_FIELDS}
</fieldset>
</form>
</div>
<!-- ENDIF -->
</dd>
</dl>
<dl style="padding: 5px;"><div style="text-align: center; border-top: 1px dashed; padding: 2px;">Xiradorn Lab © - <a href="http:\\xiradorn.it">xiradorn.it</a></div>
</li>
</ul>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<!-- Wellcome_mod -->
Salvare i file modificati, caricarli, eliminare le cache e aggiornare il modello. Fatto!
Demo: Qui