11-16-2010, 02:25 AM
11-16-2010, 08:06 AM
^ I think {$thread} refers to the thread being viewed in showthread (so it will use the prefix of the current thread) whereas {$similar_thread} refers to the thread in the table row.
Yours may not work if these two use different prefixes I think.
Yours may not work if these two use different prefixes I think.
11-16-2010, 10:16 AM
Hi - I think maybe I was not clear - so here is a pic. I have discovered another issue with this layout though (related to editing)
[attachment=285]
My goal was to show the similar threads - at the moment its calling on similarity of name (which is ok, I can think of things for that) - I think Rateu was looking at similarity of prefix, which is also a good idea. Maybe I could combine them......
[attachment=285]
My goal was to show the similar threads - at the moment its calling on similarity of name (which is ok, I can think of things for that) - I think Rateu was looking at similarity of prefix, which is also a good idea. Maybe I could combine them......
11-16-2010, 11:33 AM
I'm a bit confused at what you're trying to say.
{$thread['prefix']} will take the prefix ID of the thread you're viewing
{$thread['threadprefix']} will display the prefix "name" of the thread you're viewing
{$similar_thread['prefix']} will take the prefix ID of the thread in the similar thread row
{$similar_thread['threadprefix']} will display the prefix "name" of the thread in the similar thread row
In the last code box you posted here, you're mixing the viewing thread's ID with the similar thread's name (so the link may be incorrect if the two are different).
{$thread['prefix']} will take the prefix ID of the thread you're viewing
{$thread['threadprefix']} will display the prefix "name" of the thread you're viewing
{$similar_thread['prefix']} will take the prefix ID of the thread in the similar thread row
{$similar_thread['threadprefix']} will display the prefix "name" of the thread in the similar thread row
In the last code box you posted here, you're mixing the viewing thread's ID with the similar thread's name (so the link may be incorrect if the two are different).
11-16-2010, 03:03 PM
(11-16-2010 11:33 AM)ZiNgA BuRgA Wrote: [ -> ]I'm a bit confused at what you're trying to say.
{$thread['prefix']} will take the prefix ID of the thread you're viewing
{$thread['threadprefix']} will display the prefix "name" of the thread you're viewing
{$similar_thread['prefix']} will take the prefix ID of the thread in the similar thread row
{$similar_thread['threadprefix']} will display the prefix "name" of the thread in the similar thread row
In the last code box you posted here, you're mixing the viewing thread's ID with the similar thread's name (so the link may be incorrect if the two are different).
Hi Zinga - what I am trying to say - in response to the post from RateU
(11-16-2010 01:47 AM)RateU Wrote: [ -> ]For the showthread_similarthreads_bit template, maybe you mean like this, Lee?
HTML Code
<a href="{$forumurl_q}filterxt_prefix={$similar_thread['prefix']}">{$similar_thread['threadprefix']}</a>
Is no, I did not mean to say something else - the snippet I posted worked - so does RateU's. Thats it. I have no idea if it is significant that they both work.
Code:
|
What do I mean by worked? That the prefix shows up (as in pic) and if I click on that prefix while viewing the show thread it shows me all posts in that forum with that prefix.
11-20-2010, 01:32 AM
Ok, I have been doing more testing on this - and now have a change of plan - what I am NOW trying to do is to get the threads with the same prefix OR with matching words of the currently viewed thread to show in the similar threads box.
Currently, the similar threads box is showing matches based on similar words in the title of the selected thread - what I am trying to do is get the threads with the same prefix as the selected thread to show. (It might be an idea to have a limit on it as well) - it makes no difference whether I use RateUs code or mine - it does not find the matching prefixes
http://mybbhacks.zingaburga.com/attachment.php?aid=285
Currently, the similar threads box is showing matches based on similar words in the title of the selected thread - what I am trying to do is get the threads with the same prefix as the selected thread to show. (It might be an idea to have a limit on it as well) - it makes no difference whether I use RateUs code or mine - it does not find the matching prefixes
http://mybbhacks.zingaburga.com/attachment.php?aid=285
11-20-2010, 07:40 AM
You'll need to modify the query to do that.
Find in showthread.php:
Find in showthread.php:
Code:
|
And stick a AND t.prefix=<something> type term in there.
11-20-2010, 08:16 AM
Hi Zinga - if I make it an AND won't that mean that unless a thread has a prefix it won't show up?
....I shall go test....
....I shall go test....
11-20-2010, 08:22 AM
From memory, if a thread doesn't have a prefix, $thread['prefix'] should be 0, meaning the query will find all threads with no prefixes.
11-20-2010, 09:17 AM
ok, I tried it - and no result - I think its because it is looking to do a match as the final piece of the query
PHP Code:
|
I tried adding this
PHP Code:
|
and got this error message
Code:
|