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
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #161
RE: XThreads
Thanks, Yumi Smile

12-06-2010 01:32 AM
Find all posts by this user Quote this message in a reply
PK8 Offline
Junior Member
**
Posts: 13
Joined: Oct 2010
Post: #162
RE: XThreads
I just got an idea for XThreads. It kind of came about when I was making an extra thread field. I'm not sure if it's already possible or if it might seem like a silly idea but how about thread field-dependent thread fields? Like... thread fields that would appear when certain options from other thread fields are selected. Tongue

Edit (1/1/11 @ 4:11pm est): I forgot to say this but I wish I had known a bit about XThreads sooner. This can do everything I really wanted to do with a forum and then some. Brilliant plug-in.

Edit 2 (4:17pm est): I just got another idea which is sort of based on a vBulletin plugin I used to use for a vB forum. Would it be possible to tag selected threads with thread field options via Inline Moderation?
(This post was last modified: 01-02-2011 07:17 AM by PK8.)
01-02-2011 06:41 AM
Find all posts by this user Quote this message in a reply
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #163
RE: XThreads
(01-02-2011 06:41 AM)PK8 Wrote:  I just got an idea for XThreads. It kind of came about when I was making an extra thread field. I'm not sure if it's already possible or if it might seem like a silly idea but how about thread field-dependent thread fields? Like... thread fields that would appear when certain options from other thread fields are selected. Tongue...

Nice idea for the main plugin PK8, I agree that feature would be great.
You could also do it now with the "template conditionals/ php in templates" plugin and some if statements.*

*This idea (above) would usually require refreshing the page, when certain option are selected; Dynamic "Ajax thread field-dependent thread fields" would be amazing**

**As long as your users have js enabled.
01-02-2011 09:25 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #164
XThreads attach.php
I have been continuing to work on my XThreads downloads stats, and I have this piece of code working(ish) in the xthreads_attach.php. It gives me the dls on date in a queryable table. I use that table to run queries for graphs using the open graphs API.

On each download click it writes to a table I made in phpmyadmin, and gives me daily stats on those threads where there has been a download on that day. However, I am struggling to put this into xthreads_attach.php as a plugin, rather than editing the core files, and wondered if Zinga (or anyone who knows ) could give me a tip on how to combine this into Xthreads?

At the moment I have my code as so:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// connect to DB
	define('TABLE_PREFIX', $config['database']['table_prefix']);
	$db->connect($config['database']);
	$db->set_table_prefix(TABLE_PREFIX);
	$db->type = $config['database']['type'];
// Stuff added by me
	$result = mysql_query("SELECT tid , uid FROM mybb_xtattachments WHERE aid=".$aid);
	$attachment = mysql_fetch_assoc($result);
	$threadid = $attachment['tid'];
	$postuserid = $attachment['uid'];
//end of first bit of my stuff
	
	// so we do all the above just to run an update query :P

<-- my query goes here -->
}
	$db->write_query('UPDATE '.$db->table_prefix.'xtattachments SET downloads=downloads+1 WHERE aid='.intval($aid), 1);


	$db->close();
	unset($db, $GLOBALS['mybb']);
}


I would prefer to NOT have to change the XThreads files with core edits like this, but I don't know much about hooks.

Also, I am not sure if its my install, but in the xtattchments table in the db all the user ids are 0?

Hmm, I see this in uploads_php

Code:
// note, $uid is used purely for flood checking; not verification, identification or anything else
function &upload_xtattachment(&$attachment, &$tf, $uid, $update_attachment=0, $tid=0)


So I guess its not my install - I am on version 1.337 though. (Looks hopeful for 1.4)



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 01-03-2011 07:51 AM by leefish.)
01-02-2011 10:44 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: #165
RE: XThreads
(01-02-2011 06:41 AM)PK8 Wrote:  I just got an idea for XThreads. It kind of came about when I was making an extra thread field. I'm not sure if it's already possible or if it might seem like a silly idea but how about thread field-dependent thread fields? Like... thread fields that would appear when certain options from other thread fields are selected. Tongue
Thanks for the idea - I think it's best to do with conditionals though.
Can put your own logic in templates for Javascript if you want it to work with the editor.

(01-02-2011 06:41 AM)PK8 Wrote:  Edit 2 (4:17pm est): I just got another idea which is sort of based on a vBulletin plugin I used to use for a vB forum. Would it be possible to tag selected threads with thread field options via Inline Moderation?
Next version will allow modifying via custom moderator tools, so you could, theoretically, make a tool to do mass editing.  Unfortunately, this requires the admin to create a tool specific for the situation of course.

(01-02-2011 10:44 AM)leefish Wrote:  I would prefer to NOT have to change the XThreads files with core edits like this, but I don't know much about hooks.
Unfortunately xthreads_attach.php doesn't have any hooks.  I might provide an option to enable them when I make a better plugin API for XThreads, but otherwise, xthreads_attach.php was designed to be as lightweight as possible, so it tries to avoid loading unnecessary stuff (including plugins).

So your only option is to stick with the code edit.  That section of code is unlikely going to change, so if you like using GNU diff/patch, that'll work too (if not, don't worry about it).

(01-02-2011 10:44 AM)leefish Wrote:  Also, I am not sure if its my install, but in the xtattchments table in the db all the user ids are 0?
It's a known bug, which won't be there in v1.40.
If you want to patch it, just apply this one change to inc/xt_upload.php https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/commit/90317bec0c0b8ad531603a668982a97cfde77
It doesn't actually really affect XThreads behavior much, but it might for other plugins that decide to rely on it.
You can try fixing existing data with the following query:

SQL Code
UPDATE mybb_xtattachments a INNER JOIN mybb_threads t ON a.tid=t.tid SET a.uid=t.uid WHERE a.uid=0 AND a.tid!=0

(This post was last modified: 01-04-2011 06:02 PM by ZiNgA BuRgA.)
01-04-2011 06:02 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #166
RE: XThreads
(01-04-2011 06:02 PM)ZiNgA BuRgA Wrote:  
(01-02-2011 10:44 AM)leefish Wrote:  I would prefer to NOT have to change the XThreads files with core edits like this, but I don't know much about hooks.
Unfortunately xthreads_attach.php doesn't have any hooks.  I might provide an option to enable them when I make a better plugin API for XThreads, but otherwise, xthreads_attach.php was designed to be as lightweight as possible, so it tries to avoid loading unnecessary stuff (including plugins).

So your only option is to stick with the code edit.  That section of code is unlikely going to change, so if you like using GNU diff/patch, that'll work too (if not, don't worry about it).

OK, I will keep the original on file, and when we get an upgrade swap it over, upgrade, and drop my code back in. Good to hear its not likely to change as I have spent a long time on this Smile

(01-04-2011 06:02 PM)ZiNgA BuRgA Wrote:  
(01-02-2011 10:44 AM)leefish Wrote:  Also, I am not sure if its my install, but in the xtattchments table in the db all the user ids are 0?
It's a known bug, which won't be there in v1.40.
If you want to patch it, just apply this one change to inc/xt_upload.php https://github.com/zingaburga/XThreads-M...https://github.com/zingaburga/XThreads-MyBB-Plugin/commit/90317bec0c0b8ad531603a668982a97cfde77
It doesn't actually really affect XThreads behavior much, but it might for other plugins that decide to rely on it.
You can try fixing existing data with the following query:

SQL Code
UPDATE mybb_xtattachments a INNER JOIN mybb_threads t ON a.tid=t.tid SET a.uid=t.uid WHERE a.uid=0 AND a.tid!=0


EXCELLENT. That worked perfectly, thank you Smile


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 01-04-2011 07:24 PM by leefish.)
01-04-2011 07:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RocketFoot Offline
Senior Member
****
Posts: 338
Joined: Jul 2010
Post: #167
RE: XThreads
I deployed the patch described above, but can you explain where to run the query?  I've run queries on my IPB software from inside the ACP, but I'm not sure how to do it on MyBB.  (I'm using cPanel if that matters)

[Image: gallery_2_628_39582.jpg]
(This post was last modified: 01-04-2011 09:41 PM by RocketFoot.)
01-04-2011 09:35 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #168
RE: XThreads
Hi Rocketfoot, hopefully you have access to phpmyadmin. Go to the database in phpmyadmin, go to the xtattachments table. Export a copy of the table just in case...then, go to the SQL tab, clear any data in the tab and paste in the code from ZingaBurga. Hit go.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 01-04-2011 09:51 PM by leefish.)
01-04-2011 09:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RocketFoot Offline
Senior Member
****
Posts: 338
Joined: Jul 2010
Post: #169
RE: XThreads
Thanks!  That seems to have done the trick!  I just never ran a query on My BB yet!  LOL...now I know! Biggrin

[Image: gallery_2_628_39582.jpg]
01-04-2011 10:12 PM
Find all posts by this user Quote this message in a reply
Lich_king2 Offline
Member
***
Posts: 52
Joined: Jun 2010
Post: #170
RE: XThreads
I don't why, but any changes that apply using Xthreads doesn't work on the selected forum. I reinstalled, reactivated plugin and it's same.

It's time for ZeuBB!Tux
Nota Bene: If people want to be successful they need to help each other.
01-05-2011 04:27 AM
Find all posts by this user Quote this message in a reply


Forum Jump: