Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Number Of Online Users In Chat In The Top Menu 
 
Hello friends.

I have included in the menu, a link to the chat.

But I want to add the number of users connected to it.

Left images I have, and what I do.

menu

chat

ejemplo

Someone can give me a hand??

Sorry for mi English, translated with Google.




Hola amigos.

He incluido en el menú, un enlace al chat.

Pero quiero agregar la cantidad de usuarios conectados en este.

Dejo imágenes con lo que tengo, y lo que quiero hacer.

Alguien me puede dar una mano ¿?

Perdón por mi ingles, traducido con Google
 



 
AerosmithSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Number Of Online Users In Chat In The Top Menu 
 
Try to have a look at the beginning of this file: includes/users_online_block.php

Code: [Download] [Hide] [Select]
if (defined('SHOW_ONLINE_CHAT') && $board_config['show_chat_online'])
{
    //$template->assign_block_vars('switch_ac_online', array());
    include_once(IP_ROOT_PATH . 'includes/functions_ajax_chat.' . PHP_EXT);
    $sql = "SELECT u.user_id, u.username, u.user_active, u.user_color, u.user_level
    FROM " . AJAX_SHOUTBOX_SESSIONS_TABLE . " s, " . USERS_TABLE . " u
    WHERE s.session_time >= " . (time() - SESSION_REFRESH) . "
    AND s.session_user_id = u.user_id
    ORDER BY case user_level when 0 then 10 else user_level end";
    $result = $db->sql_query($sql);

    // Set all counters to 0
    $ac_reg_online_counter = $ac_guest_online_counter = $ac_online_counter = 0;
    $ac_username_lists = '';
    while($ac_online = $db->sql_fetchrow($result))
    {
        if($ac_online['user_id'] != ANONYMOUS)
        {
            $ac_username_lists .= (($ac_username_lists == '') ? '' : ', ') . colorize_username($ac_online['user_id'], $ac_online['username'], $ac_online['user_color'], $ac_online['user_active']);
            $ac_reg_online_counter++;
        }
        else
        {
            $ac_guest_online_counter++;
        }
        $ac_online_counter++;
    }
    $ac_username_lists = ($ac_username_lists == '') ? '' : ('[ ' . $ac_username_lists . ' ]');

    $ac_t_user = ($ac_online_counter == 0) ? $lang['AC_Online_users_zero_total'] : (($ac_online_counter == 1) ? $lang['AC_Online_user_total'] : (sprintf($lang['AC_Online_users_total'], $ac_online_counter)));
    $ac_r_user = ($ac_reg_online_counter == 0) ? $lang['Reg_users_zero_total'] : (($ac_reg_online_counter == 1) ? (sprintf($lang['Reg_user_total'], $ac_reg_online_counter)) : (sprintf($lang['Reg_users_total'], $ac_reg_online_counter)));
    $ac_g_user = ($ac_guest_online_counter == 0) ? $lang['Guest_users_zero_total'] : (($ac_guest_online_counter == 0) ? (sprintf($lang['Guest_user_total'], $ac_guest_online_counter)) : (sprintf($lang['Guest_users_total'], $ac_guest_online_counter)));
    $ac_online_text = $ac_t_user . $ac_r_user . $ac_g_user;
}


Plus something like this:
Code: [Download] [Hide] [Select]
            'AC_LIST_TEXT' => $ac_online_text,
            'AC_LIST' => $ac_username_lists,


I'll let you discover where you have to put the code...  
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Number Of Online Users In Chat In The Top Menu 
 
Hi MG.

Thanks for responding.

Not if I explain well, or do not understand what you say.

I know this is the code where I draw the value.

But ....

The problem is I need the code value $ ac_r_user.

What is the number of users in the chat.

If I put AC_LIST_TEXT {}, will all the text with three numbers.

If I put {} will AC_LIST names.

My problem is.

Get the value of $ ac_r_user, and place it on the menu between parentheses

Thanks in advance.




Hola MG.

Gracias por responder.

No se si me explique bien, o no entiendo lo que me dices.

Se que ese es el código de donde debo extraer el valor.

Pero....

El problema, es que yo necesito el valor del código $ac_r_user.

Que es la cantidad de usuarios en el chat.

SI coloco {AC_LIST_TEXT}, saldrá todo el texto con los tres números.

Si coloco {AC_LIST} saldrá los nombres.

Mi problema es.

Obtener el valor de $ ac_r_user, y colocarlo en el menú entre un paréntesis

Gracias de antemano.
 



 
AerosmithSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Number Of Online Users In Chat In The Top Menu 
 
hm

I think, that you should use these 3 values
Code: [Download] [Hide]
  1. $ac_reg_online_counter = $ac_guest_online_counter = $ac_online_counter = 0; 


and create 3 lang vars with them. example
Code: [Download] [Hide]
  1. 'CHAT_REG_TEXT' =>  $ac_reg_online_counter, 
  2. 'CHAT_GUEST_TEXT' => $ac_guest_online_counter, 
  3. 'CHAT_ONLINE_TEXT' => $ac_online_counter, 

and use this lang vars in your menu.

and if i understand the code right, you only need this one $ac_online_counter
it should be the one, that gives the total amount off users in the chat


well, at leased, thats how i understand the problem

Correct me , if i´m wrong MG
 




____________
Out of Order
 
spydieSend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events