Welcome to Geeklog Monday, November 18 2019 @ 07:28 am EST

Geeklog Forums

Need hack: Insert static page as centerblock after first story

jmichael (oops)

Hi! I am playing around with Google Adsense placement. What I would really like to do is use a static page as a centerblock to display a 486x60 banner.

Problem is: I don't want it at the top, It messes up the nice three block look, since the first story block gets moved down. I don't want to wrap it in a block, because that looks too intrusive and I don't really want the default Adsense border around it becaus it has the reverse color 'title bar' at the bottom (for a 486x60 banner)

I also don't want it 'after featured' story, because there usually won't be a featured story, and the ad ends up at the top again.

What would need to be hacked to either add an option "after first story" or to (simply?) hack the existing "after featured story" into ignoring featured stories and always placing after the first story?

I have hack around a bit in blocks and mini-PHP stuff, but I believe this will be above my PHP skillz.

Status: offline


Forum User
Registered: 08/04/04
Posts: 47
I dug around plugin_centerblock_staticpages() for a bit and find that the problem is not lack of PHP skillz but a serious lack of understanding how Geeklog works deep inside.

Then I found some more functions dealing with the issue but nothing easily hackable (for me)

I tried $_CONF['showfirstasfeatured'] = 1; in config.php but then the static page appears above and below the "pseudo-featured" first article. Maybe we just need to fix that, I could live with $_CONF['showfirstasfeatured'] = 1;

Heeeelp!? ;-)

Status: offline


Forum User
Registered: 08/04/04
Posts: 47
I think I found something. in the staticpages functions.inc, it seems like the logic didn't check the showfirstasfeatured setting and therefore didn't see any featured stories. Therefore, it put the staticpage on top.

Dont't know why the staticpage also appeared below the first story, but this seems to work for me.

Basically, I added "&& !($_CONF['showfirstasfeatured'] == 1)" to an if statement

PHP Formatted Code

function plugin_centerblock_staticpages (...)


    // 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 features story, display those pages as well.
    if ($where == 1) {

   // hacked following line to also check for showfirstasfeatured
        if ( (DB_count ($_TABLES['stories'], 'featured', 1) == 0) && !($_CONF['showfirstasfeatured'] == 1))   {



All times are EST. The time is now 07:28 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