WildcardSearch / Advanced-Sidebox

A plugin for MyBB forums that displays custom boxes on various forum pages.
GNU General Public License v3.0
20 stars 10 forks source link

AJAX not working #136

Closed Destroy666x closed 10 years ago

Destroy666x commented 10 years ago

I set refresh time for all modules that provide that option to 60. But nothing happens, probably because of this error in console: Cannot call method 'split' of null asb_xmlhttp.js:101

WildcardSearch commented 10 years ago

Can you give the stable branch a try? Should have this fixed.

Destroy666x commented 10 years ago

It fixed random quotes and console error. However, there is still something wrong - I looked at console and it should have ran 5 GETs each 60 seconds, but it went much much much faster (there were 100 during a minute at least) and exceeded my free hosting CPU limit.

You can see it in action here: http://testingforum.bl.ee/forum/ after the temporary block will be over (around 2 hours).

WildcardSearch commented 10 years ago

Okay it is working from my end so there must be something different in the config. I'll have a look.

Destroy666x commented 10 years ago

I have 60 seconds for all possible modules. I guess it's because of free hosting and number of requests - I noticed that it fires all of them at the same time, which exceeds max_user_connections limit and that makes the requests go in an endless loop and crashes the server. Don't know if anything can be done to optimise it - probably not.

WildcardSearch commented 10 years ago

I did see what you meant, I was getting hundreds of request per minute. So sorry.

I discovered an error with how the decay value was being set in the initialize method. It seems to be working correctly again on my end. In web console I am getting the correct amount of requests per minute with a 5, 10, 20, 40 and 60 second rates applied.

@Destroy666x can you give the stable branch a try and see if it is all good on your end?

Destroy666x commented 10 years ago

Now it seems to only check Latest Threads. If I disable AJAX for that module, I get this error: "TypeError: width is undefined width = width.right;"

Also I tried to uninstall and install and this seems to be fixed for me: https://github.com/WildcardSearch/Advanced-Sidebox/issues/137 It added the scripts (but only in Stable branch).

WildcardSearch commented 10 years ago

How odd. With AJAX disabled on all boxes can you check and see if this:

<!-- end: headerinclude -->
<script type="text/javascript" src="jscripts/asb_xmlhttp.js"></script>
<script type="text/javascript">
<!--
    Event.observe(window, 'load', function() {
        asbBuildUpdaters([ { addon: 'recent_posts', id: 13, position: 0, rate: 5, dateline: 1390847748 } ], { left: 160, right: 160 });
    });
// -->
</script>

Is still getting output?

WildcardSearch commented 10 years ago

Never mind. I found it. I had used width for the column widths and the parameter width storage . . . I feel like such a rookie :smile:

Destroy666x commented 10 years ago

Yep, now it runs smoothly and updates all modules flawlessly.

WildcardSearch commented 10 years ago

Thanks for your patience and time to test. :smile: