The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
=V.2= vB3 Similar Threads Details »» | |||||||||||||||||||||||||
vB3 Similar Threads =Version 2=
by Velocd This hack, as well all my other vB2 hacks, I no longer provide support for (being I run vB3 and it's too much hassel to debug vB2). When vB3 Release Candidate comes out, by request I might convert some of my hacks. Update - Version 2.1 View this post for complete information. Description: I recoded the old vB3 Similar Threads hack earlier today, realizing a much better and enhanced method of making it work. Also, I made a new thread for this hack mainly so it would be better known, since the old one had many unsolved issues. Improvements:
The MySQL function MATCH..AGAINST requires MySQL version 3.23.23 or later, else the hack will not operate. Screenshots: Refer to the .zip, they are located inside. Upgrading? If you are upgrading from the old version, just replace the codechunk.txt file in the location of the old chunk, as well replacing the templates. --------------- Remember, if you use this hack on your forum, please click the install button! ^__^ side note: once installed, the similar-thread box will not show until you start replying to threads or create new ones. I predict this has something to do with the altering of the field title to FULLTEXT side note 2: if for some reason you are getting an error about FULLTEXT not being functionable on your thread table, you are running a non-MyISAM table type, and thus must be converted. Run this query to do so: PHP Code:
Show Your Support
|
Comments |
#2
|
||||
|
||||
Nice....i dont hack my board any more though....
|
#3
|
||||
|
||||
In the install file for this hack, you said to do this:
Code:
c. Modify the values "$limit" and "$type" to your preference. |
#4
|
||||
|
||||
Also, I replied to a thread, but no Similar thread box showed up. Will it only show "New" threads that are similar, or will it pick up the old ones once the threads are created or replied to?
EDIT: I got it working. I had to put the code under "Show Threads" instead of "Show Posts", like you have in your install file. Is there a way to get the last poster to list also? |
#5
|
||||
|
||||
Thanks for making a better hack!!
|
#6
|
||||
|
||||
Thanks
Satan |
#7
|
||||
|
||||
With your hack, you will display all private forum threads, if they match the text. You need to use perms for this in order to make it efficient.
I install it, but heavily modified based on forum perms. Here it is the code I used: Code:
$similarthreads = ''; $similarthreadbits = ''; $threadscount = 0; $forumperms = $DB_site->query(" SELECT forumid,canview FROM forumpermission WHERE usergroupid=$bbuserinfo[usergroupid] "); while ( $forumperm = $DB_site->fetch_array( $forumperms ) ) { $ipermcache["$forumperm[forumid]"] = $forumperm; } $DB_site->free_result( $forumperms ); unset( $forumperm ); $getforums = $DB_site->query(" SELECT forumid,parentid,displayorder FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder "); while ( $getforum = $DB_site->fetch_array( $getforums ) ) { $iforumcache["$getforum[parentid]"]["$getforum[displayorder]"]["$getforum[forumid]"] = $getforum; if ( !isset( $ipermcache["$getforum[forumid]"]['canview'] ) ) { $iforumperms[] = $getforum['forumid']; } } $DB_site->free_result( $getforums ); unset( $getforum ); if ( !empty( $iforumperms ) ) { $iforumperms = 'AND thread.forumid IN( ' . implode( ',' , $iforumperms ) . ' )'; } $otherthreads = $DB_site->query(" SELECT thread.threadid,thread.forumid,thread.title,thread.replycount,thread.postusername,forum.title as forumtitle FROM thread LEFT JOIN forum ON( forum.forumid=thread.forumid ) WHERE MATCH( thread.title ) AGAINST( '" . addslashes( $thread['title'] ) . "' ) AND thread.visible=1 AND thread.open<>10 AND thread.threadid<>$thread[threadid] $iforumperms ORDER BY dateline DESC LIMIT 5 "); while ( $otherthread = $DB_site->fetch_array( $otherthreads ) ) { $threadscount++; eval( '$similarthreadbits .= "' . gettemplate( 'showthread_similarthreadbit' ) . '";' ); } if ( !empty( $threadscount ) ) { eval( '$similarthreads = "' . gettemplate( 'showthread_similarthreads' ) . '";' ); } BTW, thanks for a great hack! |
#8
|
||||
|
||||
phpmyadmin said:
The used table type doesn't support FULLTEXT indexes Why? |
#9
|
||||
|
||||
nice hack - I won't be installing it though.
|
#10
|
||||
|
||||
Heh, thanks for providing that Teck, I had figured another way to do it but a bit tacky and lazy on my part
PHP Code:
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|