Can I get a couple sets of eyes to look at this and let me know if it would cause any trouble before I post it as a Mod? It's working perfect at my site, but I just want some pros to look at it and let me know if it's 'error free' or "this could cause problems if..." type thing. I have CPG ver 1.3.2 and I have no special settings changed. Paths are based on 'albums/userpics/blah'.
It builds an xml file for a Flash slideshow and can be used anywhere in the gallery - fullscreen down to a thumbnail. Pulls out titles, and can be totally customized (random, desc, asc, normal_, full, thumb_, as many pics as you want to pull out, etc.....). This particular will pull out the last 5 pic uploads - Sample output attached.
<?
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$xml .= '<?xml version="1.0" encoding="UTF-8" ?>';
$xml .= '<slideshow><settings><image_folder></image_folder><time>3</time><fade>1</fade><repeat>true</repeat><captions>true</captions></settings><images>';
$result = mysql_query("SELECT a.pid, a.aid, a.filename, a.filepath, a.pwidth, a.pheight, a.title, a.caption, b.title atitle from {$CONFIG['TABLE_PICTURES']} a, {$CONFIG['TABLE_ALBUMS']} b where a.aid = b.aid AND filename LIKE '%.jpg' order by a.aid, a.pid desc LIMIT 5");
global $xml;
if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap']);
$p_aid = -1 ;
while ($row = mysql_fetch_array($result))
{
if ($row[aid] != $p_aid){
}
if (max($row['pwidth'], $row['pheight']) > $CONFIG['picture_width']){
$xml .= "<image><file><![CDATA[$CONFIG[fullpath]$row[filepath]$CONFIG[normal_pfx]$row[filename]]]></file><caption><![CDATA[$row[title]]]></caption></image>";
} else {
$xml .= "<image><file><![CDATA[$CONFIG[fullpath]$row[filepath]$row[filename]]]></file><caption><![CDATA[$row[title]]]></caption></image>";
}
$p_aid = $row[aid] ;
}
$xml .= '</images></slideshow>';
echo $xml;
?>
Until I receive a couple of thumbs up, I'll hold off on submit. Thanks for all the help.
[attachment deleted by admin]