";
$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden != '1' AND panel_type = 'A' AND panel_level >= ".uLEVEL." ORDER BY panel_level DESC, panel_order ASC, panel_title ASC");
if(!dbnumrows($panelquery)) $output .= _FATALERROR;
$panellist = array();
while($panel = dbassoc($panelquery)) {
if(!$panel['panel_url']) $panellist[$panel['panel_level']][]= "".$panel['panel_title']."";
else $panellist[$panel['panel_level']][] = "".$panel['panel_title']."";
}
foreach($panellist as $accesslevel => $row) {
$output .= implode(" | ", $row)."
";
}
$output .= "\n";
if($action) {
$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_name = '$action' AND panel_type = 'A' LIMIT 1");
if(dbnumrows($panelquery)) {
$panel = dbassoc($panelquery);
if((isset($panel['panel_level']) ? $panel['panel_level'] : 0) >= uLEVEL) {
if($panel['panel_url'] && file_exists(_BASEDIR.$panel['panel_url'])) require_once(_BASEDIR.$panel['panel_url']);
else if (file_exists("admin/{$action}.php")) require_once("admin/{$action}.php");
}
else accessDenied( );
}
}
else {
if (file_exists("install"))
$output .= write_error(_SECURITYDELETE);
$adminnotices = "";
$countquery = dbquery("SELECT COUNT(DISTINCT chapid) FROM ".TABLEPREFIX."fanfiction_chapters WHERE validated < 1");
list($count) = dbrow($countquery);
if($count) $adminnotices .= write_message(sprintf(_QUEUECOUNT, $count));
$codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'adminnotices'");
while($code = dbassoc($codequery)) {
eval($code['code_text']);
}
$output .= write_message($adminnotices);
$output .= write_message(_RUNNINGVERSION);
}
$tpl->assign( "output", $output );
$tpl->printToScreen();
dbclose( );
?>