<!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" dir="ltr" lang="tr">
<?php include "./db.php";
include "class/sayfalama.php"; 
$arama= guvenlik(@$_GET['ara']);
if (empty($arama)){$arama='Lütfen Anahtar Kelime Giriniz...';}?>
<head>
<title>Arama Sonuçları "<?=$arama;?>"</title>
<meta name="description" content=<?=$arama;?> ile ilgili bulunan videolar />
<meta name="keywords" content="<?=$arama;?> ile ilgili videolar" />
<meta name="author" content="<?=$siteadi;?>"/>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<!-- // Stylesheets // -->
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
 
<? include "inc/header.php"; ?>

    <!--Content Sec -->
  <div id="content_sec">
        	<div class="crumb">
            	<ul>
                	<li class="here_text txtcufon">Buradasınız:</li>
                	<li><a href="index.html">Ana Sayfa</a></li>
                    <li><a href=""><?=ucwords(strtolower($arama));?></a></li>
                     <li><a href="#">Sayfa <?=$page;?></a></li>
                  
                </ul>
            </div>
            
            <!--Main Section-->
            <div class="col1">
            	 <div class="clear"></div>  
                <!--Most Popular -->
                
                 <script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/easyTooltip.js"></script>
<script type="text/javascript">
	$(document).ready(function(){	
		$("a").easyTooltip();
	});
</script>

           <style>

#easyTooltip{
	padding:5px 10px;
	border:1px solid #532424;
	background:#195fa4 url(images/barbg.gif) repeat-x;
	color:#fff;
	}
					

</style>
            
                <div class="mostcontainer">
                	<h2>"<?=$arama?>" ile İlgili Bulunan Videolar</h2>
                	<ul>
                    
 <? 
 $SQL = "SELECT COUNT(*) as Toplam FROM videolar where video_adi like '%$arama%'  or video_etiket like '%$arama%' or video_aciklama like '%$arama%'";
$islem = @mysql_query($SQL);
$ToplamKayit = mysql_fetch_array($islem);
$count = $ToplamKayit['Toplam'];


 
 ?>    
 <? if ($count == 0) {
?>
<p>"<?=$arama?>" ile ilgili sonuç bulunamadı.</p>
</br>
                
                    
                                          <?php } else {
			      						 
$al=mysql_query("Select * From videolar where video_adi like '%$arama%'  or video_etiket like '%$arama%' or video_aciklama like '%$arama%' Order By id desc Limit $nedir,$perpage");
while($goster=mysql_fetch_array($al)){
    //değerleri değişken yapma
$seo = $goster['id'];
	?>
    
                    	<li>
                        	<div class="vediodiv">
            
                            	<a href="<?=seo($goster['video_adi']); ?><?="-"?><?=$seo?>.html" title="<?=$goster['video_adi']?>" ><img height="99" width="147" src="<?=$goster['video_resim']; ?>" alt="" />
                                	<span class="time"><?=$goster['video_sure']; ?></span>
                                </a>
                            	
                            </div>
                        	<div class="clear"></div>
                            	<?php $izlenme = mb_substr($goster['video_adi'],0,20,'UTF-8'); ?>
                        	<p><a class="colr2" href="<?=seo($goster['video_adi']); ?><?="-"?><?=$seo?>.html" title="<?=$goster['video_aciklama']?>"><?=$izlenme; ?></a></p>
							<p class="viewcounts"><?=$goster['video_izlenme']; ?> Kere izlendi</p>
							
                        </li>
                  
                    <? } }?>
               </ul>
                </div>
            <div class="clear"></div>
            <!--Pagination -->
      <div class="pagenation">
            	<div class="arrow">
             		<a href="arama-sonucu-<?=$arama?>-sayfa-<?=$page-1;?>.html"><img src="images/paginationleft.gif"  alt=" " /></a>   
                </div>
            	<div class="bg">
          
       <?  
						
						 if($count > $perpage) :
  $x = 4;
  $lastP = ceil(($count / $perpage));
  
      for($i=1; $i>=$page; $i--) {
   
  }

						?>
       <?php 

  // sayfa 1'i yazdýr
  if($page==1) echo "<a href='arama-sonucu-$arama-1.html'>1</a>";
  
  else echo "<a href='arama-sonucu-$arama-1.html'>1</a>";
  if($page-$x > 5) {
    echo " <a href=>...</a> ";
    $i = $page-$x;
  } else {
    $i = 2;
  }
  // +/- $x sayfalarý yazdýr
  for($i; $i<=$page+$x; $i++) {
    if($i==$page) 
	echo "<a href=#> $i </a>"; 
    else 
	echo "<a href=arama-sonucu-$arama-sayfa-$i.html>$i</a> ";
    if($i==$lastP) break;
  }
  // "..." veya son sayfa
  if($page+$x < $lastP-1) {
    echo "<a href=#>...</a> ";
    echo " <a href=arama-sonucu-$arama-sayfa-$lastP.html>$lastP</a>";
  } elseif($page+$x == $lastP-1) {
    echo " <a href=arama-sonucu-$arama-sayfa-$lastP.html>$lastP</a>";
  }

  endif;
  
    // sonraki sayfa
	
  for($i=1; $i<=$page; $i++) {
    if($i==$lastP)
	 break;
  }
?>



                
                </div>
                <div class="arrow">
             
             		<a href="arama-sonucu-<?=$arama?>-sayfa-<?=$i;?>.html"><img src="images/paginationright.gif"  alt="" /></a>   
                </div>
            	
            </div>
            
            
            </div>
            <!--Right Section-->
            <div class="col2">
           	 <h2 class="heading" style="margin-top:6px;" >Kategoriler</h2>
  
              	<div style="margin-top:13px;">	
  <?php 
$baglan  = mysql_query("Select * from kategoriler order by id asc");
while ($goster = @mysql_fetch_array($baglan)) {
	?>           
                
                
                <li class="kategori"><a href="kategori-<?=seo($goster['kat_adi']); ?>-<?=$goster['id'];?>.html"><?=$goster['kat_adi'];?></a></li>
<? } ?>

              		<div class="clear"></div></div>
             
			  <!--ADS -->
             	<h2>Sponsor Bağlantılar </h2>
              <div style="margin-top:10px;" class="ads">
              <?=$sagreklam?>
              </div>
              <!--Feature Vedio -->
              <div class="sideblock2">
              	<h2>Benzer Videolar</h2>
              	<ul>
                 <?php 

$baglan  = mysql_query("Select * from videolar order by rand() limit 5");
while ($goster = mysql_fetch_array($baglan)) {
	$id2 = $goster['id'];
	?>
                	
                    <li>
                    	<div class="thumb">
                           <a href="<?=seo($goster['video_adi']); ?><?="-"?><?=$id2?>.html">
                               	<img width="89" height="59" src="<?=$goster['video_resim']?>"  alt="" />
                   				   
                        		<span class="time"><?=$goster['video_sure']?></span>
                           	</a>
                         </div>
                    	 <div class="description">
                           	<p><a href="<?=seo($goster['video_adi']); ?><?="-"?><?=$id2?>.html"> <?=$goster['video_adi']?></a></p>
                           	<p class="viewcounts"><?=$goster['video_izlenme']?> Kere izlendi</p>
                           </div>
                    </li>
                    <? } ?>
                </ul>
             <div class="clear"></div>
             </div>
        </div>
        <div class="clear"></div>
	 </div> 
	<div class="clear"></div>
	</div>
<!-- bottom section-->
<? include "inc/footer.php"; ?>
