Quote:
Originally Posted by dendrob
Hm...how could I display the number of users right in the menu ??? say something like this: "vbChat (6)". Some users don't scroll down to the stats to see who's in the chat, this way they would see it right in the navbar. Any help would be appreciated!
If there would be no users in the chat "vbChat (0)" or just "vbChat" would be great. I'm using the ported chat on 3.5
|
You could do the following:
Open forum/index.php, find
PHP Code:
// Configure Peeps In vBChat
$invBChat = "";
if(is_array($vbchat_users)){
foreach($vbchat_users as $invbc){
if($invBChat == ""){
$extra = "";
} else {
$extra = ", ";
}
// Get Username Style
$invbc['musername'] = fetch_musername($invbc);
$invBChat .= "{$extra}<a href='member.php?{$session['sessionurl']}&u={$invbc['userid']}'>{$invbc['musername']}</a>";
}
}
if($invBChat == ""){
$invBChat = "<i>No one is currently inside Chat</i>";
}
Replace with:
PHP Code:
// Configure Peeps In vBChat
$invBChat = '';
$num_in_chat = 0;
if (is_array($vbchat_users))
{
foreach ($vbchat_users AS $invbc)
{
if ($invBChat == '')
{
$extra = '';
}
else
{
$extra = ', ';
}
// Get Username Style
$invbc['musername'] = fetch_musername($invbc);
$invBChat .= "{$extra}<a href='member.php?{$session['sessionurl']}&u={$invbc['userid']}'>{$invbc['musername']}</a>";
$num_in_chat++;
}
}
if($invBChat == '')
{
$invBChat = '<i>No one is currently inside Chat</i>';
}
Admin CP -> Styles & Templates -> Style Manager -> Edit Templates -> Expand All Templates
Open the 'navbar' template, find:
HTML Code:
<td class="vbmenu_control"><a href="chat.php$session[sessionurl_q]" onclick="return OpenvBChat();">vBChat</a></td>
Replace with:
HTML Code:
<td class="vbmenu_control"><a href="chat.php$session[sessionurl_q]" onclick="return OpenvBChat();">vBChat</a> ({$num_in_chat})</td>
That seems to do it, tested it on mine and works fine