From sass+bide site, collection.php
require_once("../conf/config.php");
require_once("../classes/collection.php");
$page=0;
if (isset($HTTP_GET_VARS['page']) && is_numeric($HTTP_GET_VARS['page'])){
$page = $HTTP_GET_VARS['page'];
}
$collection_id=0;
if (isset($HTTP_GET_VARS['collection_id']) && is_numeric($HTTP_GET_VARS['collection_id']))
{
$collection_id = $HTTP_GET_VARS['collection_id'];
}
$template = 'collection.tpl';
// Turn on content caching
$tpl->caching = true;
// Generate the cache identifier based on the collection_id and page number
$cache_id = 'collection|'.$collection_id.'|'.$page;
// If the page is not cached, retrieve data and assign to the template
if(!$tpl->is_cached($template,$cache_id))
{
$collection = new collection($collection_id);
$collection->retrieve($db);
// Pass variables to template file
$tpl->assign_by_ref('collection', $collection);
$tpl->assign('page',$page);
$tpl->assign('no_items',count($collection->items->list));
}
$tpl->display($template,$cache_id);
?>