<?php
include("ust.php");

##-> Video Galerisi Modülü
$modul_getir=mysql_query("SELECT * FROM moduller WHERE modul_adi='video_galeri'"); 
$getir=mysql_fetch_array($modul_getir); 
$modul_durum = $getir['modul_durum'];
$m_g_sira_sayi = $getir['modul_v1'];
$video_m_s_limit = $getir['modul_v2'];
if($modul_durum == "acik"){
?>
	
	<br>
	<section class="blog-layout news-default">
	<div class="container">
	<h2><?php echo $dil_v_getir['m28']; ?></h2>
	<hr>
	
	<div class="row">
	
	<?php
	
	$sayfada = $video_m_s_limit; 
	$sorgu = mysql_query('SELECT COUNT(*) AS toplam FROM video_galeri');
	$sonuc = mysql_fetch_assoc($sorgu);
	$toplam_icerik = $sonuc['toplam'];
	$toplam_sayfa = ceil($toplam_icerik / $sayfada);
	$sayfano = g("sayfa");
	$sayfa = isset($sayfano) ? (int) $sayfano : 1;
	if($sayfa < 1) $sayfa = 1; 
	if($sayfa > $toplam_sayfa) $sayfa = $toplam_sayfa; 
	$limit = ($sayfa - 1) * $sayfada;
	$sorgu = mysql_query('SELECT * FROM video_galeri ORDER BY id DESC LIMIT ' . $limit . ', ' . $sayfada);
 
	while($icerik = mysql_fetch_assoc($sorgu)) {
	$baslik = $icerik['baslik'];
	$vid_link = $icerik['m4'];
	
	$a=array('https://www.youtube.com/watch?v=',''); 
	$b=array('',''); 
	$son=str_replace($a,$b,$vid_link); 

	
	if($blog_m_o_sayi == "evet"){ $t_o_k = '<li class="view"><i class="fa fa-eye"></i>'.$makale_goruntulenme.'</li>';}else{}
	echo '
	<div class="col-lg-'.$m_g_sira_sayi.' col-md-6 col-12">
	<a href="'.$vid_link.'" class="video video-popup mfp-iframe">
	<div class="single-news ">
	<div class="news-head overlay ">
	<img src="http://img.youtube.com/vi/'.$son.'/maxresdefault.jpg" alt="'.$baslik.'">
	</div>
	<div class="news-body">
	<div class="news-content">
	<h3 class="news-title"><a ><center>'.$baslik.'</center></a></h3>
	</div>
	</div>
	</div>
	</a>
	</div>
	';
	}
	
	?> 
	
	</div>
	
	<div class="row">
	<div class="col-12">
	<div class="pagination-plugin">
	<ul class="pagination-list">
	<?php $verino = g("verino"); if(empty($verino)){ ?>
	<?php
	for($s = 1; $s <= $toplam_sayfa; $s++) {
	if($sayfa == $s) { 
	echo '<li class="page-numbers current"><a href="video-galeri/?sayfa='.$s.'">'.$s.'</a></li>'; 
	}else{
	echo '<li class="page-numbers "><a href="video-galeri/?sayfa='.$s.'">'.$s.'</a></li>';
    }}
	?>
	<?php }else{ ?>
	<?php
	for($s = 1; $s <= $toplam_sayfa; $s++) {
	if($sayfa == $s) { 
	echo '<li class="page-numbers current"><a href="video-galeri/'.$verino.'?sayfa='.$s.'">'.$s.'</a></li>'; 
	}else{
	echo '<li class="page-numbers "><a href="video-galeri/'.$verino.'?sayfa='.$s.'">'.$s.'</a></li>';
    }}
	?>
	<?php } ?>
	</ul>
	</div>
	</div>
	</div>
	
	<br>
	
	</div>
	</section>

		
<?php
include("alt.php"); }else{echo '<meta http-equiv="refresh" content="0;URL=anasayfa/"> ';}
?>		