<?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)){ 
$url = $_GET['url'];
$gelen = mysql_query("select * from news where sefurl='$url'"); if(mysql_num_rows($gelen)=="0"){ header("Location:404.php"); exit(); }else{
while($yazdir = mysql_fetch_array($gelen)){ $id = $yazdir['id']; $uID = $yazdir['uID'];

$zzz = mysql_query("select * from newskat where sefurl='".$yazdir['kategori']."'"); while($uuu = mysql_fetch_array($zzz)){ 

			$yorum_za=strtotime($yazdir['tarih']);
			$ay=array('','Ocak','Şubat','Mart','Nisan','Mayıs','Haziran','Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'); 
			$yorum_z=date('d',$yorum_za)." ".$ay[date("n",$yorum_za)]." ".date('Y', $yorum_za); ?>
<!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="description" content="<?php echo $yazdir['description']; ?>" />
	<meta name="keywords" content="<?php echo $yazdir['keywords']; ?>" />	
	<meta name="author" content="radyo sitesi, radyo dinle" />	
	<link rel="shortcut icon" href="/images/favicon.png">
	<title><?php echo $yazdir['baslik']; ?> | <?php echo $print['title']; ?></title>	
	<link rel="shortcut icon" href="/images/favicon.png">
	<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.validate.min.js"></script>	
	<script type="text/javascript" src="js/jquery.animate-shadow.js"></script>
<script type="text/javascript">
jQuery(document).ready(function () {
    jQuery("#commentForm").validate();
});

	function ChangeCode(){
		var NewSecurity= "<img src='js/security.php?rnd="+Math.random()+"' alt='guvenlik' style='border: 1px solid #999999;' />";
		$("#security").html(NewSecurity);
		return false;
	}
</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 id="entry">
          <div id="post-top">
            <h3 id="post-title"><?php echo $yazdir['baslik']; ?> <span class="comment_bubble"><?php echo $yazdir['yorum']; ?></span></h3>
            <div class="post-meta">
	<span class="posting-date"><?php echo $yorum_z; ?></span> <span class="label"><?php echo $uuu['baslik']; ?></span> <span class="print"><a onclick="window.print()" href="#">Yazdır</a></span> </div>
          </div>	<img style="padding-bottom:20px;" src="<?php echo $yazdir['resimyolu']; ?>" width="680" height="306" alt="" />
          <div class="entry-content">
	
	<?php echo $yazdir['icerik']; ?><br><br>
            <div class="social_sharing_post"> 
	<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/tr_TR/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" style="padding-right:40px;" data-send="false" data-layout="button_count" data-width="450" data-show-faces="true"></div>

<a href="https://twitter.com/share" class="twitter-share-button" data-lang="tr">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>		

<div class="g-plusone" data-size="medium"></div>
<script type="text/javascript">
  window.___gcfg = {lang: 'tr'};

  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>			
			</div>
          </div>
          <div id="related_posts" class="clearfix">
            <h3><span>Diğer Haberler</span></h3>
            <ul>
<?php $dgh = mysql_query("select * from news order by id desc limit 0,4"); while($hdg = mysql_fetch_array($dgh)){ ?>			
              <li>
		<?php if($print['seourl']==".php"){ ?>  
                <div class="thumb"><a href="single.php?url=<?php echo $hdg['sefurl']; ?>"><img src="<?php echo $hdg['resimyolu']; ?>" width="144" height="105" alt="" /></a></div>
		<?php }elseif($print['seourl']==".html"){ ?>
                <div class="thumb"><a href="haber-<?php echo $hdg['sefurl']; ?>.html"><img src="<?php echo $hdg['resimyolu']; ?>" width="144" height="105" alt="" /></a></div><?php } ?>		
                <div class="heading-container">
		<?php if($print['seourl']==".php"){ ?>		
                  <h4 class="post_title"><a href="single.php?url=<?php echo $hdg['sefurl']; ?>"><?php echo $hdg['baslik']; ?></a></h4>
		<?php }elseif($print['seourl']==".html"){ ?>
                  <h4 class="post_title"><a href="haber-<?php echo $hdg['sefurl']; ?>.html"><?php echo $hdg['baslik']; ?></a></h4><?php } ?>		
                  <span class="line"></span> <span class="comment_number"><?php echo $hdg['yorum']; ?> Yorum</span> </div>
              </li>
	<?php } ?>		  
            </ul>
          </div>
        </div>
        <div id="comments">
          <h3>Yorumlar</h3>
          <ol>
<?php $bnm = mysql_query("select * from comments where hID='$id' AND onay='1' order by id desc"); if(mysql_num_rows($bnm)=="0"){ echo '<br><font color="#1D8D54"><b>Bu yazıya henüz bir yorum eklenmemiş. İlk yorum yazan siz olun!</b></font>'; }else{ while($aud = mysql_fetch_array($bnm)){ ?>
            <li>
              <div class="line"></div>
              <div class="image"> <img alt="" src="css/images/gravatar.jpg" /> </div>
              <div class="details">
                <div class="name"> <span class="author"> <?php echo $aud['adsoyad']; ?> </span> <span class="comment-date"> <?php $yorum_za1=strtotime($aud['tarih']); $ay1=array('','Ocak','Şubat','Mart','Nisan','Mayıs','Haziran','Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'); 
			$yorum_z1=date('d',$yorum_za1)." ".$ay1[date("n",$yorum_za1)]." ".date('Y', $yorum_za1); echo $yorum_z1; ?></span> </div>
                <p><?php echo $aud['yorum']; ?></p>
              </div>
			</li>
	<?php } } ?>
          </ol>
          <div class="clear"></div>
          <div id="respond">
            <h3>Yorum Gönder</h3>
<?php
if(isset($_POST['gonder'])){

 $adsoyad = $_POST['adsoyad'];
 $email = $_POST['email'];
 $yorum = $_POST['yorum'];
 $tarih = date('Y-m-d');
 $ip = $_SERVER['REMOTE_ADDR'];
 
if($adsoyad==""||$email==""||$yorum==""){

	echo '<br><font color="red"><b>Lütfen tüm alanları doldurun!</b></font><br>';

}else{

if(!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $email)){
	
	echo '<br><font color="red"><b>Lütfen geçerli bir e-mail adresi girin!</b></font><br>';

	}else{
	
$girilen_kod	= trim(strip_tags($_POST['security']));
$guvenlik_kodu	= trim(strip_tags($_SESSION['koruma']));

if($girilen_kod != $guvenlik_kodu){
		echo '<br><font color="red"><b>Güvenlik kodunu eksik yada yanlış girdiniz. Lütfen tekrar deneyin!</b></font><br>'; }else{	

$kayit = mysql_query("insert into comments(hID,adsoyad,email,yorum,tarih,ip) values('$id','$adsoyad','$email','$yorum','$tarih','$ip')"); 

	echo '<br><font color="green"><b>Yorumunuz kaydedilmiştir. Yönetici onayından sonra site de gösterilecektir.</b></font><br>';	
		
	  } } } } ?> 			
            <form id="commentForm" method="post" name="commentForm">
              <p>
                <label for="contactName">Ad Soyad<span class="star">*</span></label>
                <input type="text" name="adsoyad" id="contactName" class="required requiredField" />
              </p>
              <p>
                <label for="email">E-Mail<span class="star">*</span></label>
                <input type="text" name="email" id="email" class="required requiredField email" />
              </p>
              <p>
                <label for="commentsText">Yorum<span class="star">*</span></label>
                <textarea name="yorum" id="commentsText" rows="10" cols="10" class="required requiredField"></textarea>
              </p>
	<div id="security"><img src="js/security.php" alt="guvenlik" style="border: 1px solid #999999;"></div><br>				  
              <p>	  
                <label for="eurl">Güvenlik Kodu<span class="star">*</span></label>
                <input type="text" name="security" class="required requiredField" />
              </p>				  
              <p>
                <input type="hidden" name="submitted" id="submitted" value="true" />
              </p>
              <p class="submit">
                <button class="btn" name="gonder" type="submit">Gönder</button>
              </p>
            </form>
            <div class="clear"></div>
          </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 } } } } ?>