Subject: Forum Centerblock disappears on HP if no featured article visible

Posted on: 19/01/04 04:12am
By: Anonymous

If you feature an article which is not visible to not-logged-in users, you automatically make the forum centerblock disappear for not-logged-in users... anyone else has the same problem?

thanks

Oliver

Re:Forum Centerblock disappears on HP if no featured article visible

Posted on: 19/01/04 11:03am
By: Blaine

We have this logic in the main geeklog index.php

if ($A['featured'] == 1) {
   $display .= PLG_showCenterblock (2, $page, $topic);
}

Thus it will only call the Plugin Function to show the centerblock after the Featured Story if there is a featured story. I think thats an unnecessary check.

Re:Forum Centerblock disappears on HP if no featured article visible

Posted on: 20/01/04 10:52pm
By: Blaine

No, it was a bit trickier then that. Disabling that check will cause the centerblock to appear after every story. It was set to only appear once after the featured topic.

So we would need a check to handle the case when there was no featured story (or access to) and when there is one.

Try this out - replace the matching code in your geeklog index.php - starting at approx line 174

    for ($x = 1; $x <= $nrows; $x++) {
        $A = DB_fetchArray($result);
        if ($A['featured'] == 1) {
            $feature = 'true';
        } elseif (($x == 1) && ($_CONF['showfirstasfeatured'] == 1)) {
            $feature = 'true';
            $A['featured'] = 1;
        } elseif ($x == 1) {
            $display .= PLG_showCenterblock (2, $page, $topic);
        }
        $display .= COM_article($A,'y');
        if ($A['featured'] == 1) {
           $display .= PLG_showCenterblock (2, $page, $topic);
        }
    }



Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=29284