The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
display script code in navgiation tab
I'd like to display total number of users in chat. The code is below.
<script language="javascript" src="somepath/connections.php"></script> I want to display it (float right) in the chat tab. The chat tab is created using the default navigation manger. See www.talkjesus.com So it says "chat" in the green tab", I want the displayed total users displayed on the right of it like this chad (space in middle) 10 10 = example of number of users in chat. My question now, how can I integrate that script code so it displays in the tab specifically? I'm using amend tabid to URL too. The ID is #tab_oda5_837 Thanks! |
#2
|
||||
|
||||
Just wondering if anyone can help?
|
#3
|
|||
|
|||
You should be able to edit the tab in the Navigation Manager and put your javascript code in the Title box, like maybe:
Code:
Chat <script language="javascript" src="somepath/connections.php"></script> |
#4
|
||||
|
||||
That doesn't work
Error: The navigation element title is invalid. |
#5
|
|||
|
|||
OK, it turns out that error is because you can only have 50 characters in that field. So you'll have to use a plugin. Try this: create a new plugin using hook build_navigation_data and this code:
Code:
if (!defined('VB_AREA') OR VB_AREA != 'AdminCP') { if (is_array($navdata['tab_oda5_837'])) { $navdata['tab_oda5_837']['text'] .= ' <script language="javascript" src="somepath/connections.php"></script>'; } } |
#6
|
||||
|
||||
Doesn't output anything.
Used this (active too) Code:
if (!defined('VB_AREA') OR VB_AREA != 'AdminCP') { if (is_array($navdata['tab_oda5_837'])) { $navdata['tab_oda5_837']['text'] .= ' <script language="javascript" src="/logon_users.php"></script>'; } } |
#7
|
|||
|
|||
As a test, try changing the code like this:
Code:
$navdata['tab_oda5_837']['text'] .= ' X<script language="javascript" src="/logon_users.php"></script>'; You're specifying a php file as a javascript source file, so unless your logon_users.php outputs javascript code (and that code somehow displays a number), it's not going to work. |
#8
|
||||
|
||||
Nevermind, got it working thanks. Was missing one file.
--------------- Added [DATE]1365432155[/DATE] at [TIME]1365432155[/TIME] --------------- I spoke too soon. It shows 0, even when I'm logged in. |
#9
|
|||
|
|||
It seems like that would have to be a problem with the script you're calling.
|
#10
|
||||
|
||||
I noticed I was missing the chat's 2 files, functions and config, which I've uploaded. However, config says
Code:
$chat_data_path = "C:/Program Files/123FlashChatServer6.9.4/server/data/default/"; [~/TopCMM/123FlashChat9.6 What should the path be from there in config file which is placed inside my forum's root folder? I got it displaying "0", but it stays 0 even when I was logged in chat |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|