Descrizione MOD: modifica la Lista degli "iscritti" con aggiunta di due campi: la data dell'ultimo intervento effettuato dall'utente e la data di ultima visita compreso il numero dei giorni dall'ultimo accesso o intervento, in rosso per un numero di giorni superiore a 60, in verde se inferiore.
Rispetto alla versione precedente è stata eliminata la visualizzazione dello Style usato dall'utente.
Demo: non disponibile in quanto l'elenco degli utenti non è visibile ai non iscritti.
Cronologia:
- 13/01/2010 - Iniziato sviluppo della MOD.
- 15/01/2010 - Inserita modifica template per style "prosilver"
- 17/02/2010 - Inseriti i links "sort" alle colonne "Ultimo post" e "ultima visita"
- 12/03/2010 - Inserito il totale dei giorni dall'ultimo intervento a fianco della data "Ultimo post" e "ultima visita". Eliminata la funzione di ricerca dello Style utilizzato.
Versioni phpBB compatibili: 3.0.x
File da modificare:
1) memberlist.php
2) language/it/memberlist.php
3) styles/.../template/memberlist_body.html
1) Apri: memberlist.php
Trova:
Codice: Seleziona tutto
if ($auth->acl_get('u_viewonline'))
{
$sort_key_text['l'] = $user->lang['SORT_LAST_ACTIVE'];
$sort_key_sql['l'] = 'u.user_lastvisit';
Codice: Seleziona tutto
$sort_key_text['v'] = $user->lang['SORT_LASTPOST'];
$sort_key_sql['v'] = 'u.user_lastpost_time';
Codice: Seleziona tutto
'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '',
Aggiungi:
Codice: Seleziona tutto
'U_SORT_LASTPOST' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&sk=v&sd=' . (($sort_key == 'v' && $sort_dir == 'a') ? 'd' : 'a') : '',
Trova:
Codice: Seleziona tutto
// Dump it out to the template
return array(
'AGE' => $age,
'RANK_TITLE' => $rank_title,
'JOINED' => $user->format_date($data['user_regdate']),
'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit),
Codice: Seleziona tutto
'LASTPOST' => (empty($data['user_lastpost_time'])) ? ' - ' : $user->format_date($data['user_lastpost_time']),
'VISITED_DAYS' => (empty($data['user_lastvisit'])) ? ' - ' : floor((time() - $data['user_lastvisit']) / 86400) ,
'LASTPOST_DAYS' => (empty($data['user_lastpost_time'])) ? ' - ' : floor((time() - $data['user_lastpost_time']) / 86400) ,
La variabile VISITED (data ultima visita) è già presente nell'array anche se non visualizzata nella Lista utenti.
2) Apri: language/it/memberlist.php
Trova:
Codice: Seleziona tutto
'LAST_ACTIVE' => 'Ultima azione',
Codice: Seleziona tutto
'LASTPOST' => 'Ultimo messaggio',
'LASTVISIT' => 'Ultima visita',
3) Apri:styles/subsilver2/template/memberlist_body.html
Trova la porzione di codice:
Codice: Seleziona tutto
<tr>
<th nowrap="nowrap">#</th>
<th nowrap="nowrap" width="25%" align="{S_CONTENT_FLOW_BEGIN}"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th>
<th nowrap="nowrap" width="15%"><a href="{U_SORT_JOINED}">{L_JOINED}</a></th>
<th nowrap="nowrap" width="10%"><a href="{U_SORT_POSTS}">{L_POSTS}</a></th>
<th nowrap="nowrap" width="15%"><a href="{U_SORT_RANK}">{L_RANK}</a></th>
<th nowrap="nowrap" width="11%">{L_SEND_MESSAGE}</th>
<th nowrap="nowrap" width="11%"><a href="{U_SORT_EMAIL}">{L_EMAIL}</a></th>
<th nowrap="nowrap" width="11%"><a href="{U_SORT_WEBSITE}">{L_WEBSITE}</a></th>
Codice: Seleziona tutto
<tr>
<th nowrap="nowrap">#</th>
<th nowrap="nowrap" width="11%" align="{S_CONTENT_FLOW_BEGIN}"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th>
<th nowrap="nowrap" width="14%"><a href="{U_SORT_JOINED}">{L_JOINED}</a></th>
<th nowrap="nowrap" width="5%"><a href="{U_SORT_POSTS}">{L_POSTS}</a></th>
<th nowrap="nowrap" width="10%"><a href="{U_SORT_RANK}">{L_RANK}</a></th>
<th nowrap="nowrap" width="9%">{L_SEND_MESSAGE}</th>
<th nowrap="nowrap" width="9%"><a href="{U_SORT_EMAIL}">{L_EMAIL}</a></th>
<th nowrap="nowrap" width="9%"><a href="{U_SORT_WEBSITE}">{L_WEBSITE}</a></th>
<th nowrap="nowrap" width="14%"><a href="{U_SORT_ACTIVE}">{L_LASTVISIT}</a></th>
<th nowrap="nowrap" width="14%"><a href="{U_SORT_LASTPOST}">{L_LASTPOST}</a></th>
Trova la porzione di codice:
Codice: Seleziona tutto
<td class="gen" align="center"> {memberrow.ROW_NUMBER} </td>
<td class="genmed" align="{S_CONTENT_FLOW_BEGIN}">{memberrow.USERNAME_FULL}<!-- IF S_SELECT_SINGLE --> [ <a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a> ]<!-- ENDIF --></td>
<td class="genmed" align="center" nowrap="nowrap"> {memberrow.JOINED} </td>
<td class="gen" align="center">{memberrow.POSTS}</td>
<td class="gen" align="center"><!-- IF memberrow.RANK_IMG -->{memberrow.RANK_IMG}<!-- ELSE -->{memberrow.RANK_TITLE}<!-- ENDIF --></td>
<td class="gen" align="center"> <!-- IF memberrow.U_PM --><a href="{memberrow.U_PM}">{PM_IMG}</a><!-- ENDIF --> </td>
<td class="gen" align="center"> <!-- IF memberrow.U_EMAIL --><a href="{memberrow.U_EMAIL}">{EMAIL_IMG}</a><!-- ENDIF --> </td>
<td class="gen" align="center"> <!-- IF memberrow.U_WWW --><a href="{memberrow.U_WWW}">{WWW_IMG}</a><!-- ENDIF --> </td>
Codice: Seleziona tutto
<td class="gensmall" style="text-align: center;">{memberrow.ACTIVE} <span style="font-weight: bold;<!-- IF memberrow.VISITED_DAYS < '60' || memberrow.VISITED_DAYS == " - " -->color: green;<!-- ELSE -->color: red;<!-- ENDIF -->"><!-- IF memberrow.VISITED <> " - " --><br/>({memberrow.VISITED_DAYS} gg.)<!-- ENDIF --></span</td>
<td class="gensmall" style="text-align: center;">{memberrow.LASTPOST} <span style="font-weight: bold;<!-- IF memberrow.LASTPOST_DAYS < '60' || memberrow.LASTPOST_DAYS == " - " -->color: green;<!-- ELSE -->color: red;<!-- ENDIF -->"><!-- IF memberrow.LASTPOST <> " - " --><br/>({memberrow.LASTPOST_DAYS} gg.)<!-- ENDIF --></span> </td>
La modifica consente di aggiungere due colonne alla Lista degli iscritti: data Ultimo_post e data Ultima_visita e numero dei giorni da queste date.
Resta da completare il template "prosilver" che necessita di modifiche ai file css o la creazione di un css apposito per una corretta divisione della Lista.