MyBB Hacks

Full Version: XThreads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorting by prefix is slow enough as it is, I don't really want to imagine the performance impact of (text) sorting on a joined field.
In other words, I wouldn't expect it to come soon, unless you don't mind murdering your database.
Most of us are shared hosting, thus, the servers aren't ours. Hence, it's fine. Tongue
(06-19-2015 03:48 PM)XPMai Wrote: [ -> ]Most of us are shared hosting, thus, the servers aren't ours.
Hence the host will kick you off if you use the slightest bit of load.

Of course, in reality, like 90% of MyBB forums have no visitors and no threads, hence no load to worry about.
Hi,

Just got this on the latest myBB version (1.8.5), since I was impressed with what I could do with it. On a brand new forum with the only other plugin being the Preparser Cache (1.12), I'm having some issues. With XThreads installed and activated, the web server returns a 500 error on the index and the portal (and by extension I'm guessing userCP and post). Only the adminCP works. Nothing appears in my logs either. Some stats about the stack:

Ubuntu 14.04.02
Nginx 1.7.10
HHVM 5.6.99
PHP-FPM 5.5.9ubuntu4.9 + APC
MariaDB 10.0.20

It shouldn't be an issue with my stack, since both HHVM and PHP-FPM (HHVM is the primary PHP processor with PHP-FPM as a fallback) failed. MariaDB is a drop in replacement for MySQL, so that also should not be an issue. Is it an issue with the newest version of myBB?

Thanks,
Tempest
Are PHP errors actually being logged?  Check your configuration.
You can also try enabling errors to be displayed (unsure about HHVM config, but it's "display_errors" for regular PHP).

My guess would be that you may not have correct file permissions somewhere, but check the logged errors if possible.
Alright. I got HHVM to finally log errors (Both PHP and HHVM are a bitch about logging errors correctly) and here's the relevant lines:

Code:
\nFatal error: syntax error, unexpected '{' in /usr/share/nginx/forum/cache/xthreads_evalcache.php on line 47
\nNotice: Undefined property: MyBB::$request_mode in /usr/share/nginx/forum/inc/xthreads/xt_admin.php on line 1780
\nNotice: Undefined variable: msg in /usr/share/nginx/forum/inc/xthreads/xt_admin.php on line 1837
\nNotice: Undefined index: 2 in /usr/share/nginx/forum/admin/styles/default/style.php on line 50
\nNotice: Undefined index: 2 in /usr/share/nginx/forum/admin/styles/default/style.php on line 47
\nFatal error: syntax error, unexpected '{' in /usr/share/nginx/forum/cache/xthreads_evalcache.php on line 47


So it seems the real issue, since the notices don't mean much, is the the syntax error on line 47 of xthreads_evalcache.php. I'll see if I can fix it quick.

The evalcache file is auto generated, so probably not a good idea to edit it as it can just get overwritten.
If you still have a copy of the broken file, could you upload it?
Here you go. While I admit I'm not great with PHP -- I do more with node and python -- I couldn't find an issue. I looked through it in my IDE and everything seemed to line up. Must be some PHP semantics I don't know or I'm dumb and missed it.
Hmm, do you know if that file is generated by HHVM?  You can force the file to be regenerated by deleting it then visiting a page in the AdminCP.
I'm not sure why, but the file is definitely not generating correctly (the correct file should look like the one in the attachment below).

If you're keen on debugging it yourself, the culprit is likely in the xthreads_phptpl_parse_fields function in inc/xthreads/xt_phptpl_lib.php
If I force the $in_string variable to be true, I get the same output as you do.  But otherwise, I can't see why it's like that. Erf
Well, it seems HHVM was the culprit. Disabling HHVM and forcing Nginx to use PHP-FPM caused the file to be generated correctly. Once it's generated, HHVM seems to work fine again. It seems I've run into one of the disparities between HHVM and the Zend engine. Oh well. HHVM is so damn fast I'm willing to put up with a few hiccups. Anyways, thanks. XThreads will be a great edition to my forums.
Reference URL's