Welcome to Geeklog, Anonymous Wednesday, December 25 2024 @ 09:19 am EST
Geeklog Forums
function plugin_centerblock_staticpages()
Status: Banned
machinari
Forum User
Full Member
Registered: 03/22/04
Posts: 1512
This function doesn't take the topic into account when checking to see if a page has a featured story or not. That means that if I've set a staticpage centerblock to display after a featured story in a particular topic, and no featured story exists, then that block wont be displayed at all.
the relevant code is:
// If there are no featured stories, we won't be called with $where == 2.
// So, if asked to display pages for the top of the page, check if we
// have pages to be displayed after the featured story and if there is
// no featured story, display those pages as well.
if (($where == 1) && ($_CONF['showfirstasfeatured'] == 0)) {
if (DB_count ($_TABLES['stories'], 'featured', 1) == 0) {
// no featured story found - redefine $moresql
$moresql = "(sp_where = 1 OR sp_where = 2) AND ";
$displayFeatured = true;
}
}
Perhaps try (if the topic is not empty):
the relevant code is:
Text Formatted Code
// If there are no featured stories, we won't be called with $where == 2.
// So, if asked to display pages for the top of the page, check if we
// have pages to be displayed after the featured story and if there is
// no featured story, display those pages as well.
if (($where == 1) && ($_CONF['showfirstasfeatured'] == 0)) {
if (DB_count ($_TABLES['stories'], 'featured', 1) == 0) {
// no featured story found - redefine $moresql
$moresql = "(sp_where = 1 OR sp_where = 2) AND ";
$displayFeatured = true;
}
}
Perhaps try (if the topic is not empty):
Text Formatted Code
DB_count($_TABLES['stories'], array('featured', 'tid'), array(1, $topic))
11
9
Quote
All times are EST. The time is now 09:19 am.
- 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