The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
My plugin suddenly started slowing down my forum
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: Code:
$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; Here's the tab's template if you need to see it for any reason Code:
<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> |
#2
|
||||
|
||||
This is a bit of speculation on my part, but the issue might actually be with the request time for that http page. I believe the script freezes while it's waiting for the page to load, so any slowness on the part of that page would result in slow loading times for all of your pages.
Why don't you fetch the number with ajax javascript? That would allow your page to load first, even if the counter page is loading slowly, and it would take the burden off your server and put it on the users' browsers. -Nick, SEOvB Developer |
#3
|
|||
|
|||
Quote:
However, do you think it's still a good idea to use AJAX instead of PHP? I've never used AJAX with a vB plugin, so I'm not really sure how that would work. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|