function viewme($id, $classname, $classID)
 {
     $this->getByID($id);
     $gp = new Galleryphoto();
     $arrCar = $gp->getWhere("photo_filename !='' AND gallery_id = '{$this->gallery_id}'  ORDER BY photo_zindex DESC ");
     //pr($arrCar);
     $arr['id'] = $id;
     $arr['arrCar'] = $arrCar;
     //        Mold::theme("Pages/Carousel_attachment",$arr);
     $layout_id = "Carousel_attachment";
     $file = Layout::getFile($layout_id);
     //        echo "Pages/".$layout_id."/".$file;
     Mold::theme("Pages/" . $layout_id . "/" . $file, $arr);
 }
 function id($args)
 {
     list($id, $name) = $args;
     $id = tin($id);
     $gal = new Gallery();
     $gal->getByID($id);
     //        pr($gal);
     $gs = new Galleryphoto();
     $arrPic = $gs->getWhere("gallery_id = '{$id}' ORDER BY photo_zindex DESC");
     $arr['gal'] = $gal;
     $arr['id'] = $id;
     $arr['arrPic'] = $arrPic;
     $layout_id = "Gallery_id";
     $file = Layout::getFile($layout_id);
     //        echo "Pages/".$layout_id."/".$file;
     Mold::theme("Pages/" . $layout_id . "/" . $file, $arr);
     //        Mold::theme("Pages/Gallery_id",$arr);
 }
    @media screen and (min-width: 481px) and (max-width: 768px) {
        #grid[data-columns]::before {
            content: '2 .column.size-1of2';
        }
    }
    @media screen and (min-width: 769px) {
        #grid[data-columns]::before {
            content: '3 .column.size-1of3';
        }
    }
</style>
<div class="col-md-8 col-md-offset-2" style="margin-top: 100px;">
    <div id="grid"data-columns>
        <?php 
foreach ($arrGal as $ga) {
    $gs = new Galleryphoto();
    $gs->getMainpic($ga->gallery_id);
    ?>
            <div class="gallery">
                <a href="<?php 
    echo _LANGPATH;
    ?>
galleryfe/id/<?php 
    echo $ga->gallery_id;
    ?>
/<?php 
    echo tot_url($ga->gallery_name);
    ?>
">
                    <img src="<?php 
    echo _SPPATH . _PHOTOURL . "thumbnail/" . $gs->photo_filename;
 function galleryUpdateDesPic()
 {
     $pid = isset($_POST['pid']) ? addslashes($_POST['pid']) : 0;
     if ($pid == 0) {
         die('No ID');
     }
     $newname = trim(rtrim(isset($_POST['newname']) ? addslashes($_POST['newname']) : '0'));
     if ($newname == '0') {
         die('No ID');
     }
     if ($newname == "Click here to enter description") {
         die('No Update');
     }
     $gal = new Galleryphoto();
     $gal->getByID($pid);
     $gal->photo_description = trim(rtrim($newname));
     $gal->load = 1;
     $gal->save();
 }