<?php if defined'SITE' exit'No direct script access allowed'
/*
Format Name: Djuve
Format URI: indexhibit.org/format/Djuve/
Description: Exhibition format.
Version: 0.1
Author: Indexhibit
Author URI: Kjetil Djuve (kjetildjuve.com/)
@based on/mix of: Vaska's Iwakami/Backgrounded/Deux Column Exhibition formats (indexhibit.org/)
Params: format
Options Builder: default_settings
Source: exhibit
Operands: none
Objects: exhibits
*/
class Exhibit
{
// defaults from the general libary - be sure these are installed
$exhibit['dyn_css'] = dynamicCSS();
$exhibit['dyn_js'] = dynamicJS();
$exhibit['exhibit'] = createExhibit();
function dynamicJS()
{
return "function show_image(id)
{
$('.pic').hide();
$('#p' + id).fadeIn();
return false;
}";
}
function createExhibit()
{
$OBJ =& get_instance();
global $rs;
$pages = $OBJ->db->fetchArray("SELECT *
FROM ".PX."media, ".PX."objects_prefs
WHERE media_ref_id = '$rs[id]'
AND obj_ref_type = 'exhibit'
AND obj_ref_type = media_obj_type
ORDER BY media_order ASC, media_id ASC");
// content text
$s = $rs['content'];
if (!$pages) return $s;
$i = 1; $a = ''; $b = '';
$total = count($pages);
// people will probably want to customize this up
foreach ($pages as $go)
{
$title = ($go['media_title'] == '') ? '' : $go['media_title'] . ' ';
$caption = ($go['media_caption'] == '') ? ' ' : $go['media_caption'];
$png = ($go['media_mime'] == 'png') ? " class='png'" : '';
$a .= "nn";
$x = getimagesize(DIRNAME . GIMGS . '/' . $go['media_file']);
$off = ($i == 1) ? "style='display: block;'" : "style='display: none;'";
$next = ($i == $total) ? 1 : $i+1;
$b .= "n
{$title}
{$caption}
n";
$i++;
}
// get images
$this->imgs = $OBJ->page->get_imgs();
return $s;
}
function dynamicCSS()
{
return "#d-thumbs { }
#d-thumbs img { padding-bottom: 5px; border: none; height: 40px; width: 40px; }
#d-image { }
#d-image img { border: none; }";
}
?>
}