this is my plugin (the one I use in my home page, which I've called exhibit.visindex_multisection.php
I didn't have time yet to check what vaska posted, but I assume they are similar to those I downloaded some time ago from another thread.
this solves the double text problem and rearrange the order from the newest changed exhibit (actually only the exhibits that have a new or modified first image, i.e. the one which is picked up and displayed by the plugin) to the oldest.
also with this I get validated pages, both XHTML 1.0 Transitional and CSS 2.1.
another feature that you might want to change is the use of the system thumbnail instead of the default thumbnail.
however comments are there to help for further customization...
oh, yeah: I hope the code will not break, it looks ok to me now, but you know... it's late night
;-)
<?php if (!defined('SITE')) exit('No direct script access allowed');
/**
* VisIndex Multisection
*
* Exhbition format
*
* @author Vaska
* @author Daniel Eatock
*
* @modified Richard Khoury - richard@arteam.it
*/
// defaults from the general libary - be sure these are installed
$exhibit['dyn_css'] = dynamicCSS();
$exhibit['exhibit'] = createExhibit();
function createExhibit()
{
$OBJ =& get_instance();
global $rs, $exhibit;
$pages = $OBJ->db->fetchArray("SELECT media_file, url, title, media_order, media_id
FROM ".PX."media, ".PX."objects
WHERE id = media_ref_id
AND media_order = (SELECT MIN(media_order) FROM ".PX."media WHERE media_ref_id = id)
AND status = '1'
ORDER BY media_id DESC
");
// ** DON'T FORGET THE TEXT ** //
$s = $rs['content'];
$s .= "\<div class='cl'><!-- --></div>\n";
if (!$pages) return $s;
// adjust this value according to your thumbs default settings and your img sys width choice
$thumb = $rs['thumbs'] - 88;
$i = 1; $j = 0; $a = '';
foreach ($pages as $go)
{
$title = ($go['title'] == '') ? ' ' : $go['title'];
$a .= "<div class='grow' id='img$j'>\n";
$a .= "<div class='thumb'>\n";
$a .= "<div class='thumb-it'>\n";
// img sys width value is of your choice, but should be = or <100 which is the default size of the system square thumbnail
$a .= "<a href='" . BASEURL . "$go[url]' class='thumb-img'><img src='" . BASEURL . GIMGS . "/sys-$go[media_file]' width='80' alt='$go[media_file]' title='$title' /></a>\n";
$a .= "</div>\n";
// if you don't want to show titles just take out the line below
$a .= "<div class='thumb-cap'><a href='" . BASEURL . "$go[url]'>{$title}</a></div>\n";
$a .= "</div>\n";
$a .= "</div>\n\n";
$i++; $j++;
}
// images
$s .= "<!--[if lte IE 6]><style type='text/css'>.thumb-img { #top: -50%; }</style><![endif]-->\n\n";
$s .= "<div id='img-container'>\n";
$s .= $a;
$s .= "\n<div class='cl'><!-- --></div>\n";
$s .= "</div>\n";
return $s;
}
function dynamicCSS()
{
global $rs;
// for .thumb-it we need #top: -50%; for IE...but it doesn't work.
// adjust those values according to your thumbs default settings and your img sys width choice
$thumb = $rs['thumbs'] - 88;
$thumbheight = $rs['thumbs'] - 48;
return ".grow { float: left; margin: .1em .8em 1.6em .1em; border: 0px solid #777; }
.thumb { padding: 0; text-align: center; display: table; height: {$thumbheight}px; width: {$thumb}px; overflow: hidden; }
.thumb-cap { font-weight: bold; width: {$thumb}px; margin-top: .6em; display: block; }
.thumb-it { margin-top: 2em; text-align: center; }
.thumb-img { width: {$thumb}px; display: block; }
.cl { clear: left; }";
}