Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Closed Thread
 
Thread Tools
=V.2= vB3 Similar Threads Details »»
=V.2= vB3 Similar Threads
Version: 1.00, by Velocd Velocd is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 12-20-2002 Last Update: Never Installs: 59
 
No support by the author.

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:
  • It no longer compares threads via a similarity or priority level, but rather using a MySQL string-comparison function.
    I experienced no slow downs on any pages, and many of my pages seem to be generating .20 faster (from the old version).
  • The comparison between threads is even more accurate and efficient, and best of all requires no toggling of a priority setting like the previous version. The threads are now searched via the one and only query, making things faster.
  • The hack has been tested on 2.2.6 and 2.2.9, and also does not require the use of PHP function trim(), so older versions of PHP should deal no trouble.
  • The overall appearance of the hack has been enhanced to look more vB3 as well

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:
ALTER TABLE `threadTYPE MYISAM 

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #82  
Old 12-29-2002, 06:51 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just thought of some suggestions that could be done, if you are up to hacking yourself, otherwise I might think of implementing this later. You could either do what Spark2 suggested here, or make it appear in a small pop-up window. To do this create a seperate PHP file known as similarthread.php, then inside contain all the data of codechunk.txt, but at the top of the file insuring that global.php is being required, error-reporting enabled, and surrounding the file by the php open and close tags. Then in the template that contains template2.txt, put the html, $header, $headerinlcude, body, and other basic tags in it. Then in the showthread.php, make a link appearing like this:
Code:
<a href="#" onClick="window.open('similarthread.php?s=&threadtitle=$thread[title]','javascript_1','width=x,height=y,scrollbars=1,resizable=no,menubar=no,toolbar=no'); return false;"><u>Click to view similar threads</u></a>

Just configure the "width" and "height" attributes, and also whatever you want to use as a link caption (whether it be text or image).

Also in similarthread.php, change the variable "$thread['title']" in the query WHERE clause to $threadtitle (not sure if arrays can be passed through URL's)

This method at least it gives the users their option of viewing the similar threads, but doesn't decrease the output speed of the thread.
  #83  
Old 12-29-2002, 06:56 AM
VirtueTech VirtueTech is offline
 
Join Date: Oct 2001
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not a bad thought. Just to let you know I wasn't trying to down this hack. You did a wonderful job. I was just making you all aware of the problem large forums like myself would have.

Thanks for the alternative Spark2 and Velocd!
  #84  
Old 12-29-2002, 11:44 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

VirtueTech, here are my stats:
[high]Page generated in 0.19562302 seconds (80.92% PHP - 19.08% MySQL) with 20 queries[/high]

Is not the script. Feel free to check my board for time and performance.
Cheers.
  #85  
Old 12-29-2002, 01:03 PM
VirtueTech VirtueTech is offline
 
Join Date: Oct 2001
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by TECK
VirtueTech, here are my stats:
[high]Page generated in 0.19562302 seconds (80.92% PHP - 19.08% MySQL) with 20 queries[/high]

Is not the script. Feel free to check my board for time and performance.
Cheers.
Thats because you have like 20 forums. I have over 190. On top of that there is over 1.4 million posts. Thus the delay in going through the titles even though it is indexed. Also the reason why "freddie" used the method he did in vb3
  #86  
Old 01-07-2003, 11:18 PM
ChurchMedia's Avatar
ChurchMedia ChurchMedia is offline
 
Join Date: Dec 2002
Location: Las Cruces, NM
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm getting this error:

Fatal error: [] operator not supported for strings in /home/virtual/site6/fst/var/www/html/community/forum/showthread.php on line 500
  #87  
Old 01-09-2003, 11:22 PM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack, thanks!

I was experiencing some slowness as well, so I tried to come up with a way to limit this feature to only selected forums.

Basically, at the start of the codechunk.txt, put this...

PHP Code:
if ($curforumid==or $curforumid==or $curforumid==4) {
$similarforum "2,3,4"//Limit search to these forums 
...replacing the curforumid numbers with whatever forums you want to have include this feature, and the similarforum numbers to whatever forums you want the feature to search for matches.

At the end of codechunk.txt put this:

PHP Code:

Now delete everything from...

PHP Code:
$forumperms $DB_site->query(
...down to:

PHP Code:
$iforumperms 'AND thread.forumid IN( ' implode',' $iforumperms ) . ' )';

As its unnecessary to check forum permissions when you're specifying what forums to find matches in.

Now, find this line:

PHP Code:
            WHERE thread.threadid<>$thread[threadid$iforumperms 
And replace it with this:

PHP Code:
            WHERE thread.threadid<>$thread[threadid
Then find:

PHP Code:
            AND thread.visible=
And after that add:

PHP Code:
            AND thread.forumid IN ($similarforum
To only allow the hack to search for similar threads in those specified forums. However, it's still pretty slow for me, so I'm thinking something's not working right.

Any help would be greatly appreciated!
  #88  
Old 01-09-2003, 11:25 PM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Also, another question - is there a way to omit specific words from the matching process? Or perhaps a way to add keywords to threads and allow matching to those?

I'm just trying to find a way for the matching process to be more accurate on my forums, as currently it's not overly accurate.
  #89  
Old 01-10-2003, 03:32 AM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by VirtueTech


Thats because you have like 20 forums. I have over 190. On top of that there is over 1.4 million posts. Thus the delay in going through the titles even though it is indexed. Also the reason why "freddie" used the method he did in vb3
You are right. I tested this on a huge board also... and is slow, unfortunatelly.
  #90  
Old 01-13-2003, 06:14 PM
maestrosdelweb maestrosdelweb is offline
 
Join Date: Sep 2002
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack.

I'm installing it right now.
  #91  
Old 01-15-2003, 10:41 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mmm... I am using version 1 of this hack, and it is working well on a reasonably sized forum (half a million posts). Should I upgrade? I am loathed to since everything is working fine.
Closed Thread


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:55 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04932 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (9)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete