MyBB Hacks

Full Version: XThreads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(05-12-2011 01:18 PM)leefish Wrote: [ -> ]Ok, thank you. I will have a go at that, see what I come up with. Will I still be able to use the filters like in the forum display or would that require more files to be included? If so, which ones?
You'd have to manually build the query at this point.  There's no convenient XThreads function to do the job from memory.

Example:

PHP Code:
$query_add = '';
if($mybb->input['filtertf_pfcat']) $query_add .= ' AND tfd.pfcat="'.$db->escape_string($mybb->input['filtertf_pfcat']).'"';

...

// modify the query on portal.php which grabs threads
$db->query('SELECT ... '.$query_add);

I tried to install it on my local server (I'm using xampp)

and when I try to active this plugin it gives me this problem

PHP Code:
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci' at line 4
Query:
    CREATE TABLE mybb_threadfields_data ( tid int(11) unsigned not null , PRIMARY KEY (tid) ) TYPE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci 


Could someone help me?

What is your MySQL version?
(05-13-2011 04:09 AM)RateU Wrote: [ -> ]What is your MySQL version?

MySQL: 5.5.8

Hope you can help, I want to create a blog
Try to change the TYPE to ENGINE in inc/xthreads/xt_install.php
hmm can i ask if something like the image will depend on the value of another XThread field?

e.g.
2 images:
Image 0 - (Value must be 0)
Image 1 - (Value must be 1)

Field A has a value of 1
Field B will pull the value of Field A and will result to Image 1

or anything similar to it Biggrin
is it possible for example, Field B is hidden, then its html form value will be pulled from Field A?

sorry for too many questions xD
if there's a need for php edit, demo please xD
Does the user need to upload the image after she/he set the value of field A?
I'm not entirely sure on what you're getting at.  If there's two mutually exclusive images, why not combine them into one?
no the user don't need to upload it
the image will just come from another XThread field which is an image..

well it is somewhat similar to Related threads but the difference is, the user may specify what specific thread should a thread be mutually related (and where to pull the image) from.

sorry for late reply Biggrin
Oh, you mean pull a field from another thread?
If so, I think you're going to need to modify code - XThreads only pulls fields from the current thread.

Or do you mean you have a bunch of images and you want a field which allows the user to choose one of them?  If that's the case, you may as well get the user to upload the selected image in a specific field instead?
Reference URL's