<?PHP

/**************************************
    Webutler V3.0 - www.webutler.de
    Copyright (c) 2008 - 2014
    Autor: Sven Zinke
    Free for any use
    Lizenz: GPL
**************************************/


include str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))."/galerie.php";

$folder_galerie = new FolderGalerie;


    
/******* Einstellungen: *******/

$folder_galerie->menuposition = '1'; // 1 = links oder 2 = rechts
$folder_galerie->startordner = '/bilder'; // Startverzeichnis der Galerie
$folder_galerie->root = 'content/media/image'; // relativer Pfad zum Startverzeichnis
$folder_galerie->tabellenspalten = '3'; // Spalten der Bildertabelle
$folder_galerie->lightbox = '1'; // Lightbox: 1 = ja; 0 = nein
$folder_galerie->sortierung = '1'; // 1 = neuste zuerst; 2 = neuste zuletzt; 3 = alphabetisch; 4 = zufällig

/***** Einstellungen Ende *****/



$folder_galerie->serverpath = $webutlercouple->config['server_path'];
$folder_galerie->get_page = $webutlercouple->getpage;

if(!isset($_GET['galerie']) || $_GET['galerie'] == '')
    $_GET['galerie'] = $folder_galerie->startordner;
    
$folder_galerie->get_galerie = $_GET['galerie'];

$galerie_pfad = str_replace("^", "/", $folder_galerie->get_galerie);
$galerie_pfad = str_replace("../", "", $galerie_pfad);
if($galerie_pfad == "")
    $galerie_pfad = $folder_galerie->startordner;

$webutlercouple->autoheaderdata[] = '<link href="'.$folder_galerie->rootpath($folder_galerie->serverpath).'galerie.css" type="text/css" rel="stylesheet" />';
if($folder_galerie->lightbox == '1')
    $webutlercouple->autoheaderdata[] = '<script type="text/javascript" src="includes/javascript/lightbox/lightbox_plus.js"></script>';


/********** Ausgabe **********/

if(is_dir($folder_galerie->root.$galerie_pfad)) {
    echo '<table border="0" cellspacing="0" cellpadding="0" style="width: 100%">'."\n".
         ' <tr>'."\n";
            if($folder_galerie->menuposition == '1') {
                echo $folder_galerie->setmenu($galerie_pfad);
            }
    echo '  <td class="galimgs">'."\n".
         '    <table border="0" cellspacing="10" cellpadding="0" style="width: 100%">'."\n";
                echo $folder_galerie->getfiles($galerie_pfad);
    echo '    </table>'."\n".
         '  </td>'."\n";
            if($folder_galerie->menuposition == '2') {
                echo $folder_galerie->setmenu($galerie_pfad);
            }
    echo ' </tr>'."\n".
         '</table>'."\n";
}

?>
