![]() |
CMS vbphrase works in forum&blog navbar but not CMS navbar...? Hello. I use Blueimp's AJAX Chat and a modified navbar to display the number of people in the chatroom. As you can see, the count displays fine when I am in Forums or Blogs, but when I am in the CMS it doesn't display (showing just "Chat []" instead of "Chat [1]"). Can anyone help me figure out why? Attachment 40982Attachment 40981 Here's how I have it set up: includes/functions.php Code: function render_navbar_template($navbits) { global $vbulletin, $vbphrase; $vbphrase['chatcount'] = count(getChatOnlineUserIDs()); [...] Then in my style template for 'navbar': Code: Chat [{vb:rawphrase chatcount}] [...] And I don't think it matters, but here are the chat functions I define in functions.php immediately preceding the render_navbar_template function above: Code: function getChatInterface() { static $ajaxChat; // Path to the chat directory: if (!defined('AJAX_CHAT_PATH')) { if (empty($_SERVER['SCRIPT_FILENAME'])) { $_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'].$_SERVER['SCRIPT_URL']; } define('AJAX_CHAT_PATH', realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/chat').'/'); } // Include Class libraries: require_once(AJAX_CHAT_PATH.'lib/classes.php'); // Initialize the chat interface: $ajaxChat = new CustomAJAXChatInterface(); return $ajaxChat; } function getChatOnlineUsers() { $chatInterface = getChatInterface(); if($chatInterface) { // Clean out any users who didn't log out properly by calling removeInactive() // Not necessary but a good idea. You can take out this line if you want. $chatInterface->removeInactive(); // Now get the online users: return $chatInterface->getOnlineUsers(); } else { return array(); } } function getChatOnlineUserIDs() { return ($chatInterface = getChatInterface()) ? $chatInterface->getOnlineUserIDs() : array(); } So I'm stumped on how to get this to display properly in the CMS navbar. Any help would be much appreciated! :D Attached Images
|
الساعة الآن 10:23 AM |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By
Almuhajir