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

- 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...17#pid5917

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: 6,943
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #251
RE: XThreads
You're searching for an element with the id="xthreads_diet", but there is no such thing on the page, which is why it fails (you've only got name="xthreads_diet", not the id).
If your form has an id, you can traverse down to find something with the correct name.

My Blog
(This post was last modified: 02-15-2011 03:41 PM by ZiNgA BuRgA.)
02-15-2011 03:41 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #252
RE: XThreads
I DID IT!!!! (lee dances)

This is what I did:

I put the Custom thread field  with the radio buttons inside a span and gave it an ID of "yes".

I did the same with my textbox custom thread field, put it in a div with id="field", gave it a style="display:none;"

Then I did my javascript .

Javascript Code
1
2
3
4
5
6
7
8
<script language="javascript" type="text/javascript">
var el = document.getElementById('yes');
if (el)
el.onchange = function() 
{document.getElementById('field').style.display = "block";}
else
alert("element not found");
</script>


Its scraffly, and not very slick, but it works. Smile



[Image: leelink.gif]
MYBB1.6 & XThreads
02-15-2011 06:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #253
RE: XThreads
Reporting back on the editable fields.

It could be that I am not really 100% sure on how to get files off git hub, but I got the 7 files from the github. They were in two groups:

ACP component for threadfield value permissions (5 files)
User-level component for threadfield value permissions (2 files)

I got the files by clicking on view file, then on raw then save as.

I put them in the folders (as defined on the git hub, eg: Upload / inc / languages / english / xthreads.lang.php ) and put them on my FTP. I went to ACP and was a bit surprised that it did not call the upgrader. Anyway, I went to my Custom Thread Fields and added a textbox using the new Settable Value Permissions. All went fine until I hit save - then I got this error.


Code:
1
2
3
4
5
6
7
8
9
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1054 - Unknown column 'editable_values' in 'field list'
Query:
INSERT INTO test_threadfields 
(`field`,`title`,`forums`,`editable`,`editable_gids`,`editable_values`,`viewable_gids`,`unviewableval`,`blankval`,`dispformat`,`dispitemformat`,`formatmap`,`datatype`,
`textmask`,`maxlen`,`vallist`,`multival`,`sanitize`,`allowfilter`,`desc`,`inputtype`,`disporder`,`tabstop`,`hideedit`,`formhtml`,
`defaultval`,`fieldwidth`,`fieldheight`,`filemagic`,`fileexts`,`filemaxsize`,`fileimage`,`fileimgthumbs`)
 VALUES ('test','test','2','1','','a:2:{i:1;a:1:{i:0;i:2;}s:0:\"\";a:1:{i:0;i:1;}}','2',' ','','{VALUE}','{VALUE}','','0','','0','1\r\n0','','0','0','test box','2','1','1','0','','','40','5','','','0','','')


Its probably me being a noob at getting files off github, but here is the report.



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 02-16-2011 04:37 PM by leefish.)
02-16-2011 04:34 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #254
RE: XThreads
Click the big Download button on the right near the top of the page.

https://github.com/zingaburga/XThreads-M...all/master

My Blog
02-16-2011 06:25 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #255
RE: XThreads
LOL - this is why I always wait for the proper release - scared of breaking stuff due to being a bit thick on some things....

REPORT: It sort of works. (I think I am a crap tester TBH)
I set up a group based on the registered users, called it tester (usergroup 8), and put that usergroup in the Allowed to edit group.
I set a field to be custom usergroups (not required) and then defined who was allowed to edit a field in the Editable by Usergroups setting.
Field values were Yes or No. No default field value set.
In the editable values I chose the values that could be inputted by the user. I chose the allowable values to be yes or no.  My settings looked like this:

Yes{|} 3,4,8
No {|} 3,4,8

I made some test posts:

As a standard registered user I did not see the field and did not need to fill it in and thread was accepted = expected result
As a tester I did see THREE values - not set, yes and no. I did not fill anything in (ie left the value at (Not Set), and the thread was accepted = unexpected result.

I changed the settings to be "Everyone(Required)" and as I expected, a standard registered user who could not see the field also could not complete it = thread not accepted due to missing value.

I hope this is useful info......

PS. If it turns out that its because I have not fully understood how to set this up and that is why it appears not to work I apologise.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 02-16-2011 08:43 PM by leefish.)
02-16-2011 08:40 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #256
RE: XThreads
If you want to hide the (not set) value, use a blank value in the permissions field, and set it to something like administrators group, eg:

Code:
Yes{|}3,4,8
No{|}3,4,8
{|}4


My Blog
02-16-2011 09:15 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #257
RE: XThreads
Updated to v1.41:
  • minor bugfixes and slight tweaks (thanks to RocketFoot for pointing out an issue)
  • ability to set permissions (by usergroup) for using certain values in threadfields [eg, imagine that only moderators are allowed to mark a thread as 'technical']
  • add ability to offset the {$colspan} variable in forumdisplay_threadlist template

My Blog
02-19-2011 09:00 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #258
RE: XThreads
Zinga - can I still download this with the Github code in my forum?


[Image: leelink.gif]
MYBB1.6 & XThreads
02-19-2011 09:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,338
Joined: Jan 2008
Post: #259
RE: XThreads
You might already be using it, since I don't think I've updated it since you downloaded it.  Check the dates of the files in GitHub, they're probably the same.

My Blog
02-19-2011 09:58 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*******
Posts: 1,009
Joined: Apr 2010
Post: #260
RE: XThreads
Hi  - something has gone horribly wrong....I have run the upgrader, and all is fine on the board, but I am getting this message in my plugins list. It is also saying I am not upgraded. However, the new functions are on the board - I can add fields, set the editable, download and upload files fine.

Fatal error: Cannot redeclare class _objcont_1 in /home/leefish/public_html/mybb/inc/plugins/xthreads.php(792) : eval()'d code on line 15

Thats all I can see _ I can't see the plugin list.

I am also seeing this:

Fatal error: Cannot redeclare class _objcont_1 in /home/leefish/public_html/mybb/inc/plugins/vbquote.php(304) : eval()'d code on line 15
Fatal error: Cannot redeclare class _objcont_1 in /home/leefish/public_html/mybb/inc/plugins/preparser.php(321) : eval()'d code on line 15

It looks like my obj_control object is buggered somehow.

as a very quick temp fix I have changed the static count in these three files (as in the code below) to 1, but that is not the right thing to do I know. I can now see the plugin list.

PHP Code:
if(!function_exists('control_object')) {
	function control_object(&$obj, $code) {
		static $cnt = 0;
		$newname = '_objcont_'.(++$cnt);


EDIT: I should also mention that I did not have the 1.41 files on leefish - they were on another site. I did have to ABORT uploading 1.4 to leefish due to an error - but all seemed fine - I replaced the 1.4 files with the 1.337 files. That was a while ago - like on the release day plus 1 of 1.4. I thought it was MyNetwork being a pest.



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 02-19-2011 11:04 AM by leefish.)
02-19-2011 10:25 AM
Visit this user's website Find all posts by this user Quote this message in a reply


Forum Jump: