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

- 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: #821
RE: XThreads
:/
Okay, try this, in xthreads_attach.php, find:

PHP Code:
$dbclass = 'db_'.$config['database']['type'];

add before:

PHP Code:
@include_once MYBB_ROOT.'inc/db_base.php'; // MyBB >= 1.8.4


My Blog
03-28-2015 11:09 AM
Find all posts by this user Quote this message in a reply
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #822
RE: XThreads
(03-28-2015 11:09 AM)ZiNgA BuRgA Wrote:  :/
Okay, try this, in xthreads_attach.php, find:

PHP Code:
$dbclass = 'db_'.$config['database']['type'];

add before:

PHP Code:
@include_once MYBB_ROOT.'inc/db_base.php'; // MyBB >= 1.8.4


Thank you very much!

3 days and I haven't "PHP Fatal error:  Interface 'DB_Base' not found in /inc/db_mysqli.php on line 12" error Biggrin

I have still "Unknown: failed to open stream: Permission denied in Unknown on line 0" but I think it is about another file, maybe wrong permissions.

Anyway thank you very much Yipi
04-01-2015 02:15 AM
Find all posts by this user Quote this message in a reply
Seabody Offline
Member
***
Posts: 54
Joined: Aug 2012
Post: #823
RE: XThreads
Hi, I'm having another issue. Frown

I am using a textarea to accept a list of usernames in a forum. My display item format is set to the following:

PHP Code:
<setvar user>get_user_by_username({VALUE})</setvar>
<func htmlspecialchars_uni>{$tplvars['user']['username']}</func>


However, this isn't working. Nothing is displayed. I made sure to whitelist the function get_user_by_username too. Any thoughts? Smile

EDIT: Fixed.

PHP Code:
1
2
3
4
5
6
7
<?php

$user = get_user({VALUE});

?>

{$user['username']}

(This post was last modified: 06-01-2015 02:09 PM by Seabody.)
05-31-2015 04:11 PM
Find all posts by this user Quote this message in a reply
XPMai Offline
Junior Member
**
Posts: 8
Joined: May 2015
Post: #824
RE: XThreads
There's a problem: the whole forum will become completely blank (white) leaving no traces on what causes the error (to the viewers) when hyphens are added to the Key. Everything work again when replaced with an underscore instead.
06-05-2015 10:25 AM
Find all posts by this user Quote this message in a reply
xboris2010 Offline
Junior Member
**
Posts: 14
Joined: Feb 2014
Post: #825
RE: XThreads
Hello guys, thank you for this great plugin.

I instaleld 2 plugins and i don't know which one is really the culprit, the other plugin is called view unread post and my board version is upto date which is 1.8.5.

Problem is after i activated both plugin this particular piece of code  

Code:
<option value="numratings" {$sortsel['numratings']}>{$lang->sort_by_numratings}</option>


Automatically added into all my Global Templates, and because of that my forum got a little bit messed up , actually it's just the spacing.

I right clicked my main index and saw like 10instaces of the code above, ive checked index template i didnt the code there but found them alll on global templates.


So my question is does xthread has something to do with this?

<option value="numratings" {$sortsel['numratings']}>{$lang->sort_by_numratings}</option>

Thank You

(This post was last modified: 06-07-2015 03:39 PM by xboris2010.)
06-07-2015 05:22 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #826
RE: XThreads
(05-31-2015 04:11 PM)Seabody Wrote:  

PHP Code:
<setvar user>get_user_by_username({VALUE})</setvar>
<func htmlspecialchars_uni>{$tplvars['user']['username']}</func>


However, this isn't working. Nothing is displayed. I made sure to whitelist the function get_user_by_username too. Any thoughts? Smile

Should be

Code:
<setvar user>get_user_by_username({VALUE}, array('fields'=>array('username')))</setvar>
<func htmlspecialchars_uni>{$tplvars['user']['username']}</func>


Your updated method also works if PHP is enabled.

(06-05-2015 10:25 AM)XPMai Wrote:  There's a problem: the whole forum will become completely blank (white) leaving no traces on what causes the error (to the viewers) when hyphens are added to the Key. Everything work again when replaced with an underscore instead.
Gah, good catch!  Will disable hyphens in the next version.

(06-07-2015 05:22 AM)xboris2010 Wrote:  So my question is does xthread has something to do with this?

<option value="numratings" {$sortsel['numratings']}>{$lang->sort_by_numratings}</option>

Thank You
XThreads does add that.  See here for a list of modified templates.
It adds that to the end of the template(s) on install; it doesn't bother checking what's actually in the template before doing so, so if your template is very different to what MyBB has by default, it could mess things up (such is the case with template edits in general).
It shouldn't add it multiple times though - I can't explain that unfortunately.

My Blog
06-11-2015 07:00 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #827
RE: XThreads
Updated to v1.66 - mostly just bug fixes:
  • disallow hyphens in keys as it causes a parse error (thanks to XPMai for finding)
  • implemented work around for bug in Permissions Viewer plugin (thanks to steezy for reporting)
  • fix issue with MyBB 1.8.4 and xtattachment downloads not being counted (thanks to nier3 for finding)
  • fix some issues with displaying xtattachment upload errors on MyBB 1.8
  • fix some issues with forumdisplay pagination with filtering enabled on MyBB 1.8 (thanks to Sama34 for finding)
  • removed support for the {ICON} variable for a file threadfield in the display format / templates etc.  If you still need it, it can be replicated via <?=get_attachment_icon(get_extension({FILENAME}))?>.  Its removal saves a query in MyBB 1.8x.

My Blog
06-16-2015 12:37 PM
Find all posts by this user Quote this message in a reply
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #828
RE: XThreads
(06-16-2015 12:37 PM)ZiNgA BuRgA Wrote:  Updated to v1.66 - mostly just bug fixes:
  • disallow hyphens in keys as it causes a parse error (thanks to XPMai for finding)
  • implemented work around for bug in Permissions Viewer plugin (thanks to steezy for reporting)
  • fix issue with MyBB 1.8.4 and xtattachment downloads not being counted (thanks to nier3 for finding)
  • fix some issues with displaying xtattachment upload errors on MyBB 1.8
  • fix some issues with forumdisplay pagination with filtering enabled on MyBB 1.8 (thanks to Sama34 for finding)
  • removed support for the {ICON} variable for a file threadfield in the display format / templates etc.  If you still need it, it can be replicated via <?=get_attachment_icon(get_extension({FILENAME}))?>.  Its removal saves a query in MyBB 1.8x.

thanks for the update.  is it possible to sort the forums based on a thread prefixes name rather than pid?
06-16-2015 02:34 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #829
RE: XThreads
Unfortunately no, you'll need to adjust the prefixes so that they match the ID order.

Interestingly it looks like the way prefixes are ordered was changed in MyBB 1.8.  In 1.6, it would be ordered by ID everywhere, whilst in 1.8, it's ordered by the plaintext name.  I won't be adding support for the latter - XThreads will always order by ID regardless of the MyBB version installed.

My Blog
06-17-2015 07:05 PM
Find all posts by this user Quote this message in a reply
Shemo Offline
Member
***
Posts: 184
Joined: Jan 2008
Post: #830
RE: XThreads
(06-17-2015 07:05 PM)ZiNgA BuRgA Wrote:  Unfortunately no, you'll need to adjust the prefixes so that they match the ID order.

Interestingly it looks like the way prefixes are ordered was changed in MyBB 1.8.  In 1.6, it would be ordered by ID everywhere, whilst in 1.8, it's ordered by the plaintext name.  I won't be adding support for the latter - XThreads will always order by ID regardless of the MyBB version installed.

thanks for the reply.  I'm trying to get the mybb team to add thread prefix sorting to the core system.
06-18-2015 12:36 AM
Find all posts by this user Quote this message in a reply


Forum Jump: