class BRart {
var $gallery_max;
var $site_dir;
var $site_folders;
function BRart() {
$this->gallery_max = 5;
$this->site_dir = 'benrogers';
$this->site_folders = Array ("1"=>"vinyl","2"=>"sound_motion");
}
function valid_art($type,$art) {
if (is_dir($type.'/'.$art)) return true;
else header('Location: http://dreamchimney.com/benrogers/');
}
function site_header() {
echo '
';
}
function site_nav_top($type,$art='') {
if ($type == 'vinyl' && $art == '') echo 'Vinyl Painting Gallery | Sound and Motion Gallery';
else if ($type == 'sound_motion' && $art == '') echo 'Vinyl Painting Gallery | Sound and Motion Gallery';
else echo 'Vinyl Painting Gallery | Sound and Motion Gallery';
//echo 'Vinyl Paintings | Audio-Video';
}
function site_bottom_nav($art_type) {
if ($art_type == 'contact') echo 'CONTACT'; else echo 'CONTACT';
echo ' | ';
if ($art_type == 'bio') echo 'BIO'; else echo 'BIO';
echo ' | ';
if ($art_type == 'links') echo 'LINKS'; else echo 'LINKS';
}
function show_statement($art_type) {
if (in_array($art_type,$this->site_folders)) echo file_get_contents('statement_'.$art_type.'.txt');
}
// PREVIOUS NEXT NAVIGATION
function next_previous($type,$art) {
$art_folders = Array();
$art_folders = $this->get_art_list($type);
$key = array_search($art,$art_folders);
$key_next = $key + 1;
if (!array_key_exists($key_next,$art_folders)) $key_next = 0;
$key_prev = $key - 1;
if (!array_key_exists($key_prev,$art_folders)) $key_prev = sizeof($art_folders) - 1;
echo '< Previous Next >';
}
// ART PAGE
function get_artfiles($type,$art,$filetype) {
$files = $this->get_dir_list($type.'/'.$art);
foreach ($files as $file) {
if (eregi($filetype,$file)) $artwork[] = $art.'/'.$file;
}
return $artwork;
}
function show_artwork($type,$art) {
if ($type == 'vinyl') {
$artwork = $this->get_artfiles($type,$art,'artwork');
// TO-DO get image dimensions
$first_margin = '';
if (sizeof($artwork)>1) $first_margin = 'style="margin: 0 0 0 20px"';
foreach ($artwork as $art) $rtn .= '';
echo $rtn;
}
else if ($type == 'sound_motion') {
$artwork = $this->get_artfiles($type,$art,'video');
foreach ($artwork as $art) $rtn .= file_get_contents($type.'/'.$art);
echo $rtn;
}
}
function show_detail($type,$art) {
$detail = $this->get_artfiles($type,$art,'detail_sm');
// TO-DO get image dimensions
if (sizeof($detail)<1) return '';
$count = 1;
foreach ($detail as $art) {
$detail_lg = str_replace("_sm_","_lg_",$art);
$rtn .= '