PhpNukeTurkiye.Com (F)  >> PNT Nuke ve Php-Nuke (F)  >> Genel (F)
DSolu Görünüm İçin Tıklayın "beğen & beğenme"

beriisi: beğen & beğenme (2017/09/29 - 12:20)

Herkese merhaba beğen beğenme kodu ben bu kodları kulanarak Her yazı ve sayfalarımın altında nasıl gösterecem yardım ederseniz çok sevinirim tşk

<link rel="stylesheet" type="text/css" href="css.css">

<?php
include("config.php"); // veritabani bağlantisi yaptik....
$yazi = $db->query("select * from post where id ='1'")->fetch();

echo '<div class="list">'.$yazi['name']."<br/>".$yazi['text'].'</div>';

$emojiList = array(

array("id"=>"1","name"=>"<img border=\"0\" src=\"img/likes.png\" width=\"30\" height=\"20\" title=\"Begendin\">"),
array("id"=>"2","name"=>"<img border=\"0\" src=\"img/unlike.png\" width=\"30\" height=\"20\" title=\"Begenmedin\">"),
array("id"=>"3","name"=>"<img border=\"0\" src=\"img/on.gif\" width=\"20\" height=\"15\" title=\"Muhtesem\">"),
array("id"=>"4","name"=>"<img border=\"0\" src=\"img/over.gif\" width=\"20\" height=\"15\" title=\"Sevdim\">"),
array("id"=>"5","name"=>"<img border=\"0\" src=\"img/kizgin.gif\" width=\"20\" height=\"15\" title=\"Kizginim\">")

);

?>

<?php

if(isset($_GET['save']))
{
$save = intval($_GET['save']);
$ip = GetIP();



$control = $db->query("select * from oylama where ip='$ip' and postID='$yazi[id]'")->rowcount();
if($control==0)
{
if($db->query("insert into oylama(emojiID,ip,postID) values('$save','$ip','$yazi[id]')")){
echo "oylama yapıldı";
header("location: index.php");
}
else
{
echo "Bir Hata İle Karsilastik";
}
}
else
{
$control2 = $db->query("select * from oylama where ip='$ip' and postID='yazi[id]'")->fetch();
if($control2['emojiID']==$save){
if($db->query("delete from oylama where ip='$ip' and emojiID='$save' and postID='$yazi[id]'"))
{
echo "Oylama Kaldırıldı";
header("location: index.php");

}
else{
echo "Bir Hata İle Karsilastik";
}
}else{

$db->query("delete from oylama where ip='$ip' and postID='$yazi[id]'");
$db->query("insert into oylama(emojiID,ip,postID) values('$save','$ip','$yazi[id]')");
header("location: index.php");

}
}
}
?>
<div class="list">
<?php
foreach ($emojiList as $key => $value){
$count = $db->query("select * from oylama where postID='$yazi[id]' and emojiID='$value[id]'")->rowcount();
$url = "?save=".$value['id'];
echo '<a class="listEmoji" href="'.$url.'">'.$value['name'].'(>'.$count.'<)</a>';

}

?>
</div>Ekledi-- 2017/09/29 - 12:23 --YAZILAR ALTINDA GÖSTERMEK İSTEDİĞİMDE ALTTAKİ OYLAMA SİSTEMİ

https://i.hizliresim.com/Mayb56.png

Sonsuzluk: Re: beğen & beğenme (2017/10/09 - 10:52)

Bu video işini görür

[BBvideo 560,340:2013iim2]https://www.youtube.com/watch?v=nE3e68bJdTQ[/BBvideo:2013iim2]