Hey Ben,
I was working on my staticpage for my footer and I notice a few things in functions.php. You should probably use a few of the plugin api to access the staticpage plugin. Instead of:
Text Formatted Code
//Check if a staticpage with id: purepro_footer exists
$footerpage = DB_query("SELECT sp_id FROM {$_TABLES['staticpage']} WHERE (sp_id='purepro_footer')");
if (DB_numRows($footerpage) == 1) {
$footer->set_var( 'purepro_footer', PLG_replaceTags(''));
} else {
$footer->set_var( 'purepro_footer', '');
}
I would do something like this so that the draft and template variable would be taken into consideration for the staticpage plus this will make the code future proof if any staticpage table changes happen.
Text Formatted Code
$id = 'purepro_footer';
if (PLG_getItemInfo('staticpages', $id, 'id') == $id) {
$retval = '';
$mode = '';
$args = array(
'sp_id' => $id,
'mode' => $mode,
'gl_svc' => ''
);
$svc_msg = array();
if (PLG_invokeService('staticpages', 'get', $args, $retval, $svc_msg) == PLG_RET_OK) {
$footer->set_var( 'purepro_footer', $retval['sp_content']);
} else {
$footer->set_var( 'purepro_footer', '');
}
} else {
$footer->set_var( 'purepro_footer', '');
}
One of the Geeklog Core Developers.