<?php

/***************************************************************************

 showgallerydetails.php
 -----------------------
 copyright : (C) 2002-2003 The ezContents Development Team

 ***************************************************************************/

/***************************************************************************
 The ezContents Development Team offers no warranties on this script.
 The owner/licensee of the script is solely responsible for any problems
 caused by installation of the script or use of the script.

 All copyright notices regarding ezContents must remain intact on the
 scripts and in the HTML for the scripts.

 For more info on ezContents,
 visit http://www.ezcontents.org/

/***************************************************************************

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the License which can be found within the
 *   zipped package.
 *
 ***************************************************************************/

global $HTTP_SERVER_VARS;
if ( (substr($HTTP_SERVER_VARS["PHP_SELF"],-11) == 'control.php') ||
	 (substr($HTTP_SERVER_VARS["PHP_SELF"],-10) == 'module.php') ||
	 (substr($HTTP_SERVER_VARS["PHP_SELF"],-16) == 'showcontents.php') ) {
	 require_once('./modules/moduleSec.php');
} else {
	require_once('../moduleSec.php');
}

$GLOBALS["ModuleName"] = 'gallery';


include_once ($GLOBALS["admin_home"]."compile.php");

include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_admin.php");
include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_main.php");
include_languagefile ($GLOBALS["modules_home"].$GLOBALS["ModuleRef"]."/",$GLOBALS["gsLanguage"],"lang_gallery.php");


$strQuery = "SELECT * FROM ".$GLOBALS["scTable"]." where galleryid='".$HTTP_GET_VARS["galleryid"]."'";
$result = dbRetrieve($strQuery,true,0,1);

?><center><?php
while ($rsContent = dbFetch($result))
{
   ?>
   <table border="0" width="100%" cellspacing="1" cellpadding="3" class="headercontent">
       <tr>
           <td class="header">
               <?php echo htmlspecialchars($rsContent["title"]); ?>
           </td>
       </tr>
       <tr>
           <td class="tablecontent">
               <?php
               $filename = $rsContent["filename"];
               $fileref = explode('/',$filename);
               $filename = array_pop($fileref);
               $dir = implode('/',$fileref);
               $savedir = getcwd();
               chdir($GLOBALS["rootdp"].$GLOBALS["image_home"].$dir);
               $size = GetImageSize($filename);
               $width  = $size["0"];
               $height = $size["1"];
               chdir($savedir);

               echo '<img src="'.$GLOBALS["image_home"].$rsContent["filename"].'" width="'.$width.'" height="'.$height.'">';
               $bEncodeHTML = true;
               if ($rsContent["artist"] != '')
               {
                  echo '<br /><b>'.ext_print(compile($GLOBALS["tqBlock1"].'html'.$GLOBALS["tqBlock2"].$rsContent["artist"].$GLOBALS["tqBlock1"].$GLOBALS["tqCloseBlock"].'html'.$GLOBALS["tqBlock2"], 'N', 'N', 'L'),$bEncodeHTML, 'L').'</b>';
               }
               if ($rsContent["caption"] != '')
               {
                  echo '<br />'.ext_print(compile($GLOBALS["tqBlock1"].'html'.$GLOBALS["tqBlock2"].$rsContent["caption"].$GLOBALS["tqBlock1"].$GLOBALS["tqCloseBlock"].'html'.$GLOBALS["tqBlock2"], 'N', 'N', 'L'),$bEncodeHTML, 'L');
               }
               if ($rsContent["contactname"] != '') { echo '<br /><b>'.$GLOBALS["tContact"].':</b> '.htmlspecialchars($rsContent["contactname"]); }
               if ($rsContent["contactemail"] != '') { echo '<br /><b>'.$GLOBALS["tEMail"].':</b> <a href="mailto:'.htmlspecialchars($rsContent["contactemail"]).'?subject='.htmlspecialchars($rsContent["title"]).'">'.htmlspecialchars($rsContent["contactemail"]).'</a>'; }
               if ($rsContent["web_page"] != '') { echo '<br /><b>'.$GLOBALS["tWebPage"].':</b> <a href="'.htmlspecialchars($rsContent["web_page"]).'" target="_blank">'.htmlspecialchars($rsContent["web_page"]).'</a>'; }
               ?>
           </td>
       </tr>
       <?php
       ShowContentFooter($GLOBALS["scPostedDate"],$GLOBALS["scPostedBy"],$rsContent);
       ?>
   </table>
   <br />
   <?php
}
dbFreeResult($result);

DetailReturnLink($GLOBALS["tGalleryPage"]);

?>
</center>
