<?php
################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- #
## --------------------------------------------------------------------------- #
## ApPHP AdminPanel Pro #
## Developed by: ApPHP <hide@address.com> #
## License: GNU LGPL v.3 #
## Site: http://www.apphp.com/php-adminpanel/ #
## Copyright: ApPHP AdminPanel (c) 2006-2011. All rights reserved. #
## #
################################################################################
header("content-type: text/html; charset=utf-8");
// Initialize the session.
session_start();
define("AP_PATH", "../");
require_once("../inc/settings.inc.php");
if(!module_istalled('calendar')) redirect_to(AP_PATH."html/404.html");
$album_code = isset($_GET['acode']) ? $_GET['acode'] : "";
$output = "";
$pictures_per_line = "5";
$icon_width = "120px";
$icon_height = "90px";
$sql = "SELECT
album_code,
image_text,
image_file,
IF(image_file_thumb != '', image_file_thumb, image_file) as image_file_thumb,
image_text
FROM ".TABLE_GALLERY_IMAGES."
WHERE image_file != '' AND
album_code = '".$album_code."' AND
is_active = 1
ORDER BY priority_order ASC";
$db->Query($sql);
$i = "0";
$output .= "<table class='album_table' border='0' cellspacing='7'>";
$output .= "<tr>";
while($row = $db->FetchAssoc()){
if(($i != 0) && ($i % $pictures_per_line == 0)){
$output .= "</tr><tr>";
}
$output .= "<td valign='top' align='center'>";
$output .= "<a href='../images/gallery/".$row['image_file']."' rel='lyteshow[".$row['album_code']."]' title='".$row['image_text']."'><img src='../images/gallery/".$row['image_file_thumb']."' width='".$icon_width."' height='".$icon_height."' alt='' title='' style='border:1px solid #cccccc; margin-bottom:3px;' /></a>";
$output .= "<br /><span><b>".$row['image_text']."</b></span>";
$output .= "</td>";
$i++;
}
$output .= "</tr>";
$output .= "</table>";
$template = get_include_contents("templates/gallery_album.tpl");
$template = str_replace("{SITE_NAME}", $SETTINGS['site_name'], $template);
$template = str_replace("{TITLE}", lang('gallery_album'), $template);
$template = str_replace("{STYLE}", "../styles/".$SETTINGS['css_style']."/style.css", $template);
$template = str_replace("{GALLERY_ALBUM}", $output, $template);
echo $template;
?>