Current time: 09-09-2010, 07:10 AM Hello There, Guest! (LoginRegister)


Similar Threads
04-23-2008, 12:37 PM (This post was last modified: 04-23-2008 12:52 PM by grindcore.)
Post: #1
Similar Threads
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

hardcore music
Visit this user's website Find all posts by this user
04-23-2008, 12:56 PM (This post was last modified: 02-25-2009 08:19 PM by dvb.)
Post: #2
RE: Similar Threads
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.

[Image: donation_drive_sig.png]
Creativity is a drug I cannot live without.

Visit this user's website Find all posts by this user
04-23-2008, 01:03 PM
Post: #3
RE: Similar Threads
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.

hardcore music
Visit this user's website Find all posts by this user
04-23-2008, 01:57 PM (This post was last modified: 04-23-2008 01:58 PM by grindcore.)
Post: #4
RE: Similar Threads
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!

hardcore music
Visit this user's website Find all posts by this user
04-24-2008, 02:54 AM
Post: #5
RE: Similar Threads
In showthread.php, find:
PHP Code:
        $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:
PHP Code:
        $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']}
        "
); 

[Image: sig.php?mybb]
MyBB is on Facebook and Twitter
Hosting available, PM for details
Visit this user's website Find all posts by this user
04-24-2008, 11:16 AM
Post: #6
RE: Similar Threads
Thank you so much for this hack! It works perfectly.

Cheers,
Jody

hardcore music
Visit this user's website Find all posts by this user
02-25-2009, 02:40 PM
Post: #7
RE: Similar Threads
Can i use this snippet to my MYBB 1.44

Electrical mechanical computer science electronics civil engineering seminar topics
Visit this user's website Find all posts by this user
02-25-2009, 05:00 PM
Post: #8
RE: Similar Threads
Probably not.

My Personal Site - Twitter - My Plugins
MyBB Support Team Lead. Ahhh yeeah.
Visit this user's website Find all posts by this user
02-26-2009, 01:05 AM
Post: #9
RE: Similar Threads
do i get another method

Electrical mechanical computer science electronics civil engineering seminar topics
Visit this user's website Find all posts by this user


Forum Jump:


User(s) browsing this thread: 1 Guest(s)