Recent topisc block

Current Version: 1.0.6
Released: 09.01.10
Forum rules
Before creating a new support thread, please take a look in the board3 Portal FAQ and use the search!
Many questions have already been answered.
Locked

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Recent topisc block

Post by JirkaX »

Your Portal Version: 1.0.3
Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: Basic Knowledge
Boardlink: http://www.belariepark.cz

What have you done before the problem was there?


What have you already tryed to solve the problem?


Description and Message
Hi, I have question related to the Recent block. I set number of topics which should be displayed there to 8. But due to the fact that there is hidden part in my forum (some forums are visible for defined users only), number of showed topic is not 8, but it is lower. Only if the user can see all forums and topics he has all 8 recent topics shown.
Do you have any idea how to solve it?

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Re: Recent topisc block

Post by JirkaX »

No any idea?
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Recent topisc block

Post by Marc »

Hm,
I think that might be a bug.

You could try the following:

Open portal/block/recent.php (not the template folder)
Find:

Code: Select all

if (sizeof($forum_ary))
{
$sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
} 
Replace with:

Code: Select all

$forum_sql = '';
if (sizeof($forum_ary))
{
$sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
$forum_sql = ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
} 
You have to do the following 3 times:
Find:

Code: Select all

' . $sql_where . ' 
Replace with:

Code: Select all

' . $sql_where . '' .  $forum_sql . ' 

That should fix it.

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Re: Recent topisc block

Post by JirkaX »

For registered users it seems to be ok, but for visitors error below is displayed.

SQL ERROR [ mysql4 ]

Column 'forum_id' in where clause is ambiguous [1052]
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Recent topisc block

Post by Marc »

Ok, try this in addition to the other changes:

Open portal/block/recent.php

Find:

Code: Select all

$forum_sql = ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true); 
Replace with:

Code: Select all

$forum_sql = ' AND ' . $db->sql_in_set('t.forum_id', $forum_ary, true); 
Do this 3 times:
Find:

Code: Select all

FROM ' . TOPICS_TABLE . ' 
Replace with:

Code: Select all

FROM ' . TOPICS_TABLE . ' t

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Re: Recent topisc block

Post by JirkaX »

Ok, now it works, thanks a lot. But I did only 1st change, 2nd one (3 changes with t) I did not, because it doesn't make any sense to have two t one next to the other ... and it generates another sql error.
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Recent topisc block

Post by Marc »

That's not what I meant. The code "FROM ' . TOPICS_TABLE . ' " appears 3 times in that file. ;)

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Re: Recent topisc block

Post by JirkaX »

Yes, I understand this, but there already was FROM ' . TOPICS_TABLE . ' t
If I follow your instructions properly, I will have FROM ' . TOPICS_TABLE . ' t t
Locked

Return to “board3 Portal 1.0.x - English Support”