I understand that the error has nothing to do with smartfeed istself, what i wonder is if it is possible to somehow supress any error messages of this type in the rss feed since it messes it up and the result is that it wont work even though the code within rss tags are fine.MarkDHamill wrote:This mod was never designed with Joomla integration in mind so I am afraid you will have to figure out this one.
Wolfgang, this code seems to resolve the multiple query issue in smartfeed_url.php (Version 2.2.3):IPB_Refugee wrote:Thank you, Mark!
I will try it after upgrading my main board to Olympus. If I find a code which works (I'm still learning), I will post the solution here.
Regards
Wolfgang
Code: Select all
foreach ($forum_read_ary as $forum_id => $allowed)
{
if ($allowed['f_read'])
{
// Since this user has read access to this forum, add it to the $allowed_forums array
$allowed_forums[] = (int) $forum_id;
// Also add to $allowed_forums the parents, if any, of this forum. Actually we have to find the parent's parents, etc., going up as far as necesary because
// $auth->act_getf does not return the parents for which the user has access, yet parents must be shown are on the interface
$there_are_parents = true;
$this_forum_id = (int) $forum_id;
while ($there_are_parents)
{
$sql = 'SELECT parent_id
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $this_forum_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if ((int) $row['parent_id'] == 0)
{
$there_are_parents = false;
}
else
{
// Do not add this parent to the list of allowed forums if it is already in the array
if (!in_array((int) $row['parent_id'], $allowed_forums))
{
$allowed_forums[] = (int) $row['parent_id'];
}
$this_forum_id = (int) $row['parent_id']; // Keep looping...
}
}
}
}
Code: Select all
// Get a list of parent_ids for each forum and put them in an array.
$parent_array = array();
$sql = 'SELECT forum_id, parent_id
FROM ' . FORUMS_TABLE . '
ORDER BY 1';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$parent_array[$row['forum_id']] = $row['parent_id'];
}
foreach ($forum_read_ary as $forum_id => $allowed)
{
if ($allowed['f_read'])
{
// Since this user has read access to this forum, add it to the $allowed_forums array
$allowed_forums[] = (int) $forum_id;
// Also add to $allowed_forums the parents, if any, of this forum. Actually we have to find the parent's parents, etc., going up as far as necesary because
// $auth->act_getf does not return the parents for which the user has access, yet parents must be shown are on the interface
$there_are_parents = true;
$this_forum_id = (int) $forum_id;
while ($there_are_parents)
{
if ($parent_array[$this_forum_id] == 0)
{
$there_are_parents = false;
}
else
{
// Do not add this parent to the list of allowed forums if it is already in the array
if (!in_array((int) $parent_array[$this_forum_id], $allowed_forums))
{
$allowed_forums[] = (int) $parent_array[$this_forum_id];
}
$this_forum_id = (int) $parent_array[$this_forum_id]; // Keep looping...
}
}
}
}
Code: Select all
case SMARTFEED_NO_LIMIT_VALUE:
$date_limit = time() - ($config['sf_default_fetch_time_limit'] * 3600);