query_select( "SELECT * FROM website_settings WHERE 1" ); $site_settings = $db->fetch_assoc(); $nrows = $db->query_select( "SELECT * FROM pages WHERE name='{$site_settings['aboutpage']}'" ); if( $nrows != 1 ){ header( "Location: error/page_error.html" ); exit; } $page = $db->fetch_assoc(); $imgfile = $page['header_pic']; if( !empty($imgfile) ){ $rowname = $imgfile; $group = false; if( stripos($imgfile,'/') !== false ){ $rowname = substr( $imgfile, 0, stripos($imgfile,'/') ); $group = true; } $nrows = $db->query_select( "SELECT * FROM images WHERE filename='$rowname'" ); if( $nrows != 1 ){ header( "Location: index.html" ); exit; } $row = $db->fetch_assoc(); if( !$group && $row['grp'] ){ $imgfile = Images::group_random_pic( $rowname ); $group = true; } $header_pic = array(); $header_pic = Images::scale( $imgfile, $site_settings['header_pic_width'], $group, true ); $header_pic_url = $header_pic['url']; $header_pic_org_url = $header_pic['org_url']; } ?>