users in last online 24 hours for mx_chatbox
 
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_chatbox
View previous topic :: View next topic  
Author Message
Francisco
Starter
Starter


Joined: 29 Dec 2004
Posts: 3

PostPosted: Wed Jun 15, 2005 12:34 pm    Post subject: users in last online 24 hours for mx_chatbox Reply with quote

Mod adapted users in last online 24 hours for mx_chatbox in Spanish

Code:
########################################################
##
## MOD Titulo:   Usuarios del dia
## MOD Version:  2.0
## Autor:        ZoZo <zozo@etoiles.net>
## Modificado para mxBB Portal:  F.Perete
## Descripción: 
## Despliega, debajo de la lista de usuarios en linea, una relación de usuarios
## que han venido al foro durante las ultimas XX horas. También puede mostrar la lista de
## los usuarios que no lo han visitado. (Ver "Edit below")
##
## Traduccion: cHoLk - http://www.elkuren.org/
##
## Nivel de Instalación:  Facil
## Tiempo de Instalción:  2-3 minutos
##
## Archivos a Editar en mx y phpBB:         4
##           - /modules/mx_chatbox/chatbox_online..php //mx
##                   - /modules/mx_chatbox/templates/chatbox_online.tpl //mx
##                   - /language/lang_spanish/lang_main.php    //phpBB
##                   - /includes/page_header.php               //mx   
##
## Archivos Incluidos:      Ninguno
##
########################################################
## HISTORIA REVISION:
##
## 14 DE JUNIO 2005: v2.0
## 1. The list's delay is customizable, but you must give a number in hours, 24 by default.
## 2. There's now a counter for each list.
## 3. The MOD doesn't display the list of the users who didn't visit by default.
##
## October 28th 2002: v1.1
## 1. The MOD uses the database variable "user_session_time" instead of "user_lastvisit", which is updated only when the user logs out.
## 
## October 15th 2002: v1.0
## 1. Created main features.
##   
########################################################
## TODO LIST:
##
## 1. Don't restrict the time unit to hours.
##
########################################################
##        PLEASE REPORT ANY BUGS OR SUGGESTIONS       ##
########################################################

#
#-----[ ACCION: abrir ]---------------------------------
#
mx/modules/mx_chatbox/chatbox_online.php

#
#-----[ ACCION: Encontrar ]---------------------------------
#

   'LOGGED_IN_USER_LIST' => $online_userlist,
   
#
#-----[ ACCION: agregar despues ]---------------------------
#
   'USERS_OF_THE_DAY_LIST' => $day_userlist,

#
#-----[ ACCION: abrir ]---------------------------------
#
mx/modules/mx_chatbox/templates/chatbox_online.tpl

#
#-----[ ACCION: Encontrar ]---------------------------------
#
   <!-- CLOSE: Who's Online Block -->

#
#-----[ ACCION: AÑADIR ANTES ]---------------------------
#
  <tr>
   <td class="row1" align="center"><img src="../foro/images/dl_green.gif" alt="Conectados en 24 Horas" border="0"></td>
   <td class="row1" align="left"><img src="../foro/images/dotf.gif" width="5" height="5">&nbsp;<span class="genmed">{USERS_OF_THE_DAY_LIST}</span></td>

   </tr>


#
#-----[ ACCION: repetir para todos los templates ]-------------
#

#
#-----[ ACCION: abrir ]--------------------------------
#
phpBB/language/lang_spanish/lang_main.php

#
#-----[ ACCION: abrir ]--------------------------------
#
$lang['Registered_users'] =

#
#-----[ ACCION: agregar antes ]--------------------------
#
$lang['Day_users'] = '%d Usuarios registrados ha visitado el foro durante las ultimas %d horas:';
$lang['Not_day_users'] = '%d usuarios registrados <span style="color:red">No han</span> visitadop el foro durante las ultimas %d horas:';

#
#-----[ ACCION: repetir para todos los lenguajes ]------------
#

#
#-----[ ACCION: abrir ]--------------------------------
#
mx/includes/page_header.php

#
#-----[ ACCION: encontrar ]--------------------------------
#
   'LOGGED_IN_USER_LIST' => $online_userlist,

#
#-----[ ACCION: agregar despues ]---------------------------
#
   'USERS_OF_THE_DAY_LIST' => $day_userlist,

#
#-----[ ACCION: encontrar ]--------------------------------
#
//
// Obtain number of new private messages
// if user is logged in
//

#
#-----[ ACCION: antes agregar ]--------------------------
#
//
// Users of the day MOD
//

// ############ Edit below ############
// #
$display_not_day_userlist = 0;   // aqui cambiar a 1 si quieres que se muestre la lista de los usuarios que no han visitado el foro
$users_list_delay = 24;      // aqui cambiar el numero de horas que se quiere en la lista
// #
// ############ Edit above ############

$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
   FROM ".USERS_TABLE."
   WHERE user_id > 0
   ORDER BY IF(user_level=1,3,user_level) DESC, username ASC";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql);
}

$day_userlist = '';
$day_users = 0;
$not_day_userlist = '';
$not_day_users = 0;

while( $row = $db->sql_fetchrow($result) )
{
   $style_color = '';
   if ( $row['user_level'] == ADMIN )
   {
      $row['username'] = '<b>' . $row['username'] . '</b>';
      $style_color = 'style="color:#' . $theme['fontcolor5'] . '"';
   }
   else if ( $row['user_level'] == MOD )
   {
      $row['username'] = '<b>' . $row['username'] . '</b>';
      $style_color = 'style="color:#' . $theme['fontcolor6'] . '"';
   }
   if ( $row['user_allow_viewonline'] )
   {
      $user_day_link = '<a href="' . append_sid(PHPBB_URL."profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
   }
   else
   {
      $user_day_link = '<a href="' . append_sid(PHPBB_URL."profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
   }
   if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
   {
      if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
      {
         $day_userlist .= ( $day_userlist != '' ) ? '<br /> ' . $user_day_link : $user_day_link;
         $day_users++;
      }
      else
      {
         $not_day_userlist .= ( $not_day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
         $not_day_users++;
      }
   }
}

$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . ' ' . $day_userlist;

$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . ' ' . $not_day_userlist;

if ( $display_not_day_userlist )
{
   $day_userlist .= '<br />' . $not_day_userlist;
}

//
// End of MOD
//
#
#-----[ ACCION: salvar/guardar todos ]----------------------
#
#
#-----[ ACCION: subir los archivos modificados ]-----------
#
#
#-----[ ACCION: enjoy ]-------------------------------
#
#
#-----[ PLEASE REPORT ANY BUGS OR SUGGESTIONS]--------
#


Pardon by not putting it in English, they could translate to English Embarassed
 
Back to top
View user's profile Send private message
=cipher=



Joined: 18 Feb 2005
Posts: 11
Location: My Computer

PostPosted: Wed Jun 15, 2005 3:26 pm    Post subject: Re: users in last online 24 hours for mx_chatbox Reply with quote

Greetings,

Very nice adaption. Im going to add it to my new website that I am designing for The Tech Base. Very Happy

 
 
_________________
Best Regards:
Aaron McGowan (=cipher=)
 
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_chatbox All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum