OK I figured this out myself -
I only did it in weekthumb.php - I imagine modifying the others is simple, but this is the only
one I wanted:
replace:
global $prefix, $dbi;
with
global $HTTP_GET_VARS, $prefix, $dbi;
$albumid=$HTTP_GET_VARS['albumid'];
Change the SQL statement from this:
$result = db_query("SELECT pid, aid, filepath, filename, owner_name, owner_id from {$CONFIG['TABLE_PICTURES']} WHERE potw='1', $dbi);
To This:
$result = db_query("SELECT pid, aid, filepath, filename, owner_name, potw_date, owner_id, caption from {$CONFIG['TABLE_PICTURES']} WHERE potw='1' AND aid='{$albumid}' ORDER BY 'potw_date' DESC", $dbi);
I added caption and ORDER BY ''potw_date', as I wanted the last POTW to always appear and I wanted the caption too.
Then call it as weekthumb.php?albumid=###
Where ### is the ID of the album you want.
If you want to see it in action:
photos.surfline.com has all my albums.
www.surfline.com has a random featured photo pulled into it (middle bottom)
And if you go to any regional surf page (Southern California for example) it only pulls the POTW for that region.
Here's the full code of weekthumb.php
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2005 Coppermine Dev Team
v1.1 originaly written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
********************************************
Coppermine version: 1.4.1
**********************************************/
/**
* Coppermine Photo Gallery 1.4.1 weekthumb.php
*
* This file can be called using an iframe into any other page
*
* @copyright 2002,2005 Gregory DEMAR, Coppermine Dev Team
* @license http://opensource.org/licenses/gpl-license.php GNU General Public Lic
ense V2
* @package Coppermine
{$lang_meta_album_names['by']}</small><b> <a href=\"thumbnails.php?album=lastupb
y&uid={$picture['owner_id']}\" target=\"new\">{$picture['owner_name']}</a></b>
*/
define('WEEKTHUMB_PHP', true);
define('IN_COPPERMINE', true);
require('include/init.inc.php');
global $HTTP_GET_VARS, $prefix, $dbi;
$albumid=17;
print $HTTP_GET_VARS['albumid'];
$albumid=$HTTP_GET_VARS['albumid'];
{
$result = db_query("SELECT pid, aid, filepath, filename, owner_name, potw_dat
e, owner_id, caption from {$CONFIG['TABLE_PICTURES']} WHERE potw='1' AND aid='{$
albumid}' ORDER BY 'potw_date' DESC", $dbi);
$picture = mysql_fetch_array($result);
$aid=$picture['aid'];
$result2 = db_query("SELECT title from {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$
aid}'", $dbi);
$album = mysql_fetch_array($result2);
$img = "<img src=\"/albums/{$picture['filepath']}thumb_{$picture['filename']}\
" border=\"0\">";
$content .= "<table><tr><td><center><a href=\"http://photos.surfline.com/disp
layimage.php?album={$picture['aid']}&pos=-{$picture['pid']}\" target=\"new\">$im
g</a><br /><br />
{$picture['caption']}
<br />
From: <a href=\"http://photos.surfline.com/thumbnails.php?album={$aid}\"> {$alb
um['title']}
</a>
<br /><br />
</center></td></tr></table>
";
$stop++;
}
print $content;
?>