Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Filter Threads By Thread Prefix - MyBB 1.6 Only
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #20
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only
ok, I tried it - and no result - I think its because it is looking to do a match as the final piece of the query

PHP Code:
1
2
3
4
5
6
7
8
9
$query = $db->query("
				SELECT t.*, t.username AS threadusername, p.displaystyle AS threadprefix, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance
				FROM ".TABLE_PREFIX."threads t
				LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid = t.prefix)
				LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
				WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.prefix='{$thread['prefix']}' AND t.closed NOT LIKE 'moved|%' AND MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') >= '{$mybb->settings['similarityrating']}'
				ORDER BY t.lastpost DESC
				LIMIT 0, {$mybb->settings['similarlimit']}
			");



I tried adding this

PHP Code:
1
2
3
4
5
6
7
8
9
$query = $db->query("
				SELECT t.*, t.username AS threadusername, p.displaystyle AS threadprefix, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance
				FROM ".TABLE_PREFIX."threads t
				LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid = t.prefix)
				LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
				WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.prefix='{$thread['prefix']}' AND t.closed NOT LIKE 'moved|%' AND MATCH (t.prefix) AGAINST ('".$db->escape_string($thread['prefix'])."') OR MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') >= '{$mybb->settings['similarityrating']}'
				ORDER BY t.lastpost DESC
				LIMIT 0, {$mybb->settings['similarlimit']}
			");


and got this error message

Code:
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1191 - Can't find FULLTEXT index matching the column list
Query:
SELECT t.*, t.username AS threadusername, p.displaystyle AS threadprefix, u.username, MATCH (t.subject) AGAINST ('SHOESballetenpointe meshes & uvmaps') AS relevance FROM mybb_threads t LEFT JOIN mybb_threadprefixes p ON (p.pid = t.prefix) LEFT JOIN mybb_users u ON (u.uid = t.uid) WHERE t.fid='46' AND t.tid!='1084' AND t.visible='1' AND t.prefix='2' AND t.closed NOT LIKE 'moved|%' AND MATCH (t.prefix) AGAINST ('2') OR MATCH (t.subject) AGAINST ('SHOESballetenpointe meshes & uvmaps') >= '4' ORDER BY t.lastpost DESC LIMIT 0, 10



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 11-20-2010 09:33 AM by leefish.)
11-20-2010 09:17 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Filtering Thread By Thread Icon - RateU - 11-06-2010, 03:11 AM
RE: Filter Threads By Thread Prefix - MyBB 1.6 Only - leefish - 11-20-2010 09:17 AM

 Standard Tools
Forum Jump: