Es que he utilizado el código de ese mismo MOD, pero haciendo la llamada a una función que incluye ese código desde el memberlis.php.
Hay crear un nuevo campo en la tabla phpbb_users:
EJECUTAR LA CONSULTA
Código: Seleccionar todo
ALTER TABLE `phpbb_users` ADD `post_mes` INT( 4 ) NOT NULL ;
La función va en inculdes/functions.php y es esta:
BUSCAR
AÑADIR ANTES
Código: Seleccionar todo
function post_ultimo_mes(){
global $db;
$current_time = time();
$this_months_posts = 0;
$year = date('Y', $current_time);
$month [0] = mktime (0,0,0,1,1, $year);
$month [1] = $month [0] + 2678400;
$month [2] = mktime (0,0,0,3,1, $year);
$month [3] = $month [2] + 2678400;
$month [4] = $month [3] + 2592000;
$month [5] = $month [4] + 2678400;
$month [6] = $month [5] + 2592000;
$month [7] = $month [6] + 2678400;
$month [8] = $month [7] + 2678400;
$month [9] = $month [8] + 2592000;
$month [10] = $month [9] + 2678400;
$month [11] = $month [10] + 2592000;
$month [12] = $month [11] + 2592000;
$arr_num = ( date('n')-1 );
$time_thismonth = $month[$arr_num];
$sql=mysql_query("SELECT user_id
FROM " . USERS_TABLE ."
WHERE username != 'ANONYMOUS'
AND user_posts > 0 ");
while($rows=mysql_fetch_assoc($sql))
{
$sqla = "SELECT count(post_id) as monthly_posts
FROM " . POSTS_TABLE . "
WHERE poster_id = '". $rows['user_id'] . "'
AND post_time > '" . intval($time_thismonth) . "'";
if(! $result = $db->sql_query($sqla) )
{
message_die(GENERAL_ERROR, 'Could not obtain last months postcount.', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$this_months_posts = $row['monthly_posts'];
$db->sql_freeresult($result);
$actualiza= (" UPDATE " . USERS_TABLE . "
SET post_mes = ".$row['monthly_posts']."
WHERE user_id= '". $rows['user_id'] . "'
LIMIT 1 ") ;
if(! $actualizar = $db->sql_query($actualiza) )
{
message_die(GENERAL_ERROR, 'No actualiza.', '', __LINE__, __FILE__, $sql);
}
}
}
Modificar el memberlist.php:
BUSCAR:
Código: Seleccionar todo
$select_sort_mode .= '<option value="' . $mode_types[$i] . '"' . $selected . '>' . $mode_types_text[$i] . '</option>';
}
AÑADIR DESPUES:
Código: Seleccionar todo
$select_sort_mode .='<option value="Posts_month"' . $selected . '>Mensajes este mes</option>';
BUSCAR:
Código: Seleccionar todo
$order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page'];
break;
AÑADIR DESPUES:
Código: Seleccionar todo
case 'Posts_month':
$order_by = " post_mes $sort_order LIMIT $start, " . $board_config['topics_per_page'];
break;
BUSCAR:
Código: Seleccionar todo
$sql = "SELECT username, user_absence, user_absence_mode, user_id
FROM " . USERS_TABLE .
AÑADIR ANTES
AÑADIR EN LA LINEA DESPUES DE username
BUSCAR
AÑADIR DESPUES
BUSCAR:
AÑADIR DESPUES
Ahora en el template ya teneis que experimentar un poco porque yo utilizo el plus y tengo la seguridad donde quedaría perfecto esto:
BUSCAR
Código: Seleccionar todo
<td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.WWW_IMG} </td>
AÑDIR DEPUES (o donde veas oportuno)
Código: Seleccionar todo
<td class="{memberrow.ROW_CLASS}" align="center"> {memberrow.ULTIMO_MES} </td>
Posiblemente tengas que hacer alguna modificación en el span col de la tabla para que esta no se deforme.
Saludos