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

- 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
ReaXion Offline
Junior Member
**
Posts: 7
Joined: Jan 2011
Post: #211
RE: XThreads
I just checked and initally the folder was chmod 755, so I went ahead and set it to 777 and tried again. The file uploaded fine and it's nestled in its folder. Am I allowed to insert the address here? I can show you what I'm looking at (I'll post screenshots in the meantime). See attachments


Attached File(s) Thumbnail(s)
           
01-23-2011 05:44 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #212
RE: XThreads
It is OK to insert the address here.

01-23-2011 06:17 AM
Find all posts by this user Quote this message in a reply
ReaXion Offline
Junior Member
**
Posts: 7
Joined: Jan 2011
Post: #213
RE: XThreads
http://test.violentricity.com/index.php

I made a test user account:
user/password: testuser/testuser1
01-23-2011 08:40 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #214
RE: XThreads
You probably already checked this I guess, but do you have that thumbnail size (320x240) defined in your custom thread field settings?

Hmm, I uploaded a pic, indeed, full link to image gives a deformed string, thumbs show no pic. I DID manage to upload a pic using the mybb attachments though, and that showed. So your board CAN show pics... how is the htaccess set for mybb attachment uploads?


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 01-23-2011 09:48 AM by leefish.)
01-23-2011 09: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: #215
RE: XThreads
Can you try this?
Open up cache/xthreads.php and add the following line to the bottom:

PHP Code:
define('ARCHIVE_QUERY_STRINGS', 1);


See if that helps.


My Blog
01-23-2011 10:11 AM
Find all posts by this user Quote this message in a reply
ReaXion Offline
Junior Member
**
Posts: 7
Joined: Jan 2011
Post: #216
RE: XThreads
(01-23-2011 10:11 AM)ZiNgA BuRgA Wrote:  Can you try this?
Open up cache/xthreads.php and add the following line to the bottom:

PHP Code:
define('ARCHIVE_QUERY_STRINGS', 1);


See if that helps.


Zinga, you are the stuff!!! That definitely fixed the problem and the photos are showing up fine now. Thank you greatly for your help! Yipi
(This post was last modified: 01-23-2011 05:13 PM by ReaXion.)
01-23-2011 05:13 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #217
RE: XThreads
Updated to v1.40:
  • fix $forumurl variable being wrong in some cases on forumdisplay threads
  • add changes in v1.4 of the Template Conditionals plugin; note that the two added functions are named 'xthreads_phptpl_eval_expr' and 'xthreads_phptpl_eval_text' (to avoid conflicting with Template Conditionals plugin).  Note that these functions auto-global variables, whereas the ones in Template Conditionals doesn't
  • slightly more liberal with variable parsing
  • fix variable parsing with conditionals around single quoted strings
  • fix some sanitisation stuff with PHP expressions - thanks for RateU for finding
  • fix bug preventing xtattachment flood checking from working
  • add in MyBB's PHP max upload size warnings to edit thread fields when file input type is selected
  • also allow shorthand size inputs for file max size (eg '2m'); these are converted internally so it's a little "dirty" in that editing them will show the byte value
  • fix sanitize method with select/radio/checkbox inputs
  • add ability to change underlying datatype for thread fields; you probably shouldn't change it from the default "text" though, unless you have some specific reason for doing so
  • fix ampersands in xtattach filenames (thanks to leefish for reporting)
  • improve checking for bad text masks in ACP
  • add ability to sort by thread fields in forumdisplay.  This reuses MyBB's sorting system - just that the URL parameter is a little different.
    To sort by a thread field, prefix its key with 'tf_', for example, forumdisplay.php?fid=2&sortby=tf_myfield will sort the threads by 'myfield'.  File input fields are a bit different, they need to be prefixed with 'tfa_component_' where 'component' is either filename, filesize, uploadtime, updatetime or downloads.
    Although XThreads adds this ability transparently (and to the list of default sort bys in the AdminCP), it is up to you to add appropriate options to the forumdisplay sorter listbox, if you want to.
    As this uses MyBB's system, template variables will be the same, eg {$sortsel['tf_myfield']} will be selected="selected" if sorting by myfield.
    Note that this is not indexed, like MyBB's sorting options aren't.
  • following on from above, add more sorting fields: prefix, icon, lastposter, numratings and attachmentcount - these are added to the forumdisplay sorter
  • add ability to have language file prefixes on a per forum basis; these support variables/conditionals
  • add ability to have a default forumdisplay filter if no filter has been defined in the URL; variables and conditionals supported here
  • remove "additional forum filters" option (the filterxt_uid etc stuff) - these are now always enabled
  • add support for modifying custom thread fields using custom moderator tools; note that values here are NOT validated and permissions are NOT checked!
  • fix bug with some non-existent threadfields not being handled properly (thanks to RateU for pointing out the bug)
  • add $threadfields_x template variable - this is like the $threadfields[...] variable, but provides some other stuff.  The syntax is $threadfields_x['key']['valuename'] where valuename is one of the following:
    • title: displays the title given to the thread field
    • desc: displays the description given to the thread field
    • num_values: displays number of values in the field; will always be 1 for non-multivalue field or 0 if there's no value in the field
    • num_values_friendly: formatted version of above
    • value: just a reference back to the $threadfields['key'] array; only different for multivalued fields, where it's an array containing the individual values
  • ACP JS editor for "open fields", such as formatting map
  • support for variables and conditionals in template prefix
  • support for variables/conditionals in thread fields' default value
  • fix up admin logs text
  • fix bug with search pagination - thanks to RocketFoot for finding
  • escape sequence for newline in Format Map - the new editor implements it so you don't need to worry much about it
  • filtering and sorting by a threadfield is now disallowed if the current user is not listed in the list of 'viewable usergroups'
  • fix bgcolor bug with Hide Forum option (thanks to RocketFoot for reporting)
  • add a URI entry to list of Text Masks; also fix issue with the Text Mask listbox not responding to keyboard events
  • add support for PHP's MAX_FILE_SIZE feature

Note that this release changes some templates (forumdisplay_threadlist and forumdisplay_threadlist_sortrating) which the upgrader will automatically edit.
If you wish to patch templates manually (ie custom variants of these), follow these instructions:
forumdisplay_threadlist
Find:

HTML Code
<option value="subject" {$sortsel['subject']}>{$lang->sort_by_subject}</option>

Add before:

HTML Code
{$sort_by_prefix}

Find:

HTML Code
<option value="views" {$sortsel['views']}>{$lang->sort_by_views}</option>

Add after:

HTML Code
					<option value="icon" {$sortsel['icon']}>{$lang->sort_by_icon}</option>
					<option value="lastposter" {$sortsel['lastposter']}>{$lang->sort_by_lastposter}</option>
					<option value="attachmentcount" {$sortsel['attachmentcount']}>{$lang->sort_by_attachmentcount}</option>
					{$xthreads_extra_sorting}

forumdisplay_threadlist_sortrating
At the very end, add:

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


Note that these template edits are pretty much optional (if you don't do them, the new sorting options just won't appear in the forumdisplay page).


My Blog
(This post was last modified: 02-04-2011 10:17 PM by ZiNgA BuRgA.)
02-04-2011 10:08 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #218
RE: XThreads
Thank you very much for the update, Yumi Smile
Wow, many features added.

02-05-2011 09:05 AM
Find all posts by this user Quote this message in a reply
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #219
RE: XThreads
Nice list, this one really jumped out at me:
...support for variables/conditionals in thread fields' default value
Thanks for the big update.  Smile
02-06-2011 02:10 AM
Find all posts by this user Quote this message in a reply
RocketFoot Offline
Senior Member
****
Posts: 338
Joined: Jul 2010
Post: #220
RE: XThreads
Excellent!  I'm going to upgrade now!

Will the upgrade effect any existing xthread forums?

[Image: gallery_2_628_39582.jpg]
02-06-2011 05:01 AM
Find all posts by this user Quote this message in a reply


Forum Jump: