Welcome to the Inferno Enterprises message board. We offer this resource as a forum for the discussion of educational and technological issues. We encourage everybody to participate, and ask that you do so in a conscientious and helpful manner.
Here's how to reconfigure Coppermine so that if there's only a single album in a category, when you click on the category link it will take you directly to it - rather than requiring you to click on the category and then also on the album:
Find the file index.php in your coppermine folder.
then replace line 130:
if ($album_count==1)
{
$sql = "SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = {$subcat['cid']} LIMIT 0,1";
$result = db_query($sql);
$aid = mysql_fetch_row($result);
mysql_free_result($result);
$link = "<a href=\"thumbnails.php?album=$aid[0]\">{$subcat['name']}</a>";
}
else
{
$link = "<a href=\"index.php?cat={$subcat['cid']}\">{$subcat['name']}</a>";
}
This comes from the user "BMWHeaven" from this discussion thread.
This functionality can also be obtained by allowing BBCode in category titles as per this discussion, but the BBCode method isn't nearly as elegant since there are a few problems with it.
Last edited by jasonb on Sat Aug 06, 2005 11:36 pm, edited 1 time in total.