tokyoahead

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

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
We have this logic in the main geeklog index.php

Text Formatted Code

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.
Geeklog components by PortalParts -- www.portalparts.com

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
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

Text Formatted Code

    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 components by PortalParts -- www.portalparts.com