Quote:
|
Originally Posted by chrisho I've got this installed fine BUT it doesn't pick up the forum ID correctly - I've set the parameter to 1, but it pulls out info from both of my active forums. Any ideas? |
Hi,
just realized I have the same problem. Looking at the code of phpbbtopics_08.zip, it simply appears that the forum parameter is not used in the code

Here is the sql :
PHP Code:
$result=mysql_query("SELECT topic_title, topic_id
FROM phpbb_topics ORDER BY $PHPBB2_ORDER DESC LIMIT 0, $PHPBB2_AMOUNT");
but it should read
PHP Code:
$result=mysql_query("SELECT topic_title, topic_id
FROM phpbb_topics WHERE forum_id=$PHPBB2_FORUM_ID ORDER BY $PHPBB2_ORDER DESC LIMIT 0, $PHPBB2_AMOUNT");
Alternatelty, I modified the code to use '0' meaning ALL forums, the default. Then I added to php file :
PHP Code:
$forum_sql = '';
if ('0' != $PHPBB2_FORUM_ID)
{
$forum_sql = "WHERE forum_id=" . $PHPBB2_FORUM_ID;
}
$result become:
PHP Code:
$result=mysql_query("SELECT topic_title, topic_id
FROM phpbb_topics $forum_sql ORDER BY $PHPBB2_ORDER DESC LIMIT 0, $PHPBB2_AMOUNT");
However, I have always the same problem you said. It comes from the use of the LIMIT clause in sql statement. This is not appropriate here because mysql return the X first rows it founds, but these rows does not contain necessarily the latest topics

Then the code should be modified to get ALL rows (remove the LIMIT statement), then we have to find the last X posts using pure PHP, not SQL.
Thierry B.