Hi Mark,
regarding the problem of too many queries when you have a lot of forums:
I commented (/* */) the following part in smartfeed_url.php now (thanks for pointing me to this piece of code!) which reduced the number of queries dramatically:
Code: Select all
/*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...
}
}*/
And then I noticed something strange: While my founder account still sees all forums
and categories, a regular user sees only the names of the forums.
And while my founder account had a nice look of
smarfeed_url-page, e.g.
Code: Select all
Category A
Forum 1
Forum 2
Category B
Forum 3
Forum 4
... a regular user saw something like that:
Code: Select all
Forum 1
Forum 2
Forum 3
Forum 4
Forum 5
Forum 6
Forum 7
Forum 8
Last problem was very easy to solve by deleting
style="position:relative; left:20px;" in smartfeed_url_body.html.
BUT: Why can't regular users see the names of the categories? Is it because they are not allowed to see categories that contain only forums visible for admins and so on? (In this case shouldn't it be possible to count how many forums are displayed for user X in a certain category and if that number == 0, don't display the name of the category, too?)
Anyway, I like it much better the way it is now - with 13 queries instead of 209. And the page looks fine for
everybody - the only difference is, that regular users do not see the names of the categories anymore. This might be interesting for people who love your MOD as much as I do and who also have many forums.
Regards
Wolfgang
EDIT:
When I click on "Generate URL" on
smartfeed_url - page and then on "Test", everything works fine with Firefox 3. But when I do the same with the browser Epiphany (I do it both times with my founder account) it tells me:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
And then I see the source code:
<!--
generator="FeedCreator 1.8.0-dev (
info@mypapit.net)"
-->
−
<rss version="2.0">
−
<channel>
....
....
....
Is this a problem of the browser or of the MOD or did I break something?
EDIT 2:
If you have many forums and want to follow the suggestions above, here is one more thing you can do to make the smartfeed_url-page look better: Add a space between the categories! To do this, simply change
Code: Select all
<div id="{forums.CAT_ID}" style="position:relative; left:20px;">
to
Code: Select all
<div id="{forums.CAT_ID}" style="margin:0.6em 0;">
in
smartfeed_url_body.html (That's the line you might already have altered when you followed my suggestion in this post.) Not later than now the page should look okay for everybody - and you save hundreds of queries!
