let's see some code contribution, not just a "proof of concept" or "general idea"...
here is mine which allow to view any album with this viewer but:
- i'm pretty disappointed by the result, because of the way this viewer deals with thumbs:
Thumbnails must have the same name as the full-size image, and in a different folder... so I cheated in telling the viewer thumbs pics=normal ones, but as a result thumbs are just a part of the "fullsize pic"..
-
this viewer is waiting for a file called imageData.xml, so it has to be re-created each times someone ask to view a new album--> i have no idea how it behaves when several people are calling the script at the same time.. (that problem is fixed)
except that, the result is pretty cool
demo:
http://nol33t.free.fr/cpg/simpleview.php?album=1if someone wants to play a little more with, here is the content of the simpleview.php file and the getxml.php ( don't forget to add the viewer.swf file provided on the
simpleviewer site )
simpleview.php
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$album = $HTTP_GET_VARS['album'];
pageheader("Simple View");
starttable("100%", "Simple View");
echo <<< EOT
<td>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="550" align="middle">
<param name="movie" value="viewer.swf" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="BGCOLOR" value="#FFFFFF" />
<param name=FlashVars value="xmlDataPath=getxml.php?album=$album">
<embed src="viewer.swf" FlashVars="xmlDataPath=getxml.php?album=$album" width="100%" height="550" align="middle" quality="high" scale="noscale" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</td>
EOT;
endtable();
pagefooter();
?>
getxml.php
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$options .= '<SIMPLEVIEWER_DATA maxImageDimension="480" textColor="0x000000" frameColor="0x8AA5B5" bgColor="0x181818" frameWidth="20" stagePadding="40" thumbnailColumns="3" thumbnailRows="3" navPosition="right" navDirection="LTR" ';
// Set showDownloadLinks to true if you want to show a 'Download Image' link as the caption to each image.
$showDownloadLinks = false;
$album = $HTTP_GET_VARS['album'];
$album_title="";
$pic_data = get_pic_data($album,$count,$album_title);
$options .= 'title="'.$album_title.'" imagePath="'.$CONFIG['ecards_more_pic_target'].'" thumbPath="'.$CONFIG['ecards_more_pic_target'].'">';
$xml = '<?xml version="1.0" encoding="UTF-8" ?>'.$options;
$i = 0;
if (count($pic_data) > 0) {
foreach ($pic_data as $key => $row) {
$i++;
$xml .= '<IMAGE>';
$xml .= '<NAME>'.get_pic_url($row, 'normal').'</NAME>';
//add auto captions: 'Image X'
if ($showDownloadLinks){
$xml .= '<CAPTION><![CDATA[<A href="'.get_pic_url($row, 'normal').'" target="_blank"><U>Open image in new window</U></A>]]></CAPTION>';
}else{
$xml .= '<CAPTION></CAPTION>';
}
$xml .= '</IMAGE>';
}
}
$xml .= '</SIMPLEVIEWER_DATA>';
echo $xml;
?>
-matt-