XThreads
Author Message
My Spiel
XThreads is one of my larger plugins which I have been working on for a while.  Originally planned to release it inline with MyBB 1.6, but who knows when that'll be out.  It perhaps doesn't include everything I wanted it to, but does have most of the things (plus I want to move onto other projects).

What does it do?
Take a look at RateU's forum for some nice ideas of what it can do.  I also have some more basic examples here of what can be done with XThreads.  I'm pretty sure there are many other applications of this plugin, but those examples just give you some simple ideas.

The basic idea is giving you the ability to define custom fields for your threads, and providing methods to give you a lot of flexibility with customising forums.

Warning: I'm not going to bother with "beta" labels and so on.  I've done some testing on this myself, but it's by no means extensive.  Use this at your own risk.

Installation Instructions: standard installation procedures apply - you can find them in the announcement here.
You may need to CHMOD the uploads/xthreads_ul/ folder to 0777 after uploading the files (probably won't though).

Upgrade Instructions: unless stated otherwise, the general procedure for upgrades is to simply upload the new files, then visit your AdminCP.  In there, you'll be presented with a notice to run the upgrade - just follow what it says from there on.

Usage Instructions: this is a complex plugin, and unfortunately, you're probably going to have to figure this out yourself, depending on what you want to achieve with this plugin.  HTML and CSS knowledge is strongly recommended; you should also be familiar with MyBB's template system.  Some demonstrations can be found here - hopefully these will give you a good idea of how things work.  I suggest looking at the thread descriptions example, as this is fairly easy to understand (IMO).  If you can understand how everything works, there, perhaps try out the gallery example.

Known conflicting plugins
- MyPlaza Turbo -
If you are using MyPlaza Turbo, note that the author decided to use a particularly odd method to implement certain functionality, practically destroying compatibility with any plugin which hooks into the forum add/edit routines.  I've included a patch to address this issue - you need to replace inc/myplaza/myplaza_admin_plugin.php with the following file (it's unlikely that this will be committed as the author has decided to discontinue development)

.php  myplaza_admin_plugin.php (Size: 56.27 KB / Downloads: 2405)

- PL9 Forum Icons -
Affects certain functionality.  See here for a solution.

- PHP in Templates, v1.4 or older -
Similar to PL9 Forum Icons - solution is just to update to the latest version.

- MyAdvertisements - (update: older versions only, later versions may not conflict)
Affects some thread functionality, see here for a solution.

- Group Post CSS -
See here http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=378&pid=59

All bug reports, suggestions, criticisms are appreciated (though I may not always implement suggestions) so please feel free to post them.
If you find this plugin useful, I would be grateful if you could give some token of appreciation for the work that has gone into this, and perhaps post some example usages you've come up with in the XThreads forum to help others get an idea of what can be achieve with this plugin (and for my own interest's sake Tongue).


Github: https://github.com/zingaburga/XThreads-MyBB-Plugin
Note: do NOT use the Github version, unless you know what you're doing
Changelogs: v1.10, v1.20, v1.21, v1.22, v1.23, v1.24, v1.25, v1.26, v1.27, v1.30, v1.31, v1.32, v1.337, v1.40, v1.41, v1.42, v1.43, v1.44, v1.45, v1.46, v1.47, v1.50, v1.51, v1.52, v1.53, v1.60, v1.61, v1.62, v1.63, v1.64, v1.65, v1.66, v1.67, v1.68
(This post was last modified: 12-25-2015 12:46 PM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: xthreads-1.68.7z (114.53 KB)
Plugin Version: 1.68
Last Updated: 12-25-2015, 12:46 PM

Downloads: 8,437
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
WINBOY Offline
Member
***
Posts: 71
Joined: Nov 2012
Post: #961
RE: XThreads
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.


Attached File(s) Thumbnail(s)
   
06-13-2020 11:42 PM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #962
RE: XThreads
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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.


Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
02-23-2021 10:49 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #963
RE: XThreads
Also, it seems that enabling the forum setting Default Sort Order -> Ascending breaks filter urls in forums multipage.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
02-26-2021 11:32 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #964
RE: XThreads
(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?

My Blog
02-28-2021 09:21 PM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #965
RE: XThreads
(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.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
03-05-2021 09:12 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #966
RE: XThreads
(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.

My Blog
03-21-2021 03:18 PM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #967
RE: XThreads
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:

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 04-10-2021 04:57 PM by Sama34.)
04-10-2021 04:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #968
RE: XThreads
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

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
04-11-2021 08:03 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #969
RE: XThreads

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


Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
04-18-2021 04:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
TheStoryteller Offline
Junior Member
**
Posts: 4
Joined: May 2021
Post: #970
RE: XThreads
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

05-13-2021 05:36 AM
Find all posts by this user Quote this message in a reply


Forum Jump: