EOT;
if ($title) {
echo <<
$title |
EOT;
}
}
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
global $HTTP_COOKIE_VARS, $CONFIG;
starttable();
echo $nav_menu;
endtable();
starttable();
echo $picture;
endtable();
starttable();
echo $votes;
endtable();
$picinfo = isset($HTTP_COOKIE_VARS['picinfo']) ? $HTTP_COOKIE_VARS['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
echo "\n";
starttable();
echo $pic_info;
endtable();
echo "
\n";
starttable();
echo " |
\n";
echo $comments;
endtable();
if ($CONFIG['display_film_strip'] == 1) {
echo $film_strip;
}
}
function theme_html_picinfo(&$info)
{
global $lang_picinfo;
$html = '';
$html .= " {$lang_picinfo['title']} |
\n";
$template = " %s: | %s |
\n";
foreach ($info as $key => $value) $html .= sprintf($template, $key, $value);
return $html;
}
function theme_display_film_strip(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb')
{
global $CONFIG, $THEME_DIR;
global $template_film_strip, $lang_film_strip;
static $template = '';
static $thumb_cell = '';
static $empty_cell = '';
static $spacer = '';
if ((!$template)) {
$template = $template_film_strip;
$thumb_cell = template_extract_block($template, 'thumb_cell');
$empty_cell = template_extract_block($template, 'empty_cell');
}
$cat_link = is_numeric($aid) ? '' : '&cat=' . $cat;
$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['max_film_strip_items']) . '%';
$i = 0;
$thumb_strip = '';
foreach($thumb_list as $thumb) {
//modify $new_size for max dimension of thumbnails in filmstrip
$new_size = 80;
preg_match('/(?<=width=")[0-9]*/',$thumb['image'],$matches,PREG_OFFSET_CAPTURE);
$srcWidth=$matches[0][0];
preg_match('/(?<=height=")[0-9]*/',$thumb['image'],$matches,PREG_OFFSET_CAPTURE);
$srcHeight=$matches[0][0];
$ratio = max($srcWidth, $srcHeight) / $new_size;
$ratio = max($ratio, 1.0);
$destWidth = (int)($srcWidth / $ratio);
$destHeight = (int)($srcHeight / $ratio);
$thumb['image']=preg_replace('/width="[^"]*"/','width="'.$destWidth.'"',$thumb['image']);
$thumb['image']=preg_replace('/height="[^"]*"/','height="'.$destHeight.'"',$thumb['image']);
$i++;
if ($mode == 'thumb') {
$params = array('{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}",
'{THUMB}' => $thumb['image'],
'{CAPTION}' => $thumb['caption'],
'{ADMIN_MENU}' => ''
);
} else {
$params = array('{CELL_WIDTH}' => $cell_width,
'{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
'{THUMB}' => $thumb['image'],
'{CAPTION}' => '',
'{ADMIN_MENU}' => ''
);
}
$thumb_strip .= template_eval($thumb_cell, $params);
}
$params = array('{THUMB_STRIP}' => $thumb_strip,
'{COLS}' => $i,
'{TILE1}' => $tile1,
'{TILE2}' => $tile2,
);
ob_start();
starttable($CONFIG['picture_table_width']);
echo template_eval($template, $params);
endtable();
$film_strip = ob_get_contents();
ob_end_clean();
return $film_strip;
}
?>
{MSG_BODY}