MyBB Hacks

Full Version: XThreads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I upgrade mybb to 1822 and overright 1.67 files with 1.68 but it show below error when click on message to upgrade table in ACP/Plugins.



Please help.
Hi, for some reason it doesn't matter what I set for XTHREADS_EXPIRE_ATTACH_LINK], some files are just not rendered and the following error is displayed for them:

Code:
Specified attachment not found. It's possible that the link has expired - try going back, refresh the page, and access the attachment again.


You can see my settings below:

Code:
define('XTHREADS_ALLOW_URL_FETCH', false);
define('XTHREADS_URL_FETCH_DISALLOW_HOSTS', 'localhost,127.0.0.1,[::1]');
define('XTHREADS_URL_FETCH_DISALLOW_PORT', false);
define('XTHREADS_UPLOAD_FLOOD_TIME', 30*60); // in seconds
define('XTHREADS_UPLOAD_FLOOD_NUMBER', 50);
define('XTHREADS_UPLOAD_EXPIRE_TIME', 3*3600); // in seconds
define('XTHREADS_UPLOAD_LARGEFILE_SIZE', 10*1024*1024); // in bytes, default is 10MB
define('XTHREADS_ATTACH_USE_QUERY', 1);
define('XTHREADS_COUNT_DOWNLOADS', 2);
define('XTHREADS_CACHE_TIME', 604800);
define('XTHREADS_PROXY_REDIR_HEADER_PREFIX', '');
define('XTHREADS_EXPIRE_ATTACH_LINK', 43200);
define('XTHREADS_ATTACH_LINK_IPMASK', 0);
define('XTHREADS_MIME_OVERRIDE', '');
define('XTHREADS_ALLOW_PHP_THREADFIELDS', 2);
define('XTHREADS_MODIFY_TEMPLATES', true);
define('XTHREADS_INSTALLED_VERSION', 1.68);


I don't know if I'm missing something.

Also, it seems that enabling the forum setting Default Sort Order -> Ascending breaks filter urls in forums multipage.
(02-17-2020 08:15 AM)Sama34 Wrote: [ -> ]Now within Display Format we can use {VALUE} and {RAWVALUE}, but could there be a way to display the mapping value? So instead of "1" or "2" it would output "Espantoso" or "Horrible"?
It's not documented that well, but {RAWVALUE} spits out the value without any parsing/formatting/sanitization.

(03-02-2020 02:32 PM)Sama34 Wrote: [ -> ]I updated the "Image Thumbnail Generation" to update some resize thumbnails that weren't working as intended. However, running the tool after updating these didn't rebuild the thumbnails and I had to directly edit each thread so that the script would update them.
[...]
Any ideas about this? I may be confusing the tool expected behaviour.
That's what the tool should be doing.  I'm not sure why it's not doing mass updates for you.
I presume nothing obvious like errors or timeouts?  If you set it to do 1 at a time, do you get to see it progressing?

(05-07-2020 12:49 PM)Sama34 Wrote: [ -> ]It seems like MyBB adds a string if the post message is empty so the "Allow blank post messages" setting no longer works as expected I suppose.
I haven't looked into it much, but couldn't find it doing that.  Do you know what/where it sets it?

(06-13-2020 11:42 PM)WINBOY Wrote: [ -> ]I upgrade mybb to 1822 and overright 1.67 files with 1.68 but it show below error when click on message to upgrade table in ACP/Plugins.
Try this fix: https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/commit/09688a8d8545abc4600e0d877a5e5e

(02-23-2021 10:49 AM)Sama34 Wrote: [ -> ]Hi, for some reason it doesn't matter what I set for XTHREADS_EXPIRE_ATTACH_LINK], some files are just not rendered and the following error is displayed for them:
I pushed a completely untested fix, which maybe fixes your issue?  https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/commit/c1d86733c01762cdd8529d00244c10

(02-26-2021 11:32 AM)Sama34 Wrote: [ -> ]Also, it seems that enabling the forum setting Default Sort Order -> Ascending breaks filter urls in forums multipage.
Just did a really quick test, and URLs look okay to me.  Able to give more info, like what gets put out and what it should be?
(02-28-2021 09:21 PM)ZiNgA BuRgA Wrote: [ -> ]I pushed a completely untested fix, which maybe fixes your issue?  https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/commit/c1d86733c01762cdd8529d00244c10

Seems to work, thank you. Although it doesn't seem to work on two boards with the same config (and server), any idea how this would be possible? I will try to figure out the reason.

Also, for the XTHREADS_ATTACH_USE_QUERY setting, it seems that only 0 or 1 values work on my server, you got any idea? I will probably stick to 1 and be done with it, but a fix could be preferable. I have been unable to make it work in both Apache and Ngnix.

I missed to comment that the XTHREADS_ATTACH_LINK_IPMASK setting seems to not work with the core CDN feature, in case you want to comment it some place in the doc (or users could get to read this comment).

(02-28-2021 09:21 PM)ZiNgA BuRgA Wrote: [ -> ]I haven't looked into it much, but couldn't find it doing that.  Do you know what/where it sets it?

I tracked this down to this line:
https://github.com/mybb/mybb/blob/featur...https://github.com/mybb/mybb/blob/feature/jscripts/jeditable/jeditable.

I decided to open a support thread in the community instead.

(02-28-2021 09:21 PM)ZiNgA BuRgA Wrote: [ -> ]Just did a really quick test, and URLs look okay to me.  Able to give more info, like what gets put out and what it should be?

Just figured out this is caused by Google SEO, turning the Handle multipage links setting to No should make xThreads filter work again at the expense of using non Google SEO urls for multipage links. I reported this to the plugin author.

(02-28-2021 09:21 PM)ZiNgA BuRgA Wrote: [ -> ]It's not documented that well, but {RAWVALUE} spits out the value without any parsing/formatting/sanitization.

You are right, duplicating the value of field Values List into Formatting Map List and then switching the usage of {VALUE} and {RAWVALUE} did the trick.

(02-28-2021 09:21 PM)ZiNgA BuRgA Wrote: [ -> ]That's what the tool should be doing.  I'm not sure why it's not doing mass updates for you.
I presume nothing obvious like errors or timeouts?  If you set it to do 1 at a time, do you get to see it progressing?

Yes, it seems to be ran just fine, I still need to track this one down.
(03-05-2021 09:12 AM)Sama34 Wrote: [ -> ]Seems to work, thank you. Although it doesn't seem to work on two boards with the same config (and server), any idea how this would be possible?
Can't say why it would work in some places but not others, assuming same config and all.
Do note that the URLs need to be regenerated (i.e. refresh the page that has the link to the file) if you haven't done so.

(03-05-2021 09:12 AM)Sama34 Wrote: [ -> ]Also, for the XTHREADS_ATTACH_USE_QUERY setting, it seems that only 0 or 1 values work on my server, you got any idea? I will probably stick to 1 and be done with it, but a fix could be preferable. I have been unable to make it work in both Apache and Ngnix.
Well the option exists because I don't know what the webserver config is going to look like.
As long as one of them works, that's all that really matters.
If, for some reason, you want to set it to a particular option, you'll need to trace what your webserver is sending through to PHP to see if it's something XThreads can interpret.

(03-05-2021 09:12 AM)Sama34 Wrote: [ -> ]I missed to comment that the XTHREADS_ATTACH_LINK_IPMASK setting seems to not work with the core CDN feature, in case you want to comment it some place in the doc (or users could get to read this comment).
There was some rudimentary code to check if the connecting address was local, but that won't work if you're using an external proxy (which wasn't so common back then).
Also doesn't work with IPv6, and with CGNAT, network switching (e.g. Wifi -> 4G) and more sophisticated IP routing these days, I ultimately don't think IP based filtering is that great of a concept any more.

I'll change the description to discourage use, so thanks for pointing that out.

(03-05-2021 09:12 AM)Sama34 Wrote: [ -> ]I tracked this down to this line:
https://github.com/mybb/mybb/blob/featur...https://github.com/mybb/mybb/blob/feature/jscripts/jeditable/jeditable.
Assuming this is your thread, the behaviour should be patched.  Are you seeing that bit of code being activated, or maybe you've got some special header template?

(03-05-2021 09:12 AM)Sama34 Wrote: [ -> ]Just figured out this is caused by Google SEO, turning the Handle multipage links setting to No should make xThreads filter work again at the expense of using non Google SEO urls for multipage links. I reported this to the plugin author.

...

Yes, it seems to be ran just fine, I still need to track this one down.
Thanks for finding those out and reporting back.
I think your comment on IP based filtering is on point

(03-21-2021 03:18 PM)ZiNgA BuRgA Wrote: [ -> ]Assuming this is your thread, the behaviour should be patched.  Are you seeing that bit of code being activated, or maybe you've got some special header template?

My templates are full of conditionals, if that is special enough. This happens in that customised theme, not the default one, so should be related to it somehow. This will be fixed in the next versions:
https://github.com/mybb/mybb/issues/4293

I'm in sure there is something happening around with the rebuild tool as I came across it in another board, not managed by me in any other way. I will eventually track it down
Btw, your board doesn't support unicode emojis, I had to remove my awesome finger pointing at my awesome eagle, :cryingface:
Ugh, forgot the main point I was going to make yesterday.

Could you perhaps add support (hooks) for the attachment upload process? I would like to be able to store attachments over at some cloud service, I think some hooks around the following line should work:
https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/blob/2fd64cd0e12054684a0e03ef10c8c0ec5487e3fa/Upload/inc/xthreads/xt_uploa
https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/blob/2fd64cd0e12054684a0e03ef10c8c0ec5487e3fa/Upload/xthreads_attac

Code:
Fatal error: Uncaught Exception: Serialization of 'PDO' is not allowed in


I think the following affects your control_object() function.
https://github.com/mybb/mybb/pull/4193

Hello all,

I have a question regarding xThread prefixes.

I have a code to randomly show me the mybb prefixes, title, description and author of a topic in a specific forum.

Because I do not want to use the mybb prefix function but xThreads prefix, I want to amend the code accordingly, so my 3 xThread prefixes (which are displayed as fontawesom icons) are displayed in a div container on the welcome_block templates.

I also have „php in templates“ active.

Could somebody tell me, how do I get the correct data from the database? I am absolutely new to php…

The Code I have is this:

PHP Code:
 <?php
$query = $db->query("SELECT *, t.description FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (p.fid=f.fid) LEFT JOIN ".TABLE_PREFIX."threadprefixes ON (t.pid=t.prefix) WHERE f.fid IN (27, 28, 29) AND t.visible = '1' ORDER BY RAND() LIMIT 6");
while($data = $db->fetch_array($query))
echo etc. etc.


Thank you very much and cool plugin btw Wink

Reference URL's