Jeremy8
04-09-2012, 10:32 PM
I made a plugin that get's the number of users in my IRC and puts the number in the tab that links to the IRC. For example, if there are 8 people in the IRC, the tab says "Chat: 8".
Anyway, the plugin that gets the number and makes it into a variable for the tab template stopped working and made the whole forum go very slow. I've used this for about a year with no problems, so I don't know what happened.
This is the plugin:
$usercount = file_get_contents('http://usercount.geekshed.net/?chan=belltree&noimage');
vB_Template::preRegister('irc_navtab',array(
'usersin' => $usercount
));
$template_hook['users_in_chat'] = $usercount;
You can see that the URL above contains a number of the amount of users in the IRC room. http://usercount.geekshed.net/?chan=belltree&noimage
Here's the tab's template if you need to see it for any reason
<li<vb:if condition="$vbulletin->options['selectednavtab'] == 'chat'"> class="selected"</vb:if>><a class="navtab" href="chat.php">Chat<vb:if condition="$usersin != 0">: {vb:raw template_hook.users_in_chat}</vb:if></a></li>
Anyway, the plugin that gets the number and makes it into a variable for the tab template stopped working and made the whole forum go very slow. I've used this for about a year with no problems, so I don't know what happened.
This is the plugin:
$usercount = file_get_contents('http://usercount.geekshed.net/?chan=belltree&noimage');
vB_Template::preRegister('irc_navtab',array(
'usersin' => $usercount
));
$template_hook['users_in_chat'] = $usercount;
You can see that the URL above contains a number of the amount of users in the IRC room. http://usercount.geekshed.net/?chan=belltree&noimage
Here's the tab's template if you need to see it for any reason
<li<vb:if condition="$vbulletin->options['selectednavtab'] == 'chat'"> class="selected"</vb:if>><a class="navtab" href="chat.php">Chat<vb:if condition="$usersin != 0">: {vb:raw template_hook.users_in_chat}</vb:if></a></li>