phpBB Italia chiude!
phpBB Italia ringrazia tutti gli utenti che hanno dato fiducia al nostro progetto per ben 9 anni, e che, grazie al grande lavoro fatto da tutto lo Staff (rigorosamente a titolo gratuito), hanno portato il portale a diventare il principale punto di riferimento italiano alla piattaforma phpBB.

Purtroppo, causa motivi personali, non ho più modo di gestirlo e portarlo avanti. Il forum viene ora posto in uno stato di sola lettura, nonché un archivio storico per permettere a chiunque di fruire di tutte le discussioni trattate.

Il nuovo portale di assistenza per l'Italia di phpBB diventa phpBB-Store.it, cui ringrazio per aver deciso di portare avanti questo grande progetto.

Grazie ancora,
Carlo - Amministratore di phpBB Italia

Welcome on index Mod [Semplice]

Personalizzazioni del codice, guide su MOD.
Avatar utente
NintendoEvoClan
Utente
Utente
Messaggi: 68
Iscritto il: 11/08/2011, 2:17
Sesso: Maschio
Versione: 3.0.8
Server: UNIX/Linux
PHP: PHP 5.2.17
Database: MySQL(i) 5.1.49-community-log
Località: Pordenone
Contatta:

Welcome on index Mod [Semplice]

Messaggio da NintendoEvoClan » 07/12/2011, 23:41

Ho recuperato questa Modifica realizzata a suo tempo da Sir Xiradorn che permette di visualizzare un pannello di benvenuto nell'indice.

Link Mod: http://www.phpbb.com/community/viewtopi ... &t=2101603

Cominciamo:

1) Apri /index.php
Trova:

Codice: Seleziona tutto

// Assign index specific vars
Aggiungi prima:

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 . '&nbsp;' . $user->lang['WELCOME_YEARS'] . ', ') : ($years . '&nbsp;' . $user->lang['WELCOME_YEAR'] . ', ');
        }
        $months = floor($member_length / 2628000);
        if ($months)
        {
            $months = $months > 1 ? ($months . '&nbsp;' . $user->lang['WELCOME_MONTHS'] . ', ') : ($months . '&nbsp;' . $user->lang['WELCOME_MONTHS'] . ', ');
            $member_length = $member_length - ($months * 2628000);
            $member_for .= $months;
        }
        $days = floor($member_length / 86400);
        if ($days)
        {
            $days = $days > 1 ? ($days . '&nbsp;' . $user->lang['WELCOME_DAYS']) : ($days . '&nbsp;' . $user->lang['WELCOME_DAY']);
            $member_for .= $days;
        }       
    }
}
//END Welcome Mod
Trova:

Codice: Seleziona tutto

	'LEGEND'		=> $legend,
Aggiungi prima:

Codice: Seleziona tutto

	// BEGIN Welcome Mod   
    'S_WELCOME'                   => $s_welcome,
    'S_JOINED_DATE'               => $user->lang['JOINED'] . ':&nbsp;' . $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'] . '&nbsp;' . $member_for : '',
   	// END Welcome Mod 
Apri: language/en/common.php
Trova:

Codice: Seleziona tutto

?>
Aggiungi prima:

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
Apri: language/it/common.php
Trova:

Codice: Seleziona tutto

?>
Aggiungi prima:

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
Apri: styles/prosilver/template/index_body.html

Trova:

Codice: Seleziona tutto

<!-- INCLUDE overall_header.html -->
Aggiungi dopo:

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} &bull; {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 -->
NB:
Salvare i file modificati, caricarli, eliminare le cache e aggiornare il modello.

Avatar utente
Barrnet
Leader Moderatori
Leader Moderatori
Messaggi: 3124
Iscritto il: 04/07/2010, 23:31
Sesso: Maschio
Versione: 3.0.10
Server: UNIX/Linux
PHP: 5.3.10
Database: MySQL 5.1.61-community-log
Contatta:

Re: Welcome on index Mod [Semplice]

Messaggio da Barrnet » 11/12/2011, 1:31

Tecnicamente non è sua, è una mod presente su phpbb.com, lui l'ha solamente tradotta...

Avatar utente
SuperPunkMario
Utente
Utente
Messaggi: 65
Iscritto il: 07/03/2011, 21:01
Sesso: Maschio
Versione: 3.0.9
Server: UNIX/Linux
PHP: 5.2.13
Database: MySQL 5.1.49-community-log
Contatta:

Re: Welcome on index Mod [Semplice]

Messaggio da SuperPunkMario » 11/12/2011, 10:13

il vero autore é stoker se non sbaglio....
Immagine

Avatar utente
Tiger
phpBB Expert
phpBB Expert
Messaggi: 1998
Iscritto il: 24/05/2011, 12:37
Sesso: Maschio
Versione: 3.0.12
Server: UNIX/Linux
PHP: 5.3.28
Database: MySQL(i) 5.5.35-cll
Località: Roma
Contatta:

Re: Welcome on index Mod [Semplice]

Messaggio da Tiger » 11/12/2011, 16:06

Si :)

sonimeta
Utente
Utente
Messaggi: 10
Iscritto il: 14/01/2012, 0:38
Sesso: Maschio
Versione: 3.0.10
Server: UNIX/Linux
PHP: 5.2.17
Database: MySQL(i) 5.1.49

Re: Welcome on index Mod [Semplice]

Messaggio da sonimeta » 15/01/2012, 2:45

bella mod

Avatar utente
Ares
Utente
Utente
Messaggi: 310
Iscritto il: 26/09/2011, 9:07
Sesso: Maschio
Versione: 3.1.7
Server: UNIX/Linux
PHP: 5.4
Database: MySQL 5.1.71-community-log
Località: Sicilia
Contatta:

Re: Welcome on index Mod [Semplice]

Messaggio da Ares » 15/01/2012, 14:15

Non funzione per phobb 3.0.10?

Avatar utente
Barrnet
Leader Moderatori
Leader Moderatori
Messaggi: 3124
Iscritto il: 04/07/2010, 23:31
Sesso: Maschio
Versione: 3.0.10
Server: UNIX/Linux
PHP: 5.3.10
Database: MySQL 5.1.61-community-log
Contatta:

Re: Welcome on index Mod [Semplice]

Messaggio da Barrnet » 15/01/2012, 14:28

No, funziona ^^

Avatar utente
Ares
Utente
Utente
Messaggi: 310
Iscritto il: 26/09/2011, 9:07
Sesso: Maschio
Versione: 3.1.7
Server: UNIX/Linux
PHP: 5.4
Database: MySQL 5.1.71-community-log
Località: Sicilia
Contatta:

Re: Welcome on index Mod [Semplice]

Messaggio da Ares » 15/01/2012, 14:50

Si Barrnet, hai ragione. Sbagliavo io con la fretta :D Grazie

cippirimerlo
Utente
Utente
Messaggi: 24
Iscritto il: 25/10/2011, 12:24
Sesso: Maschio
Versione: 3.0.10
Server: Windows
PHP: 5.2.17
Database: MySQL(i) 5.0.51a-24

Re: Welcome on index Mod [Semplice]

Messaggio da cippirimerlo » 18/01/2012, 11:40

Vi chiedo, umilmente, se qualcuno ha voglia di verificare... credo d' aver fatto le modifiche necessarie ( spero correttamente ) ma non accade nulla, al login ( utente moderatore, giusto per info ) non appare alcun messaggio di benvenuto.
Se ho sbagliato qualcosa, picchiatemi pure... :lol:

P.S. cache ripulita e template aggiornato da PCA
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
"Non è il critico che conta, ossia chi indica come l' uomo forte inciampi o come avrebbe potuto fare meglio.. il merito spetta a chi scende nell' arena" ( Theodore Roosevelt )

Avatar utente
Ares
Utente
Utente
Messaggi: 310
Iscritto il: 26/09/2011, 9:07
Sesso: Maschio
Versione: 3.1.7
Server: UNIX/Linux
PHP: 5.4
Database: MySQL 5.1.71-community-log
Località: Sicilia
Contatta:

Re: Welcome on index Mod [Semplice]

Messaggio da Ares » 18/01/2012, 11:51

Controlla che nell'index.php hai immesso la stringa due volte.
Hai questo duplicato

Codice: Seleziona tutto

   // BEGIN Welcome Mod   
    'S_WELCOME'                   => $s_welcome,
    'S_JOINED_DATE'               => $user->lang['JOINED'] . ':&nbsp;' . $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'] . '&nbsp;' . $member_for : '',
      // END Welcome Mod
Per il resto sembra ok, ma un link al sito?

Bloccato

Torna a “Personalizzazioni”

Chi c’è in linea

Visitano il forum: Nessuno e 3 ospiti