Welcome to Geeklog, Anonymous Monday, November 25 2024 @ 09:30 pm EST
Geeklog Forums
Static content on front page BELOW news
beavis82
I couldn't find this hack anywhere so I decided to try to make it myself. I have very little PHP experience so I'm quite surprise that it seems to work!
There's a hack to display static content before news on the front page (already included in Geeklog) but I also wanted to display static content below the news.
I hacked the index.php file - just below:
$display .= COM_endBlock();
}
(around line 278) I added the following:
/*
* Staticpage on Frontpage Addon (Hacked by Beavis)
*
* Just to add staticpage content below the news items on the front page.
* Geeklog will do this if there is a staticpage with the title 'frontpagebelow'.
*/
if (empty ($topic)) {
// check if static pages plugin is installed and enabled
if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) {
$spsql = "SELECT sp_content,sp_label,sp_format FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpagebelow'";
$spresult = DB_fetchArray (DB_query ($spsql));
// display static page content below the news
$display .= stripslashes ($spresult['sp_content']);
}
}
/*
* End of hack.
*/
Then below that should remain the line:
Now whenever you have a staticpage with the title 'frontpagebelow' its content will be shown below the news stories on the front page. It wont show if you're using MLimburg's hack to show a static page with its label set to 'nonews'.
I'm not a PHP programmer, so I don't know if I've gone about this the right way or if the code is clean etc. so I'd welcome any comments and suggestions. The code I've used is based on MLimburg's hack. It *seems* to work without any problems on my version of Geeklog - v1.3.7sr1.
Hope someone finds it useful!
Si aka Beavis
- 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