escludere gruppo moderatori da tpotm (top poster del mese)
Inviato: 23/06/2012, 17:41
Salve ragazzi...
Ho dato un'occhiata, anche sul .com, ma non ho trovato niente...
Uso questa semplicissima mod (Top Poster Of The Month 1.0.7 rc7 italiano), per far comparire sotto le statistiche, l'utente che abbia effettuato più post nel mese. Unico gruppo attualmente escluso è soltanto quello dei fondatori.
Vorrei escludere, anche il gruppo dei moderatori (creato da me con la denominazione "moderatori" ).
La mod gira intorno ad un unico file include e due file da modificare (root/index.php,
e styles/prosilver/template/index_body.html) semplicemente inserendo proprio questo file include.
Al 99,9% penso che basti una piccolissima modifica su questo file, ma non ho idea di come.
Se qualcuno sapesse aiutarmi, questo è il contenuto del file, root/includes/functions_tpotm
Da quel che ho capito (credo), l'esclusione del gruppo founder si trova alla riga 43.
Per facilitarvi, la ricerca, allego anche i file della mod (meno di 60 kb)
Ho dato un'occhiata, anche sul .com, ma non ho trovato niente...
Uso questa semplicissima mod (Top Poster Of The Month 1.0.7 rc7 italiano), per far comparire sotto le statistiche, l'utente che abbia effettuato più post nel mese. Unico gruppo attualmente escluso è soltanto quello dei fondatori.
Vorrei escludere, anche il gruppo dei moderatori (creato da me con la denominazione "moderatori" ).
La mod gira intorno ad un unico file include e due file da modificare (root/index.php,
e styles/prosilver/template/index_body.html) semplicemente inserendo proprio questo file include.
Al 99,9% penso che basti una piccolissima modifica su questo file, ma non ho idea di come.
Se qualcuno sapesse aiutarmi, questo è il contenuto del file, root/includes/functions_tpotm
Da quel che ho capito (credo), l'esclusione del gruppo founder si trova alla riga 43.
Codice: Seleziona tutto
<?php
/**
*
* @package phpBB3
* @version $Id: tpotm.php,v 1.0.1 2009/01/12 11:31:00 EST 3DiExp $
* @copyright (c) Rich McGirr
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Include only once.
*/
if (!function_exists('tpotm_set_template_vars'))
{
function tpotm_set_template_vars()
{
global $db, $template, $user;
$user->add_lang('mods/tpotm');
$now = time();
$date_today = gmdate("Y-m-d", $now);
list($year_cur, $month_cur, $day1) = split('-', $date_today);
// Start time for current month
$month_start_cur = gmmktime (0,0,0, $month_cur, 1, $year_cur);
$month_start = $month_start_cur;
$month_end = $now;
$sql = 'SELECT u.username, u.user_id, u.user_colour, COUNT(p.post_id) AS total_posts
FROM ' . USERS_TABLE . ' u, ' . POSTS_TABLE . ' p
WHERE u.user_id > ' . ANONYMOUS . '
AND u.user_id = p.poster_id
AND p.post_time BETWEEN ' . $month_start . ' AND ' . $month_end . '
AND (u.user_type <> ' . USER_FOUNDER . ')
GROUP BY u.user_id
ORDER BY total_posts DESC';
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// let's go then
// posts made into the selected elapsed time
$topm_tp = $row['total_posts'];
$topm_un = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
// there is not a Top Poster, usually happens on fresh phpBB3 install where only FOUNDERS have posted.
// here TOPM_UN reflects this state.
$template->assign_vars(array(
'TOPM_UN' => ($topm_tp < 1) ? $topm_un = $user->lang['TOP_USERNAME_NONE'] : $topm_un,
'L_TPOTM' => $user->lang['TOP_CAT'],
'L_TOPM_UNA_L' => $user->lang['TOP_USERNAME'],
'L_TOPM_UPO_L' => sprintf($user->lang['TOP_USER_MONTH_POSTS'], $topm_tp),
'L_TOPM_POSTS_L' => ($topm_tp > 1 || $topm_tp == 0 ) ? $user->lang['TOP_POSTS'] : $user->lang['TOP_POST'],
));
}
}
?>