HEX
Server: Apache/2.2.22 (Debian)
System: Linux ns382018.ip-46-105-97.eu 3.14.32-xxxx-grs-ipv6-64 #9 SMP Thu Oct 20 14:53:52 CEST 2016 x86_64
User: web279 (5281)
PHP: 5.4.45-0+deb7u8
Disabled: NONE
Upload Files
File: /var/www/clients/client0/web279/web/MTDrubik/themes/twentyseventeen/category-2.php
<?php
get_header();
$Id_category=get_query_var('cat');//id de la categorie
$Name_category=get_cat_name($Id_category);// nom de la categorie
//$cat=$_REQUEST['cat'];

?>

<section>
  <div class="section_box1_frame">
    <div class="container">
      <div class="title_nous_sommes wow fadeInDown" data-wow-duration='1s'><?php echo $Name_category; ?></div>
      <!--title_expert-->
      <div class="box_produits_frame">
      <?php
		query_posts( 'cat='.$Id_category.'&orderby=date&order=desc'); 
		while ( have_posts() ) : the_post();
		?>
        <div class="prodframe_1">
 <div class="contenu_prodframe">
	<div class="img_prodframe"> 
    <?php
						
						foreach ( get_field ( 'gallery' ) as $nextgen_gallery_id ) :
								if ( $nextgen_gallery_id['ngg_form'] == 'album' ) {
									$iddgalerie = $nextgen_gallery_id['ngg_id'] ; //NextGEN Gallery album
								} elseif ( $nextgen_gallery_id['ngg_form'] == 'gallery' ) {
									 $iddgalerie = $nextgen_gallery_id['ngg_id'] ; //NextGEN Gallery gallery
								}
							endforeach;
							
							
							
							/*$idgalerie = get_field('gallery');
							print_r($idgalerie);
							
							$idgalerie = $idgalerie['ngg_id'];*/
							$resultats = $wpdb->get_results("select * from dr_ngg_pictures, dr_ngg_gallery where dr_ngg_pictures.galleryid = dr_ngg_gallery.gid AND galleryid = '$iddgalerie'") ;
						if($iddgalerie!=""){?>
    <div class="icone_gallery"><a class="ghani-<?php the_ID() ; ?>" href="javascript:;"><img src="<?php bloginfo('template_url'); ?>/images/gallery.png"> </a>
    
    </div>
    <?php } ?>
    <img src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID)); ?>"> </div>
     <div class="tit_prodframe1"><?php the_title(); ?></div>
     
<script>
						$(".ghani-<?php the_ID() ; ?>").click(function() {
						$.fancybox.open([
						<?php
						 $m=0; 
						foreach ( get_field ( 'gallery' ) as $nextgen_gallery_id ) :
								if ( $nextgen_gallery_id['ngg_form'] == 'album' ) {
									$iddgalerie = $nextgen_gallery_id['ngg_id'] ; //NextGEN Gallery album
								} elseif ( $nextgen_gallery_id['ngg_form'] == 'gallery' ) {
									 $iddgalerie = $nextgen_gallery_id['ngg_id'] ; //NextGEN Gallery gallery
								}
							endforeach;
							
							
							
							/*$idgalerie = get_field('gallery');
							print_r($idgalerie);
							
							$idgalerie = $idgalerie['ngg_id'];*/
							$resultats = $wpdb->get_results("select * from dr_ngg_pictures, dr_ngg_gallery where dr_ngg_pictures.galleryid = dr_ngg_gallery.gid AND galleryid = '$iddgalerie'") ;
						if($iddgalerie!=""){
						foreach ($resultats as $post) {
						$m++;
						}}
						?>
		
						<?php 
							$n=0; 
							foreach ( get_field ( 'gallery' ) as $nextgen_gallery_id ) :
								if ( $nextgen_gallery_id['ngg_form'] == 'album' ) {
									$iddgalerie = $nextgen_gallery_id['ngg_id'] ; //NextGEN Gallery album
								} elseif ( $nextgen_gallery_id['ngg_form'] == 'gallery' ) {
									 $iddgalerie = $nextgen_gallery_id['ngg_id'] ; //NextGEN Gallery gallery
								}
							endforeach;
							
							
							
							/*$idgalerie = get_field('gallery');
							print_r($idgalerie);
							
							$idgalerie = $idgalerie['ngg_id'];*/
							$resultats = $wpdb->get_results("select * from dr_ngg_pictures, dr_ngg_gallery where dr_ngg_pictures.galleryid = dr_ngg_gallery.gid AND galleryid = '$iddgalerie'") ;
							// Parcours des resultats obtenus
							if($iddgalerie!=""){ 
							foreach ($resultats as $post) {
							$n++;
				 ?> 
				 
							{
								href : '<?php echo "http://www.rubikdesign.tn/".$post->path."/".$post->filename;?>',
							}<?php if($n!=$m){ echo ',' ;} ?>
							<?php }} ?>
						], {
							
						});
					});
					</script>
</div>
 </div><!--col-md-2 col-sm-3 col-xs-12-->
        <?php endwhile;  wp_reset_query(); ?>
        <div class="clear"></div>
      </div>
      <!--box_derniers_nv-->
    </div>
    <!--container-->
  </div>
  <!--bloc_nous_sommes-->
</section>
<?php get_footer(); ?>