vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   =V.2= vB3 Similar Threads (https://vborg.vbsupport.ru/showthread.php?t=46860)

Velocd 12-29-2002 06:51 AM

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. ;)

VirtueTech 12-29-2002 06:56 AM

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! :)

TECK 12-29-2002 11:44 AM

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.

VirtueTech 12-29-2002 01:03 PM

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

ChurchMedia 01-07-2003 11:18 PM

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

X-Fan 01-09-2003 11:22 PM

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! :)

X-Fan 01-09-2003 11:25 PM

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.

TECK 01-10-2003 03:32 AM

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.

maestrosdelweb 01-13-2003 06:14 PM

Great hack.

I'm installing it right now.

Erwin 01-15-2003 10:41 AM

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.


All times are GMT. The time now is 03:55 PM.

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.01182 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (8)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete