![]() |
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. ;) |
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! :) |
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. |
Quote:
|
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 |
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:
At the end of codechunk.txt put this: PHP Code:
PHP Code:
PHP Code:
Now, find this line: PHP Code:
PHP Code:
PHP Code:
PHP Code:
Any help would be greatly appreciated! :) |
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. |
Quote:
|
Great hack.
I'm installing it right now. |
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.
|
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. |
I'd strongly suggest replacing:
Quote:
with Quote:
on a board that dates back a couple years worth of posts... this seems to help show only the most recent 'similar threads' |
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? ;)
|
Quote:
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. |
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? :( |
That's how it already searches.
|
Quote:
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? |
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.
|
Quote:
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? |
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..
|
I installed this hack at www.neomega.net/forum, and it works like a charm. Excellent job.
|
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. |
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")."\"); "); ?> |
Uppin
|
Velocd, any ideas?
|
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 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/ |
D'oh fixed it!!! I am an assh01e LOL I forgot to add the
$similarthreads to the showthread template.... looks cool now thnx |
i think i posted my last question in the wrong thread.
Is there a way to hide certain forums from being displayed? |
Nice Hack .. Thank You :)
|
.
|
Quote:
|
anyone know how to hide specific forums?
|
Finally got this working in 2.3.0... I think the Attachments As Files hack was messing it up.
|
marvelous hack, installed on my v2.2.6 with no problems at all :)
well done m8 |
Does this work with the current stable release of vB 2.3.0 ??
I have downloaded this and would like to install ! Thank much |
it works in 2.3.0.
|
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 |
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!! |
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 |
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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|