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.

Gutspiller 01-16-2003 04:20 AM

I installed this hack and it works great with my forum! :banana:

I have one question though. The way that it works, I take it it does a type of search for these "similar threads" I want to change the way it works and make it more precise by only searching the titles and not the contents of the threads. This way it wont matter the contents of the post is, the similarity will have to occur in the title of the threads.

Can somebody help me how to do this? It should be fairly easy, I just have any clue. :(

Please help.

Elvis 01-16-2003 04:52 AM

I'd strongly suggest replacing:


Quote:

ORDER BY dateline DESC

with


Quote:

ORDER BY threadid DESC

on a board that dates back a couple years worth of posts... this seems to help show only the most recent 'similar threads'

Boofo 01-16-2003 08:37 AM

All that will do is display it in order by tread title instead of order by date. I think it only looks at the thread title for matches already, doesn't it? ;)

Elvis 01-16-2003 12:04 PM

Quote:

Originally posted by Boofo
All that will do is display it in order by tread title instead of order by date. I think it only looks at the thread title for matches already, doesn't it? ;)

a) by 'threadid DESC' it orders the found threads in descensing thread ID order... which gives you the most recent threads, in order that they have been started, not replied to. It's much more relevant to pull up things from this year.. than say 2001.


b) Yes, but Im not changing WHAT it searches, just how it orders them.

Gutspiller 01-18-2003 04:09 PM

Can somebody still help me with my first question? I want it so that the way it ranks similar threads is done by thread title alone and not by the contents of the thread. The way my forum is setup the current searching isn't as good as if it was based on the title of the thread alone.

Anybody? :(

Boofo 01-18-2003 04:27 PM

That's how it already searches.

Gutspiller 01-18-2003 07:41 PM

Quote:

Originally posted by Boofo
That's how it already searches.
hmmm. :surprised:

Well how about making the words that are before each other more important that the following words.

So a title that is "Unreal II movie"

wont bring up similar threads, just because their title has the word "movie" in it. Movie isn't going to be important. But other titles that have "Unreal" are going to be more important .

Can you do that?

Boofo 01-18-2003 07:46 PM

It should bring up anything that has "movie" or "Unreal" in it. And even "II". I have mine set to show 10 threads instead of the default 5. Maybe that will help? It would be kind of hard to selectively pick the order of words in the title, I think.

Gutspiller 01-18-2003 09:27 PM

Quote:

Originally posted by Boofo
It should bring up anything that has "movie" or "Unreal" in it. And even "II". I have mine set to show 10 threads instead of the default 5. Maybe that will help? It would be kind of hard to selectively pick the order of words in the title, I think.
OK, I changed it to 10 and out of those ten threads, only 2 reffer to Unreal or Unreal 2. Is it possible to have it use the first words of the title? I mean movie could be anynumber of threads. Most threads are going to have the important words first. So I was hoping something could be done about having it more relative to the other words. This way the closer they are to the beginning of the thread title, the higher ranking they have in the search. Is something like this possible?

I was also noticing that the previous version of this hack supported descriptions, but I didn't happen to notice anywhere in the code to turn that feature on. Is it in there and I missed it or does V2 not support descriptions?

Xyphen 01-24-2003 07:54 PM

Ok, I have a test forum, where there are only 2 threads -_- so far, but the smiliar threads thing doesn't show up on showthread? why, help please, I am using vb2.2.9, there are no errors, just that smiliar threads don't show up, nothing shows up, everything is exactly the same as it was before i installed the hack, I even replied in both threads and made a new thread, doesn't work at all. help plz..

andyrose 02-24-2003 05:43 AM

I installed this hack at www.neomega.net/forum, and it works like a charm. Excellent job.

FleaBag 02-27-2003 08:45 PM

OK I'm having a problem with the hack...

As you can see here, the table for the similar threads is created, but theres no links or information in it. As far as I know everything is installed and working correctly - I had this installed on 2.2.8, but now I've upgraded to 2.3.0 it doesn't work. Any help would be appreciated, thanks.

L-Mane 02-28-2003 10:34 PM

I get this error at the bottom of threads but the hack works...hmmmm

rfield ON userfield.userid=user.userid ".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid","")." LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid WHERE $postids ORDER BY dateline $postorder "); if (!$getperms['cangetattachment']) { $viewattachedimages=0; } $postbits = ''; $counter=0; $postdone = array(); $sigcache = array(); while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) { if ($postdone[$post[postid]]) { $counter--; continue; } else { $postdone[$post[postid]]=1; } $postbits .= getpostbit($post); } $pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage".iif(isset($h ighlight), "&highlight=$highlight", "")); $DB_site->free_result($posts); unset($post); unset($sigcache); //don't need the signature cache anymore if ($thread[open]) { $replyclose="{replyimage}"; } else { $replyclose="{closedthreadimage}"; } if ($thread[lastpost]>$bbuserinfo[lastvisit]) { // do blue arrow link if ($firstnew) { $newpostlink="#newpost"; } else { $newpostlink="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=newpost"; } eval("\$firstunread = \"".gettemplate("showthread_firstunread")."\";" ); } else { $firstunread=""; } if ($forum[allowratings]) { eval("\$threadrateselect = \"".gettemplate("showthread_threadrate")."\";") ; } else { $threadrateselect = " "; } if (ismoderator($thread['forumid']) or $getperms['canopenclose'] or $getperms['candeletethread'] or $getperms['canmove']) { eval("\$adminoptions = \"".gettemplate("showthread_adminoptions")."\"; "); } else { $adminoptions = " "; } getforumrules($forum,$getperms); updateuserforum($thread['forumid']); eval("dooutput(\"".gettemplate("showthread")."\"); "); ?>

L-Mane 03-02-2003 05:09 AM

Uppin

FleaBag 03-04-2003 09:42 PM

Velocd, any ideas?

iggy123 03-07-2003 07:15 PM

Hmmm. I am having real problems with this hack. I have done as the instructions say but at the bottom of the page i can't see anything.
I edited the showthread.php - as i couldn't find the
Code:

II.        In showthread.php, under the "showthread" NOT showpost section
        a.  Find:


makeforumjump()

I don;t get any error messages and everything appears to be working fine
But when i post a new thread nothing shows up under neath - Tell me I am doing something simple?

i am running 2.3.0 http://texasmiltia.net/forums/

iggy123 03-07-2003 07:27 PM

D'oh fixed it!!! I am an assh01e LOL I forgot to add the

$similarthreads

to the showthread template.... looks cool now thnx

Mike11212 03-08-2003 03:33 AM

i think i posted my last question in the wrong thread.
Is there a way to hide certain forums from being displayed?

walah.net 03-08-2003 08:47 AM

Nice Hack .. Thank You :)

Zachery 03-08-2003 06:16 PM

.

Gutspiller 03-08-2003 08:42 PM

Quote:

Originally posted by Faranth
.
Quit spamming Faranth. Sh|t. You fill my email box up and waste my time for me to come to the thread to see what people have said and it's just a F'ing period. :tired:

Mike11212 03-08-2003 11:37 PM

anyone know how to hide specific forums?

FleaBag 03-10-2003 05:34 AM

Finally got this working in 2.3.0... I think the Attachments As Files hack was messing it up.

Shepski 03-11-2003 11:31 AM

marvelous hack, installed on my v2.2.6 with no problems at all :)

well done m8

PurpleCow 04-12-2003 06:48 AM

Does this work with the current stable release of vB 2.3.0 ??

I have downloaded this and would like to install !

Thank much

AlexanderT 04-13-2003 09:05 AM

it works in 2.3.0.

Mireade 04-22-2003 12:11 PM

Very great hack !

What about putting this kind of possibility on a non vb page ?
Would it be difficult ?

And another suggestion to make it more "server friendly" :

Would it be possible to have just a link on which the user could click to get the related threads (so the query would not be systematic but just on demand) ?

Thank you

ChurchMedia 05-12-2003 07:39 PM

I'm really looking forward to getting this to work. I'm getting this error, however:

Fatal error: [] operator not supported for strings in /path/to/showthread.php on line 499

I'm running MySQL 3.23.41. I can send my showthread.php if it would help.

Thanks!!

hypedave 05-16-2003 04:17 PM

I have this hack running fine on one of my boards, I did the same install on another board, and my similar threads are not showing up, here is a link to check it out

http://boards.bluegoop.net/showthrea...threadid=10607

at the bottom you will see that it shows the Similar threads part

Vindicator 05-18-2003 10:56 PM

I have followed the instructions over and over, but I simply don't get an output. Seems to make no difference what so ever :(




Edit:
I have the obligitory $similarthreads in the showthread template, but this generates nothing.

Edit:
Sorted, started with a clean showthread.php file.

Thanks.

Vindi


All times are GMT. The time now is 07:00 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.01879 seconds
  • Memory Usage 1,845KB
  • 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
  • (2)bbcode_code_printable
  • (8)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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