<?php
session_start();
include("config.php");
include("plugin/functions.php");
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_bin'");
$query = mysql_query("select * from settings");
while($print = mysql_fetch_array($query)){ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="robots" content="noindex,nofollow,nosnippet,noodp,noarchive,noimageindex">	
	<meta name="author" content="radyo sitesi, radyo dinle" />	
	<link rel="shortcut icon" href="/images/favicon.png">
	<title>Videolar | <?php echo $print['title']; ?></title>		
	
	<link rel="stylesheet" media="screen" href="css/superfish.css" type="text/css" />
	<link rel="stylesheet" media="screen" href="css/stylesheet.css" type="text/css" />
	<link rel="stylesheet" media="screen" href="css/color.css" type="text/css" />		
	<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic" type="text/css" />
	
	<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
	<script src="js/hoverIntent.js" type="text/javascript"></script>
	<script src="js/superfish.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="js/custom.js"></script>
	<script type="text/javascript" src="js/jquery.animate-shadow.js"></script>	
</head>
<body>
<?php include("plugin/writelogin.php"); ?> 
<?php include("header.php"); ?> 
  
  <div id="outer-wrapper">
    <div id="content-wrapper">
      <div id="inner-content">
	          
          <div style="    padding-bottom: 0px;" id="post-top">
            <h3 id="post-title">Video Klipler</h3>
          </div>
        <div id="single_post_container">
		
<br>
<?php 

$limit = 6;

$page = @$_GET["page"];

if(empty($page) or !is_numeric($page)) {

$page = 1;

}
	$count			 = mysql_num_rows(mysql_query("SELECT id FROM videos order by id desc"));
	$toplamsayfa	 = ceil($count / $limit);
	$baslangic		 = ($page-1)*$limit;

if($toplamsayfa < @$_GET["page"]){ echo '<meta http-equiv="refresh" content="0;URL=404.php">'; exit(); }else{ }	
	
$sorustur = "SELECT * FROM videos ORDER BY id desc LIMIT $baslangic,$limit";

$yazdir_sorgu = mysql_query($sorustur) or die(mysql_error()); if(mysql_num_rows($yazdir_sorgu)=="0"){

echo '<font color="blue"><b>Eklenmiş bir video bulunamadı! Lütfen daha sonra tekrar deneyin.</b></font>'; }else{

while ($yazdir = mysql_fetch_array($yazdir_sorgu)){ $dmetin = $yazdir['text']; ?>			
        <div style="background: #FDFDFD;    border: 1px solid #DADADA;" class="post_single">
	<?php if($print['seourl']==".php"){ ?>	
            <h4 class="post_title clearfix"><a href="klip.php?url=<?php echo $yazdir['sefurl']; ?>"><?php echo $yazdir['baslik']; ?></a></h4>
	<?php }elseif($print['seourl']==".html"){ ?>
            <h4 class="post_title clearfix"><a href="klip-<?php echo $yazdir['sefurl']; ?>.html"><?php echo $yazdir['baslik']; ?></a></h4><?php } ?>	
            <div style="border-top: 1px solid #E0E0E0;" class="post_content clearfix">
	<?php if($print['seourl']==".php"){ ?>		
              <div class="thumbnail"> <a href="klip.php?url=<?php echo $yazdir['sefurl']; ?>"><img src="<?php echo $yazdir['resimyolu']; ?>" width="150" height="150" alt="" /></a></div>
	<?php }elseif($print['seourl']==".html"){ ?>
              <div class="thumbnail"> <a href="klip-<?php echo $yazdir['sefurl']; ?>.html"><img src="<?php echo $yazdir['resimyolu']; ?>" width="150" height="150" alt="" /></a></div><?php } ?>	
              <div class="summary_article">
        <?php echo kisalt($dmetin, 600); ?>
              </div>
            </div>
	<?php if($print['seourl']==".php"){ ?>		
            <span class="read_more"><a href="klip.php?url=<?php echo $yazdir['sefurl']; ?>">Video İzle</a></span> 
	<?php }elseif($print['seourl']==".html"){ ?>
            <span class="read_more"><a href="klip-<?php echo $yazdir['sefurl']; ?>.html">Video İzle</a></span><?php } ?>	
		</div>
    <div class="clear"></div>		
	  <?php
	  } }
	  echo '<div class="pagenavi clearfix">';
if($count > $limit) : 
  $x = 2; 
  $lastP = ceil($count/$limit); 

  if($page > 1){
  $onceki = $page-1;
  echo "<a class=\"prevpostslink\" style='color:white;' href=\"?page=$onceki\"> << </a>"; 
  }
 
  if($page==1) echo "<span class=\"current\">1</span>"; 
  else echo "<a class=\"page_number\" href=\"?page=1\">1</a>";   
  
  if($page-$x > 2) { 
    echo "..."; 
    $i = $page-$x; 
  } else { 
    $i = 2; 
  } 

  for($i; $i<=$page+$x; $i++) { 
    if($i==$page) echo "<span class=\"current\">$i</span>"; 
    else echo "<a class=\"page_number\" href=\"?page=$i\">$i</a>"; 
    if($i==$lastP) break; 
  }

  if($page+$x < $lastP-1) { 
    echo "<span class=\"extend\">...</span>"; 
    echo "<a class=\"page_number\" href=\"?page=$lastP\">$lastP</a>"; 
  } elseif($page+$x == $lastP-1) { 
    echo "<a class=\"page_number\" href=\"?page=$lastP\">$lastP</a>"; 
  } 

  if($page < $lastP){
  $sonraki = $page+1;
  echo "<a class=\"nextpostslink\" href=\"?page=$sonraki\"> >> </a>"; 
  }
  
endif; echo '</div>';  ?>		
        </div>
      </div>
	  
      <div id="sidebar">
	<?php include("plugin/sidebar.php"); ?>
      </div>
      <div class="clear"></div>
    </div>
  </div>
  
  <div id="footer"> <span id="Scroll"><a href="#">&uarr;</a></span>
    <div id="footer_inner">
<?php echo $print['reklam3']; ?>
      <div class="clear"></div>
      <div class="footer_bottom">
        <ul class="footer_menu">
          <li><a href="index<?php echo $print['seourl']; ?>">Anasayfa</a> /</li>		
<?php $whistle = mysql_query("select * from pages order by sira asc"); while($baby = mysql_fetch_array($whistle)){ if($print['seourl']==".php"){ ?>		
          <li><a href="pages.php?url=<?php echo $baby['sefurl']; ?>"><?php echo $baby['baslik']; ?></a> /</li>
	<?php }elseif($print['seourl']==".html"){ ?>	  
          <li><a href="sayfa-<?php echo $baby['sefurl']; ?>.html"><?php echo $baby['baslik']; ?></a> /</li>
	<?php } } ?>	
          <li><a href="iletisim<?php echo $print['seourl']; ?>">İletişim</a></li>
        </ul>
        <p>&copy; Copyright <?php echo date('Y'); ?>, <?php echo $print['title']; ?>. Tüm hakları saklıdır.</p>
      </div>
    </div>
  </div>
</div>
</body>
</html>
<?php } ?>