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: 2410)

- 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
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #101
RE: XThreads
Updated to v1.30:
  • move template modification code from _install function to _activate - this allows an admin to re-perform the template edits after they install a new theme, by deactivating and re-activating the plugin (rather than forcing an uninstall, or requiring manual template edits)
  • workaround for an editpost bug in earlier MyBB 1.4.x versions
  • fix bug with handling array of filters (thanks to RateU)
  • fix bug with multiple values and textbox/textarea inputs; it didn't work before, now it will assume that commas (textboxes) or newlines (textareas) are delimeters (regardless of what the display delimiter is) - it's probably not the nicest solution, which might be changed in a later version.  Note, I'm assuming no-one has relied on this feature (haven't seen it being used anywhere) so I'm not going to bother trying to fix it in the upgrader.
  • add ability to use text mask filter (for custom thread fields) to capture patterns, similar to how custom MyCodes operate; surround the capture pattern with brackets, and use {VALUE$1}, {VALUE$2} etc in display (item) format or unviewable value
  • add $filters_set variable for forumdisplay, for displaying which thread filters have been set.  It is an array, and you specify something like {$filters_set['my_thread_field']['value']} in templates to display the value of the filter "my_thread_field".  "value" can be replaced with a number of different things:
    • urlarg: URL parameter, eg 'filtertf_my_thread_field=label_a'
    • urlarga: URL parameter with preceeding ampersand, eg '&filtertf_my_thread_field=label_a'
    • urlargq: URL parameter with preceeding question mark, eg '?filtertf_my_thread_field=label_a'
    • forminput: hidden form input parameter, eg '<input type="hidden" name="filtertf_my_thread_field" value="label_a" />'
    • selected: for selecting in listboxes - is set to ' selected="selected"' for selected value (eg {$filters_set['my_thread_field']['selected']['labela']} is set if the filter is "labela")
    • checked: for selecting in checkboxes - as above, but set to ' checked="checked"'
    • hiddencss: puts hidden CSS if set - is set to 'display: none;' if filter is set, or '' otherwise
    • visiblecss: opposite of the above - set to 'display: none;' if filter is NOT set, or '' otherwise
    Note that for "value", if an array of filters is used, the values will be comma separated.  There's also two special entries defined:
    • {$filters_set['__all'][...]} can be used to grab URL/form parameters for all filtered thread fields (does not include inline search)
    • {$filters_set['__search'][...]} can be used for inline search filtering; the "..." can be replaced with any of the above values

Some examples of the $filters_set variable:

HTML Code
<div style="{$filters_set['thread_prefix']['visiblecss']}">
Filtering by thread prefix: {$filters_set['thread_prefix']['value']}
</div>

HTML Code
1
2
3
4
5
6
7
8
9
Filter threads by status:
<form action="{$forumurl}" method="post">
<select name="filtertf_status">
<option value=""></option>
<option value="resolved"{$filters_set['status']['selected']['resolved']}>Resolved</option>
<option value="open"{$filters_set['status']['selected']['open']}>Open</option>
</select>
<input type="submit" class="button" value="Filter" />
</form>


My Blog
(This post was last modified: 08-15-2010 06:42 PM by ZiNgA BuRgA.)
08-15-2010 06:08 PM
Find all posts by this user Quote this message in a reply
Pirata Nervo Offline
Member
***
Posts: 235
Joined: Jan 2008
Post: #102
RE: XThreads
That's great! Thanks again zinga
08-15-2010 11:20 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #103
RE: XThreads
Thank you very much, Yumi.

08-16-2010 06:26 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #104
RE: XThreads
Something odd with X_threads. Maybe I missed it in the documentation, but here is my report.

My friend and I both have mybb boards. He is on 1.4, I am on 1.6. Today he contacted me because he was editing a forum and was having a problem getting his first post to show up. I checked his board and all was fine apart from his plugins being a bit outdated (he was still on 1.26 Xthreads and 1.5 Php Conditionals).  I immediately advised an upgrade to newest versions expecting this to fix the problem. It did not fix the problem and all his templates and forum settings were correct.

I went back to my own board and discovered I have a similar problem; I cannot add first_post templates to existing forums. If I add a NEW forum then I can add x_threads templates no issue. I have xthreads 1.3 and mynetwork and php in templates 1.6. I deactivated them all and reactivated them - I tried running without MyNetwork. I tried moving the forum from one category to another. Nothing fixed this glitch apart from creating a new forum.

Now of course this was not always so (AFAIK) - my downloads forum is forum id7 and has existed since before I had XThreads.  However, I did an edit of that forum - I changed the forum prefix to a NEW set of custom thread templates and suddenly I needed a couple of new templates for it to work as I wanted - specifically new thread and edit thread.

Im sorry this is a long post, and I hope it is not too garbled. I hope you can help me as I (and especially my friend) have a fair few links in sites we are affiliated with where the forum id(s) (not board id) is/are specified. It would be very bad to lose the links if we have to create new forums.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 08-17-2010 06:57 PM by leefish.)
08-17-2010 05:23 PM
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: #105
RE: XThreads
Unfortunately, I can't really see why that'd be the case...  If you (or anyone else) can set up a plain board and reproduce the issue, giving instructions as to how, I can try reproducing the issue which will allow us to start from a common ground.

(08-17-2010 05:23 PM)leefish Wrote:  I cannot add first_post templates to existing forums.
Do you mean postbit_first* ?


One possibility may be a theme template overriding your global template, though it sounds unlikely.

My Blog
08-17-2010 07:05 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #106
RE: XThreads
Hi Zinga, yes those are the ones I mean - postbit_first. But only if I am adding them onto existing forums. When creating the forum prefixes in a new forum no problems at all.

I shall have to do a bit to get a clean install together, but I will do my best.


[Image: leelink.gif]
MYBB1.6 & XThreads
08-17-2010 07:23 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #107
RE: XThreads
I can't reproduce it. Here is what I did:

1. Install a fresh MyBB 1.4
2. By default, there is a forum structure like this, right?
My Category
- My Forum
So, this forum already exist. Note: I didn't upload XThreads files in this step.
3. Create a new thread in My Forum forum.
It means, this thread already there, before I upload XThreads file in the next step.

4. Upload XThreads files
5. Install XThreads.
6. Create postbit_first template. Template content:

HTML Code
Test

Yeah, I need to make it "extreme" to view the difference.
7. Edit the My Forum to Show first post on every showthread page = Yes.

8. Open the thread.
I can see the difference. My first postbit contains "Test" word only. So, the postbit_first works for me.

Or am I misunderstanding Biggrin ?


08-18-2010 02:02 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #108
RE: XThreads
Hi RateU, thank you for testing so far - I am adding the custom thread fields as well. I see from your report that this does not occur on a fresh install of 1.4 and the most recent XThreads. That is one variant I can rule out. So it has to be a plugin conflict - or a theme as Zinga said.

I am just thinking that it is odd that we both have the same issue on two different boards and servers. I would have blamed it on 1.6 but my friend is on 1.4. I was trying to think what we have in common:

We both have custom themes and custom templates and both have forums where we force a style onto users depending on which forum they are in.
We both have Xthreads, php in templates and global templates plugins installed.
We both have fairly complex layouts with lots of extra global templates for our Xthreads.
We both have your version1 pictures in profiles plugin.

Its not a huge deal - I can think of lots of ways round it, but it is happening and I use XThreads a lot and I wanted to report it.
I shall continue to test. I am using 1.6. I have installed XThreads v.1. I am going to install 1.1, 1.25, 1.27 and 1.3 in sequence as that is what I did before.


[Image: leelink.gif]
MYBB1.6 & XThreads
08-18-2010 02:50 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #109
RE: XThreads
Well, I've tried it in my demo board. Look at this forum:

http://mynie.6te.net/demo/forumdisplay.php?fid=2

You can see that the forum id = 2. So, it is a default forum. Originally, it is My Forum under the My Category (I've renamed it to Category 1 - fid = 1). So, the forum already exist before I upload the XThreads files. Yes, I use a custom theme and template. I know, it is not a very custom Biggrin And I use 1 custom stylesheets attached to all pages. And there is a custom thread fields "attached" to that forum. Before this post, I don't use first post for that forum id.

You can try to view a thread there. You will find:

"This is nrm_postbit_first template" sentence if the post is first post, using horizontal postbit layout.
And "This is nrm_postbit_first_classic template" sentence if the post is first post, using calssic postbit layout.

Plugin I used in that forum:
1. XThreads 1.3 - MyBB Hacks (I've just updated it).
2. PHP In Template 1.6 - MyBB Hacks (I've just updated it - Not quite sure if I should update it, because I don't use My Network)
3. Other MyBB Hacks plugins and mine.

So, I'm not quite sure with which plugin it has a conflict. I just try to help to "track it down", Lee Smile But I can't reproduce it.

08-18-2010 04:33 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #110
RE: XThreads
RateU - I have continued to plod on - based on the remark from Zinga I focused on themes and templates - and I THINK this is what happened:

I had that forum set to have a style forced on it. Its had that style and theme forced on it all through my updates of both forum and Xthreads. The theme is using the same template set as all the others.

So today I took that force style off and resaved the forum. It took a little bit longer than usual to save. I went into the forum and the xthreads option I had added was visible. Then I went back to the forum settings, and put the original force style back on again. It saved pretty quickly, and when I went back into the forum - the X_thread setting was there.

So, I think it was that - forcing styles, especially as my friend is ALSO forcing styles. So if there is any case of this issue coming up for anyone else I think its a case of:

Do you have force styles checked? If so, uncheck and save the forum. Open forum again, reapply forced style, save.

   


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 08-18-2010 04:50 AM by leefish.)
08-18-2010 04:42 AM
Visit this user's website Find all posts by this user Quote this message in a reply


Forum Jump: