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)

Boofo 12-21-2002 10:38 PM

Ok, I see. Sorry I missed that. :) But where I have it now, it seems to be a lot more accurate. It is supposed to pick words out of the title and use those, right? Well, now it does that even better. Any word in the title and it pulls up a Similar thread with the same word in it. Isn't that how it is supposed to work? And will it be alright where I have it now or will it mess with anything, do you know? :)

Auero 12-21-2002 10:41 PM

=/ Okay, it's not working at all for me. I've followed the install file exactly and I still cant get anything to display....????

Velocd 12-22-2002 01:27 AM

@boofo: you're fine ;)

@auero: Make sure you have placed the variable $similarthreads in your showthread template.

Give me a link to your forums, and I'll check it out if it is still not working.

ptm 12-22-2002 03:29 AM

Whew!!! :D :D Got it working perfectly. :)

Bison 12-22-2002 05:40 AM

Quote:

Originally posted by Boofo
Rolodex, try putting the chunkcode above this line and see if that helps. It fixed my forumjump problem and the threads are only showing similar threads if they really ARE similar. Let me know if it works for you.

Code:

eval("dooutput(\"".gettemplate("showthread")."\");");

So far, so good ... but occassionally when I click on a thread link the page comes up blank. I have to refresh the page or click on the back button to get the pages back ... yikes!

Velocd 12-22-2002 04:01 PM

I just realized a good fix for this hack, to make it more accurate. I noticed with the first version I had it check for similar threads only in the forum which the thread originated in. If you do this with this hack, you get much more valid results, mostly if you have a large forum.

I've updated the instructions to include this, so just re-upgrade the codechunk.txt.

If you want to just do it manually, find (in the codechunk):
PHP Code:

AND thread.visible=

And replace it with:
PHP Code:

AND thread.visible=AND thread.forumid=$thread[forumid


Velocd 12-22-2002 04:11 PM

Actually.. I just realized that if this is done, the displaying of which forum the similar thread is in is pointless.

Although, I just got another good idea: Search the parent forum and all sub-forums within for similar threads, that the thread originates from.

Now if I can only figure out how to do this.... ;)

NTLDR 12-22-2002 05:23 PM

A note on the permissions for this hack. They only work if custom permissions are applied to all forums (which have different permissions) as it ignores inherited permissions. I've had to disable this hack now till they work correctly.

Bison 12-22-2002 08:35 PM

Another question ... why are you pointing the category background in your showthread_simularthreads template to:

<tr align="center" bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" background="https://vborg.vbsupport.ru/images/catagory_backing.gif">

Is there a reason for this, or are you "unknowingly" duplicating the same mistake in every update of this hack?

Velocd 12-23-2002 12:06 AM

It's only one small mistake Rolodex, nobody is perfect, eh? I'm quite lazy as it is, so I'll update it next time I figure it need be. If it's gonna kill you, then well.. I bid you the best farewell ;) j/k

@NTLDR: When you say inherited permissions, do you mean specific permissions geared to user groups? Also, can you give an example of how it is not working? I have user group and forum permissions set, and this hack is working correctly--unless I am overlooking something.

Schorsch 12-23-2002 01:06 AM

thanks!! very nice modification :)

TECK 12-23-2002 01:28 AM

Quote:

Originally posted by Rolodex
Another question ... why are you pointing the category background in your showthread_simularthreads template to:

<tr align="center" bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" background="https://vborg.vbsupport.ru/images/catagory_backing.gif">

Is there a reason for this, or are you "unknowingly" duplicating the same mistake in every update of this hack?

Because he wanted to see if you are checking everything and not install it no matter how.

Velocd, I will recommend your hack as HOTM. :)
Is one of the very few hacks I installed from many out there...

A small recomandation, try to use into the templates the direct variables pulled from the fetched array. No need to redefine them again inside. Look at my code example (permissions)...

Also, for NTLDR, the perms code listed few posts above are set based on my forum settings. I don't use access masks to save a query on all pages (everyone should do the same!!!) So yes, the perms will not be inherited.
Disable the masks, set your perms individually, or even better, write your own set of perms if you want an extra query on showthread.php file (for a total of 4, instead of 3, as it has now the hack). ;)

Velocd 12-23-2002 02:52 AM

Thanks for the comments and suggestion, Teck ;)

I've updated the .zip once again, fixing some minor stuff :p

DrkFusion 12-23-2002 02:55 AM

Great Hack, I installed the first one, I will install this one.

/me clicks install

Bison 12-23-2002 04:08 AM

Quote:

Originally posted by Velocd
It's only one small mistake Rolodex, nobody is perfect, eh? I'm quite lazy as it is, so I'll update it next time I figure it need be. If it's gonna kill you, then well.. I bid you the best farewell ;) j/k
It's not a point of it killing me dude, it just looked like you should have noticed this after the second update ... that's all.

And TECK, you have a way of budding in on sh*t that makes you look even more like the jerk you really are ... sometimes it best to shut the f*ck up when the attention is NOT pointed @ you!

TECK 12-23-2002 07:23 AM

Rolodex, is the way you posted acting like the smart ass. Instead of being normal and posting the error, like:
"Velocd, I noticed this error, I think it should be this way, not this way..."
you decided to show your "superiority".
My example, listed 2 lines above, is a constructive way to correct an issue, not your way, but you cannot realize this.
This guy Velocd made a great addition to vBulletin and instead of being nice and modest you act like the HTML wizo, when is such a small mistake.

Hey, I make those kind of HTML mistakes every day, I'm not as perfect as you are and "I don't notice everything" because, as Velocd said, I'm human. Making a good piece of code (like Velocd's) is alot more important in my eyes then a small template editing typo. I was looking for a solution like this and he made it easy for me because I didn't know I could run a query like the one he wrote... so I also helped him with the perms to make this hack a really good one.
You are right about one thing, I shouldn't waste my time posting to those kind of people like you.

TheComputerGuy 12-23-2002 11:35 AM

I use the Forum Jump, and tried to do what you said to do on page 2...yet..my forumjump still does not show properly...any ideas...

TECK 12-23-2002 01:15 PM

Place the code just about the eval(); and unset the perm and forum cache:
Code:

unset( $iforumcache );
unset( $ipermcache );

// Velocd's code here...

eval("dooutput(\"".gettemplate("showthread")."\");");

It should take care of the problem.

DrkFusion 12-23-2002 01:31 PM

Thanks teck, I was having the same error.

Regards

NTLDR 12-23-2002 02:01 PM

Quote:

Originally posted by Velocd
@NTLDR: When you say inherited permissions, do you mean specific permissions geared to user groups? Also, can you give an example of how it is not working? I have user group and forum permissions set, and this hack is working correctly--unless I am overlooking something.
Example Structure:

-Catagory
--Forum 1

If I set the canview permission for Catagory to no for a usergroup, when using the forum that usergroup cannot see Forum 1, however threads in Forum 1 will still show up as similar threads even if though they can't access the thread.

TECK 12-23-2002 03:31 PM

Lee, is normal. I explained to you where is the prob few posts above.
Get on my board for the fix, if you really really want to use access masks (it will add another query). :)

NTLDR 12-23-2002 03:44 PM

I did try what I thought would account for access masks but it didn't work, probablt the code I used was wrong. I'll take a look at TW.com now, thanks for the info TECK :)

XIanX 12-23-2002 03:59 PM

Quote:

Originally posted by TECK
Lee, is normal. I explained to you where is the prob few posts above.
Get on my board for the fix, if you really really want to use access masks (it will add another query). :)

How is having access masks off on a forum even feasible for most people? I have a admin/mod forum, if I turn access masks off, non admins/mods can view the board.

TECK 12-23-2002 07:30 PM

Set perms individually for each forum. A little longer in the procedure but it will save you a precious query.

TECK 12-23-2002 07:33 PM

Quote:

Originally posted by NTLDR
I did try what I thought would account for access masks but it didn't work, probablt the code I used was wrong. I'll take a look at TW.com now, thanks for the info TECK :)
Heh, I didn't know also. Chen was kind to show me a trick, is pretty complex (at least for me) :D

NTLDR 12-23-2002 08:17 PM

I have to agree the permissions is one of the harder things to accomplish ;)

Have you got a link for the code as I couldn't find it at TW.com.

TECK 12-23-2002 08:31 PM

I will post it in there later on after I test it properly... :)

sparky2 12-24-2002 03:41 AM

Slick hack, but I'd prefer a LINK ~~ rather than assuming each user wants to "view similar threads" every showthread.php page view.

Also, it seems like this hack is a LOT of work just to duplicate functionality that's already built into search.php
(select a subforum // search in titles only )

In showthread.php, you might want (need) to check $searchenabled and $cansearch values
and conditionally null the template if search isn't currently enabled...

but piping it to search.php would take care of:
-- PARENT/sibling title searches
-- permissions
-- runs the title text through BADWORDS

In other words, I'm suggesting that you try this approach:

Create a link to search.php (essentially, a submit button)
& pass post['title'] and forumid as hidden fields
(user sees nothing other than a button, or link, labeled "find similar threads")

Boofo 12-24-2002 03:44 AM

Quote:

Originally posted by sparky2
Slick hack, but I'd prefer a LINK ~~ rather than assuming each user wants to "view similar threads" every showthread.php page view.

Also, it seems like this hack is a LOT of work just to duplicate functionality that's already built into search.php
(select a subforum // search in titles only )

In showthread.php, you might want (need) to check $searchenabled and $cansearch values
and conditionally null the template if search isn't currently enabled...

but piping it to search.php would take care of:
-- PARENT/sibling title searches
-- permissions
-- runs the title text through BADWORDS

In other words, I'm suggesting that you try this approach:

Create a link to search.php (essentially, a submit button)
& pass post['title'] and forumid as hidden fields
(user sees nothing other than a button, or link, labeled "find similar threads")

That sounds interesting. Could you come up with something like that?

boatdesign 12-24-2002 05:12 AM

What are the minimum PHP version and MySQL version requirements for this hack to run? Does it still require PHP 4.1 or will it run on 4.0.6?

TheComputerGuy 12-24-2002 11:28 AM

TECK, thanks for offering what you did, but it doesn't work properly, I tried to uninstall the hack and my forum jump does not work :(

TECK 12-24-2002 11:53 AM

Ok, I enabled the forumJump just for you. I will take it off tomorrow...
Use tester/test to login onto my board and see that it's working. :D

View this forum, for example:
http://www.teckwizards.com/forum/for....php?forumid=5

Velocd 12-24-2002 02:09 PM

@sparky2: yeah, that is certainly possible, but that would cancel out the purpose of this hack being named as "vB3 Similar Threads," as it is suppose to visually look and function like the vB3 feature over at vBulletin.com. Despite the fact that I use a mySQL function MATCH..AGAINST which is probably not as efficient compared to the method Freddie used, which he explained here, but oh well.... this version works well enough for me. :p

Feel free to make that request yourself, as it surely isn't difficult to do. ;)

TECK 12-24-2002 03:18 PM

Well, in VB2 the word table is not indexed... and I think that Freddie used there several LEFT JOIN's which also affect the performance...

TheComputerGuy 12-24-2002 07:56 PM

TECK, you da man as usual, I will retry on a clean showthread file. Your recommendation for where to place it...Do i place chunk.txt right above the last line? I believe that is the part I got confused on

Thank you so much for helping me.

TECK 12-25-2002 01:01 AM

Quote:

Originally posted by TheComputerGuy
Your recommendation for where to place it...Do i place chunk.txt right above the last line? I believe that is the part I got confused on

Thank you so much for helping me.

Notice the [high]// Velocd's code here...[/high] part? Replace that line with the chunkcode (that makes me think of biscuits, heh)...

sparky2 12-27-2002 11:18 AM

Quote:

Originally posted by TECK
Well, in VB2 the word table is not indexed...
Huh???

run this query:
show create table word

and you'll see that both (of the 2) columns are indexed

Velocd 12-27-2002 05:46 PM

Actually it might vary from version sparky2, as both of my columns in the word table are not indexed ;) (running on 2.2.6)

It's not that significant anyway :p

VirtueTech 12-29-2002 06:28 AM

It appears "freddie" was right that this was not the most optimized way to go about "similar threads".

Code:

Query: SELECT

thread.threadid,thread.lastposter,thread.title,thread.postusername,thread.replycount,thread.

lastpost,thread.postuserid,
                        thread.dateline,forum.title AS

ftitle,forum.forumid,forum.parentlist
                        FROM thread
                        LEFT JOIN forum ON (thread.forumid=forum.forumid)
                        WHERE thread.threadid<>256184 AND thread.forumid IN( 192,62,186,65,64,60,187,271,59,61,138,228,127,214,265,67,68,69,70,71,72,73,74,123,142,232,137,227,66,212,145,234,166,125,216,124,215,141,231,139,229,144,233,126,213,131,219,247,129,130,218,146,235,128,217,269,270,140,230,147,236,143,221,135,225,136,226,165,168,167,164,132,220,133,222,134,223,177,178,183,267,13,190,18,162,2,1,12,15,9,4,169,25,188,29,10,19,24,23,33,31,30,53,39,55,56,172,41,42,17,7,27,37,26,16,28,20,32,38,47,179,44,173,303,22,46,45,11,5,51,170,49,50,52,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,149,150,151,152,148,153,154,155,156,157,158,159,160,161,224,174,175,171,180,3,185,264,34,204,21,195,57,304,194,197,198,199,196,200,208,205,201,202,203,268,207,210,211,266,305,273,277,289,278,274,276,275,288,293,292,291,279,286,287,285,298,282,284,290,299,302,301,300,295,297,296 )
                        AND MATCH(thread.title) AGAINST ('old stock from closed store-cocker stuff, lots of redz and more')
                        AND thread.open<>10
                        AND thread.visible=1
                        ORDER BY dateline DESC
                        LIMIT 4
Time before: 0.39137995243073
Time after:  3.3633810281754

Check out the delay! :(

Nice try though. I was excited that you had made this hack...too bad I can't use it. Thanks anyway.

Velocd 12-29-2002 06:40 AM

Ah yes, but I could defiantly understand why with your forums VirtueTechy--they're massive :p

Then again, this version of the hack is more improved from the last, in the major effect that it will compare threads to the current thread viewing until it has gathered whatever you set as "LIMIT", in your case 4. (in contrast to the old version where it would retrieve ALL threads, then compare). Not to mention, your forum must have dozens of threads with similar titles, so this hack shouldn't have a problem finding 4 similar threads and quickly. Then again, each similar thread could be seperated by 300 non-similar threads, thus having to read more.

This hack still proves very useful for the smaller forums, such as mine with 1,938 threads and not the slightest decrease in performance. ;)


All times are GMT. The time now is 11:30 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.02195 seconds
  • Memory Usage 1,844KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (9)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