Welcome to Geeklog Sunday, May 22 2022 @ 10:47 pm EDT

Geeklog Forums

Forum Centerblock disappears on HP if no featured article visible


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
 Quote

Status: offline

Blaine

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

PHP 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
 Quote

Status: offline

Blaine

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

PHP 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
 Quote

All times are EDT. The time is now 10:47 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content