Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 02:51 pm EST
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
thanks
Oliver
6
7
Quote
Status: offline
Blaine
Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
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.
Geeklog components by PortalParts -- www.portalparts.com
Text Formatted Code
if ($A['featured'] == 1) {
$display .= PLG_showCenterblock (2, $page, $topic);
}
Geeklog components by PortalParts -- www.portalparts.com
9
5
Quote
Status: offline
Blaine
Forum User
Moderator
Registered: 07/16/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
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
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
8
6
Quote
All times are EST. The time is now 02:51 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