[!MaxiGallery? &pictureTpl=`@FILE:/assets/sniptemplates/maxigallery/picturetpl.html` &display=`pictureview` &css=`assets/sniptemplates/maxigallery/styles.css`!] [!MaxiGallery? &galleryOuterTpl=`@FILE:/assets/sniptemplates/maxigallery/galleryoutertpl.html` &galleryPictureTpl=`@FILE:/assets/sniptemplates/maxigallery/gallerypicturetpl.html` &css=`assets/sniptemplates/maxigallery/styles.css` !]
<img src="[+phx:get=`showpic`+]"..............
<a href="[~[*id*]~]&showpic=[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]"> <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]"..............
<?php $pictureURL = $_GET['showpic']; echo "<img src='".$pictureURL."' border='0'>"; ?>
<?php
//snippet: get_pic
//parameter: &galid >able
$pictureURL = $_GET['showpic'];
if (!isset($_GET['showpic']){
$galid= isset($galid)?$galid:$modx->documentIdentifier;
$gtable = (isset($gtable)) ? $gtable : "maxigallery"; // [ text ]
$orderby = "pos,date";
$offset=0;
$limit = 1;
$path_to_galleries="assets/galleries/"; // [ path ]
$path_to_gal=$path_to_galleries.$galid."/";
//erstes Bild aus Datenbank
$order_direction="ASC";
$rs=$modx->db->select("id,filename", $modx->db->config['table_prefix'].$gtable, "(gal_id='" . $galid . "' AND NOT hide='1')",$orderby.' '.$order_direction, $offset.','.$limit);
$row = $modx->db->getRow($rs);
$firstpic = $path_to_gal.$row['filename'];
$firstpicid = $row['id'];
//letztes Bild aus Datenbank
$order_direction="DESC";
$rs=$modx->db->select("id,filename", $modx->db->config['table_prefix'].$gtable, "(gal_id='" . $galid . "' AND NOT hide='1')",$orderby.' '.$order_direction, $offset.','.$limit);
$row = $modx->db->getRow($rs);
$lastpic = $path_to_gal.$row['filename'];
$lastpicid = $row['id'];
//set Placeholder
$modx->setPlaceholder( 'firstpic' , $firstpic );
$modx->setPlaceholder( 'lastpic' , $lastpic );
$modx->setPlaceholder( 'firstpicid' , $firstpicid );
$modx->setPlaceholder( 'lastpicid' , $lastpicid );
$pictureURL =$firstpic;
}
return "<img src='".$pictureURL."' border='0'>";
?>
<?php
$galid= isset($galid)?$galid:$modx->documentIdentifier;
$gtable = (isset($gtable)) ? $gtable : "maxigallery"; // [ text ]
$orderby = "pos,date";
$offset=0;
$path_to_galleries="assets/galleries/"; // [ path ]
$path_to_gal=$path_to_galleries.$galid."/";
$order_direction="ASC";
$result = $modx->db->select("id,filename", $modx->db->config['table_prefix'].$gtable, "(gal_id='" . $galid . "' AND NOT hide='1')",$orderby.' '.$order_direction, $offset);
if($modx->db->getRecordCount($result) >= 1) {
$output .= '<div class="thumbscontainer">';
while( $row = $modx->db->getRow( $result ) ) {
$output .= '<div class="thumbnail"><a href="[~[*id*]~]?pic='.$row['id'].'"><img src="'.$path_to_gal.'tn_'.$row['filename'].'" border="1" ></a></div>';
}
$output .= '</div>';
}
else {
$output = 'There are no records to show.';
}
return $output;
?>
[!MaxiGallery? &display=`pictureview` !]