MyBB Community Forums

Full Version: Similar Threads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Quick question: Do the similar threads only work on 1 forum category?

For instance, I have a news forum and a general forum... Will it pull similar threads from both forums or just from the news OR general? I would love for it to pull relevant threads from both forums, so related news threads would pull if someone mentioned a topic in the general forums. Please let me know if this is already available and I just need to adjust my similar thread sensitivity or this is a new idea entirely.

Thanks and take care,
Jody
I've never used the 'similar threads' feature nor the plugin but some time ago I wanted to see how it's works so I checked the source and if I'm not mistaken it's based on an SQL query that checks ALL threads inside the database.
Oh really? I don't think it's a plugin anymore and came stock on the mybb install. If it does pull threads from throughout the database, I will simply have to increase the sensitivity. I hope that's the case. Thanks for your help.
I have just done some testing setting the sensitivity to '1' and it is still not pulling a similar thread with the same topic in a different category forum. Is there a way for 'similar threads' to display similar threads throughout the board? Thanks in advance!
In showthread.php, find:
		$query = $db->query("
			SELECT t.*, t.username AS threadusername, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance
			FROM ".TABLE_PREFIX."threads t
			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.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']}
		");
Replace with:
		$query = $db->query("
			SELECT t.*, t.username AS threadusername, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance
			FROM ".TABLE_PREFIX."threads t
			LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
			WHERE t.tid!='{$thread['tid']}' AND t.visible='1' 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']}
		");
Thank you so much for this hack! It works perfectly.

Cheers,
Jody
Can i use this snippet to my MYBB 1.44
Probably not.
do i get another method