https://www.icyphoenix.com/viewtopic.php?f=35&t=6804
-----------------------------------
portalpez
Wed 23 Dec, 2009 22:56

Similar Topic Only From Current Forum?
-----------------------------------
Hello,

Could anyone help me to understanding or how can i do that the block "similar topics" only shows similar topics from current forum?

Example:

If i am reading a topic in the forum "General suport" the block "Similar topics" only show topics from the forum General suport, and not from all forums....

Thanks you.


-----------------------------------
Mighty Gorgon
Sat 26 Dec, 2009 11:59

Re: Similar Topic Only From Current Forum?
-----------------------------------
There is no switch for this feature.

Currently the only way is edit the similar topics sql.

You can try something like this:

OPEN [b]viewtopic.php[/b]
FIND
[codeblock]		if ($forums_auth_sql != '')
		{
			$forums_auth_sql = ' AND t.forum_id IN (' . $forums_auth_sql . ') ';
		}[/codeblock]
REPLACE WITH
[codeblock]		$forums_auth_sql = ' AND t.forum_id = ' . $forums_id . ' ';[/codeblock]


-----------------------------------
portalpez
Sat 26 Dec, 2009 16:37

Re: Similar Topic Only From Current Forum?
-----------------------------------
Thanks you very much for your help MG!!!!

Only a little correction: forums_id is forum_id and whit this run well.

OPEN [b]viewtopic.php[/b]
FIND
[codeblock]
if ($forums_auth_sql != '')
        {
            $forums_auth_sql = ' AND t.forum_id IN (' . $forums_auth_sql . ') ';
        }[/codeblock]
REPLACE WITH
[codeblock]
if ($forums_auth_sql != '')
		{
			$forums_auth_sql = ' AND t.forum_id IN (' . $forum_id . ') ';
		}[/codeblock]


Now the similar topics is more similar.... :mrgreen:

Example:
http://www.portalanunciosgratis.com/renault-megane-cabrio-vt8068.html


