[PHPBB] Lista utenti in stile Wordgraph
Giovanni
| Argomenti: phpbb, wordgraph, mod | 6524
Questa mod al forum PhpBB, in puro stile web 2.0, permette di creare una lista utenti in stile Wordgraph, ossia una lista degli utenti in cui i link a coloro che hanno postato di più appaiono più grandi.
La mod è veramente semplice da installare. Si tratta semplicemente di sostituire il file memberlist.php (nella home del forum) con questo di seguito (si può fare copia e incolla direttamente su memberlist.php, dopo averne cancellato il contenuto).
Notare che con questa mod vengono visualizzati solo gli utenti che hanno al loro attivo almeno un post. Inoltre siccome visualizza tutti gli utenti con almeno un post in un’unica pagina questa mod è indicata per forum phpbb con meno di mille utenti attivi.
La mod la potete vedere in azione qui: lista utenti di Taxi-Driver.
Ricordatevi di salvare il vecchio file memberlist.php.
<?php /******************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ********************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; incmµçVFR‚G‡&%÷&ö÷E÷F‚âvW‡FVç6–öâæ–æ2r“°Ð¦–æ6ÇVFR‚G‡&%÷&ö÷E÷F‚âv6öÖÖöâârâG‡W‚“°Ð ТòðТòò7F'B6W76–öâÖævVÖVç@ТòðТGW6W&FFÒ6W76–öå÷vW7F'B‚GW6W%ö—ÂtUõd”UtÔTÔ$U%2“°Ð¦–æ—E÷W6W'&Vg2‚GW6W&FF“°Ð¢òðТòòVæB6W76–öâÖævVÖVç@ТòðРРТòðТòòvVæW&FRvPТòðТGvU÷F—FÆRÒFÆæu²tÖVÖ&W&Æ—7BuӰЦ–æ6Û^ude($phpbb_root_path . 'includes/page_header.'.$phpEx); // // OBTAIN RANKS INFORMATION // $sql = "SELECT * FROM " . RANKS_TABLE . " WHERE !rank_special AND rank_min > 0 ORDER BY rank_min DESC"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql); } $levels = array(); $indLevels = 8; while ( $row = $db->sql_fetchrow($result) ) { $levels[$indLevels] = $row; $indLevels -= 2; } $db->sql_freeresult($result); // // QUERY USERS // $sql = "SELECT username, user_id, user_posts FROM phpbb_users WHERE user_posts > 0 AND user_active ORDER BY username"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { do { foreach ($levels AS $fontSize => $level) { if ($row['user_posts'] >= $level['rank_min']) break; } $indirizzo = append_sid("profile.php?mode=viewprofile&u=" . $row['user_id']); if ($fontSize == 0) echo "<a href='$indirizzo'>" . $row['username'] . "</a> n"; else echo "<font size=$fontSize><a href='$indirizzo'>" . $row['username'] . "</a> </font>n"; } while ( $row = $db->sql_fetchrow($result) ); $db->sql_freeresult($result); } incmµçVFR‚G‡&%÷&ö÷E÷F‚âv–æ6ÇVFW2÷vU÷F–ÂârâG‡W‚“°Ð УóàÐ
Nota importante: Questa mod utilizza i livelli di phpbb presumendo di avere 6 livelli prestabiliti. In base ai livelli visualizza i link più grandi o più piccoli.
Se avete più di 6 livelli (l’ideale è averne 10-12) dovete semplicemente sostituire la linea:
$indLevels -= 2;
Con:
$indLevels --;
Pubblicato in Integrare PHPBB |