The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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 in the attached images, 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?
Here's how I have it set up: includes/functions.php Code:
function render_navbar_template($navbits) { global $vbulletin, $vbphrase; $vbphrase['chatcount'] = count(getChatOnlineUserIDs()); [...] Code:
<li class="selected"><a class="navtab" href="http://[site].com/chat/" target="_blank">Chat [{vb:rawphrase chatcount}]</a> [...] 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(); } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|