// // http://www.chezgreg.net/coppermine/ // // ------------------------------------------------------------------------- // // Based on PHPhotoalbum by Henning Střverud // // http://www.stoverud.com/PHPhotoalbum/ // // ------------------------------------------------------------------------- // // 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. // // ------------------------------------------------------------------------- // include("include/init.inc.php"); /************************************************************************** * Local functions definition **************************************************************************/ function show_albummenu($id, $movepic) { echo << EOT; if ($movepic){ echo << EOT; } echo << EOT; } // List all albums function list_albums() { global $CONFIG, $AUTHORIZED, $page; $alb_per_page = $CONFIG['albums_per_page']; $maxTab = $CONFIG['max_tabs']; $result = db_query("SELECT count(*) from {$CONFIG['TABLE_ALBUMS']}"); $nbEnr = mysql_fetch_array($result); $nbAlb = $nbEnr[0]; if ($nbAlb <= 0) { echo " \n \n"; msg_box("No album available", "Click here to create one."); echo " \n \n"; return; } $totalPages = ceil($nbAlb / $alb_per_page); if ($page =='' || $page == 0 || $page > $totalPages) $page = 1; $lower_limit = ($page-1) * $alb_per_page; $upper_limit = min($nbAlb, $page * $alb_per_page); $limit = "LIMIT ". $lower_limit . "," . ($upper_limit-$lower_limit); $result = db_query("SELECT * from $CONFIG[TABLE_ALBUMS] order by date asc $limit"); while ($row = mysql_fetch_array($result)) { $result2 = db_query("SELECT DATE_FORMAT(ctime, \"%M, %D\") as date, filepath, filename, pwidth, pheight from $CONFIG[TABLE_PICTURES] where aid=$row[aid] ORDER BY pid DESC LIMIT 1"); $picture = mysql_fetch_array($result2); echo "\n\n"; echo "

" . stripslashes($row["title"]) . "

\n"; echo ""; echo ""; // Count the number of pictures for the actual album $result2 = db_query("SELECT count(*) as picnumber from $CONFIG[TABLE_PICTURES] where aid=$row[aid]"); $pic_count = mysql_fetch_array($result2); $count = $pic_count['picnumber']; // Inserts a thumbnail if the album contains 1 or more images if ($count > 0) { $image_size = compute_img_size($picture['pwidth'], $picture['pheight'], $CONFIG['thumb_width']); echo "\"\""; } else { echo "\"\""; } echo "\n\n"; if ($AUTHORIZED) show_albummenu($row['aid'], ($nbAlb > 1)); echo "

" . nl2br(stripslashes($row["description"])) . "

\n"; echo "

$count " . plural($count, "picture") . ($count ? ", last one added on $picture[date]" : "" )."

\n"; echo "\n"; } // Display tabs when albums list spreads over more than one page if ($totalPages > 1) { $navbuttons = ''."\n"; $navbuttons .= '\n"; $navbuttons .= ''; $navbuttons .= '\n"; if ($totalPages > $maxTab){ $start = max(2, $page - floor(($maxTab -2)/2)); $start = min($start, $totalPages - $maxTab +2); $end = $start + $maxTab -3; } else { $start = 2; $end = $totalPages-1; } for ($currPage = $start ; $currPage <= $end; $currPage++) { $navbuttons .= ''; if ($currPage == $page) { $navbuttons .= '\n"; } if ($totalPages > 1){ $navbuttons .= ''; $navbuttons .= '\n"; } $navbuttons .= "
'; $navbuttons .= "$nbAlb albums on $totalPages ".plural($totalPages, "page")."'; $navbuttons .= "1"; } else { $navbuttons .= ''; $navbuttons .= "$currPage"; } else { $navbuttons .= ''; $navbuttons .= "$totalPages"; } else { $navbuttons .= '
\n"; echo "$navbuttons\n"; } else { echo "$nbAlb albums\n"; } } /************************************************************************** * Main code **************************************************************************/ if (isset($page)){ $USER['lap'] = $page; } elseif (isset($USER['lap'])){ $page = $USER['lap']; } pageheader("Albums"); starttable(); list_albums(); endtable(); starttable(); include('picstat.php'); endtable(); if ($CONFIG['admin_username'] == 'admin' && $CONFIG['admin_password'] == 'admin'){ starttable(); ?> Coppermine Photo Gallery running in DEMO mode

This mode allows to test all functions of Coppermine Photo Gallery.
Be sure to have a look to the 'ADMIN' section. You can delete comments, pictures, and albums, however the pictures are never physically deleted.

Tips :
– If no album exists, you need to create one first.
– If "search new pictures" find no new picture, delete a picture or an album.
– To move pictures, you need at least two albums.