Advertisement
Guest User

a

a guest
Apr 3rd, 2016
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.27 KB | None | 0 0
  1. <?php include("fonksiyonlar/config.php"); ?>
  2.  
  3. <?php
  4. $id=$_GET['id'];
  5. $iceriksorgu=mysql_query("Select * from icerikler where icerikID=$id");
  6. $icerikSonuc=mysql_fetch_object($iceriksorgu);
  7.  
  8. // ip hit başladı
  9. if(!isset($icerikSonuc->icerikID))
  10. {
  11.     header("index.php");
  12. }
  13. else
  14. {
  15.     $ip         = $_SERVER['REMOTE_ADDR'];
  16.     date_default_timezone_set('Europe/Istanbul');
  17.     $tarih      = date("Y-m-d");
  18.     $saat       = date("H:m:s");
  19.     $hitSorgu   = mysql_query("Select * from reyting where ipAdresi='$ip' and tarih='$tarih' and icerikID='$icerikSonuc->icerikID'");
  20.     $hitSonuc   = mysql_fetch_object($hitSorgu);
  21.     if(!$hitSonuc)
  22.     {
  23.         mysql_query("Insert Into reyting(ipAdresi,tarih,icerikID,saat) values('$ip','$tarih','$icerikSonuc->icerikID','saat')");
  24.         mysql_query("Update icerikler set izlenme=izlenme +1 where icerikID='{$icerikSonuc->icerikID}'");
  25.     }
  26. }
  27.  
  28.  
  29. ?>
  30. <!-- Detay sayfası başladı-->
  31.  
  32.         <div class="content box">
  33.             <!-- İçerik başlığı-->
  34.             <h1 class="title"><?php echo $icerikSonuc->icerikBaslik?></h1>
  35.             <!-- İçerik-->
  36.             <p><?php echo $icerikSonuc->icerik?></p>
  37.  
  38.             <div class="outer none"><span class="inset"><img src="style/images/art/se1.jpg" alt="" title="" /></span>
  39.             </div>
  40.             <!-- İndirme Dosyaları-->
  41.             <?php echo $icerikSonuc->aciklama;?>
  42.                     <!-- Etiketler başladı-->
  43.                     <div class="tags"> Tags:
  44.             <?php
  45.            
  46.                 $keywords=preg_split("/[,]+/",$icerikSonuc->seoKey);
  47.                 if($keywords[0]!=0)
  48.                 {
  49.                     for($i=0; $i<count($keywords);$i++)
  50.                     {
  51.                         $etiketler = mysql_query("select seo from seokelimeler where seoID='{$keywords[$i]}'");
  52.                         $etiketsonuc    = mysql_fetch_object($etiketler);
  53.                         echo '<a href="#">'.$etiketsonuc->seo.'</a> ';
  54.                     }
  55.                 }
  56.            
  57.             ?>
  58.            
  59.             </div>  <!-- Etiketler bitti-->
  60.         <!-- Kullanılan dosyalar başladı -->
  61. <div class="tags">
  62.         <?php
  63.             $dosyaURLsorgu  =   mysql_query("Select * from dosyalar where icerikID='{$id}'");
  64.             if(mysql_num_rows($dosyaURLsorgu)>0)
  65.             {
  66.                 echo 'Dosyalar :';
  67.                 while($dosyaURLsonuc =mysql_fetch_object($dosyaURLsorgu))
  68.                     {
  69.                         echo ' <a href="dosyalar/'.$dosyaURLsonuc->dosyaURL .'">'.$dosyaURLsonuc->dosyaURL .'</a>';
  70.                     }
  71.             }
  72.  
  73.         ?>
  74.  
  75. </div> <!-- Kullanılan dosyalar bitti -->
  76.        
  77.         <!-- Yorumları çekiyoruz -->     
  78.         <div id="comment-wrapper" class="box">
  79.          
  80.           <!-- Begin Comments -->
  81.           <div id="comments">
  82.                
  83.             <h3 id="comments-title">Yorumlar</h3>
  84.        
  85.             <ol id="singlecomments" class="commentlist">
  86.             <li class="comment">
  87.             <!-- Yorumlar başladı-->
  88.             <?php
  89.                 $yorumSorgu =   mysql_query("Select * from yorumlar as y left join uyeler as u on u.uyeID=y.uyeID where y.icerikID='{$id}'");
  90.                 if(mysql_num_rows($yorumSorgu)>0)
  91.                     {
  92.                 while($yorumSonuc   =   mysql_fetch_object($yorumSorgu))
  93.                         {
  94.             ?>
  95.                 <div class="comment">
  96.                     <div class="comment-author vcard user frame">
  97.                         <img alt="" src='uyeResimleri/<?php echo $yorumSonuc->uyeResimURL;?>' class='avatar avatar-70 photo' height='70' width='70' />
  98.                     </div>
  99.                     <div class="message">
  100.                         <!-- <span class="reply-link"><a class="comment-reply-link" href="#">Reply</a></span> -->
  101.                         <div class="info">
  102.                             <h2><?php echo $yorumSonuc->uyeAdSoyad;?></h2>
  103.                             <span class="meta"><?php echo $yorumSonuc->yorumTarih;?></span>
  104.                         </div>
  105.                         <div class="comment-body ">
  106.                             <p><?php echo $yorumSonuc->yorum;?></p>
  107.                         </div>
  108.                         <span class="edit-link"></span>
  109.                     </div>
  110.                     <div class="clear"></div>
  111.                 </div>
  112.                 <div class="clear"></div>
  113.                 <?php
  114.                 }
  115.                         }
  116.                     else
  117.                         {
  118.                         echo "Henüz bu mod için yorum yapılmamış. İlk yorumu siz yapabilirsiniz.";
  119.                    
  120.                 }
  121.                 ?>
  122.                 <!-- Yorumlar bitti -->
  123.             </li>  
  124.             </ol>
  125.         </div>
  126.         <!-- End Comments -->
  127.     <?php
  128.         if(isset($_POST['submit']))
  129.             {
  130.                 $yorum=trim(mysql_real_escape_string($_POST['comment']));
  131.                 if(!empty($yorum) || $yorum="")
  132.                     {
  133.                         $ip=$_SERVER['REMOTE_ADDR'];
  134.                         date_default_timezone_set("Europe/Istanbul");
  135.                         $tarih=date("Y-m-d H:m:s");
  136.                         $uyeID=1;//$_SESSION['uyeID'];
  137.                         $icerikID=$id;
  138.                         $aktivite="yorum yapıldı ".$yorum;
  139.                        
  140.                         $yEkle=mysql_query("Insert Into yorumlar(yorum,yorumTarih,uyeID,icerikID,yorumOnay) values('$yorum','$tarih','$uyeID','$icerikID',0)");
  141.                         $aktiviteEkle=mysql_query("Insert Into aktiviteler(tarih,aktiviteAd,uyeID) values('$tarih','$aktivite','$ip','$uyeID')");
  142.                        
  143.                         if(isset($yEkle) && isset($aktiviteEkle))
  144.                             {
  145.                                 echo "<script>alert('Yorumunuz başarıyla eklendi!')</script>";
  146.                                 header("refresh:0; url=index.php?s=detay.php&id".$id);
  147.                                
  148.                             }
  149.                             else
  150.                             {
  151.                                
  152.                                 echo "<script>alert('Yorumunuz eklenemedi!')</script>";
  153.                                 header("refresh:0; url=index.php?s=detay.php&id".$id);
  154.                             }
  155.                    
  156.                     }
  157.                     else
  158.                     {
  159.                         echo "<script>alert('Boş yorum atamazsın! Lütfen bir şeyler yaz.')</script>";
  160.                     }
  161.             }
  162.    
  163.     ?>
  164.     <!-- Üye girişi yapılmışsa yorum kısmını göster -->
  165.         <?php
  166.             $token=1;//$_SESSION['token'];
  167.             $email="kekikcilerakin@gmail.com";//$_SESSION['email'];
  168.             if(isset($token) && isset($email))
  169.             {
  170.         ?>
  171.         <!-- Begin Form -->
  172.         <div id="comment-form" class="comment-form">
  173.        
  174.             <div id="respond">
  175.                         <h3 id="reply-title">Yorum Yazmak İster Misin?</h3>
  176.                        
  177.                         <form action="index.php?s=detay.php&id=<?php echo $id;?>" method="post" id="commentform">
  178.                             <p class="comment-notes">E-posta adresiniz paylaşılmayacaktır ve (*) olan alanlar doldurulması zorunludur. <span class="required"></span></p>
  179.                            
  180.                             <p class="comment-form-comment">
  181.                                 <label for="comment">Yorum</label> <span class="required">*</span>
  182.                                 <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>
  183.                             </p>
  184.                             <p class="form-submit">
  185.                                 <input name="submit" type="submit" id="submit" value="Post Comment" />
  186.                             </p>
  187.                         </form>
  188.             </div><!-- #respond -->
  189.        
  190.         </div>
  191.         <!-- End Form -->  
  192.         <?php
  193.             }
  194.             else
  195.             {
  196.                 echo "Üye girişi yapmadığınız için yorum yazamıyorsun!";   
  197.             }
  198.         ?>
  199.        
  200.         </div>
  201.        
  202.        
  203.         </div>  <!-- Detay sayfası bitti-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement