Hallo,
ich hab das problem
Es sollte zeigen wie viele User geliked haben das geht nicht kann mir einer helfen?
Hoffe ihr könnt mir helfen
PHP
<?php
require_once('./data_classes/server-data.php_data_classes-core.php.php');
require_once('./data_classes/server-data.php_data_classes-session.php.php');
$body_id = "news";
$pageid = "11";
require_once('./templates/community_subheader.php');
require_once('./templates/community_header.php');
$news_id = FilterText($_GET['web-articles-id']);
$main_sql = mysql_query("SELECT * FROM cms_news WHERE id = '".$news_id."'") or die(mysql_error());
$article_exists = mysql_num_rows($main_sql);
if($article_exists == "1"){
$news = mysql_fetch_assoc($main_sql);
$pagename = "News - ".HoloText($news['title'])."";
} else {
$main_sql = mysql_query("SELECT * FROM cms_news ORDER BY ID DESC") or die(mysql_error());
$news = mysql_fetch_assoc($main_sql);
$news_id = $news['id'];
$pagename = "News - ".HoloText($news['title'])."";
}
///////////////////////////////////////////////////////////
//// Voting:
///////////////////////////////////////////////////////////
if(isset($_GET['vote']) || FilterText($_GET["vote"]) == "like" || FilterText($_GET["vote"]) == "unlike"){
$vote = FilterText($_GET['vote']);
$usercheck = mysql_query("SELECT id_user FROM cms_news_vote WHERE id_user = '".$my_id."' AND id_news = '".$news_id."'") or die(mysql_error());
if(mysql_num_rows($usercheck) < 1){
if($vote == "like"){
mysql_query("INSERT INTO `cms_news_vote` (id_user,id_news,vote_like,vote_unlike) VALUES ('".$my_id."','".$news_id."','1','0')") or die(mysql_error());
} else {
mysql_query("INSERT INTO `cms_news_vote` (id_user,id_news,vote_like,vote_unlike) VALUES ('".$my_id."','".$news_id."','0','1')") or die(mysql_error());
}
header("location: $path/articles/".$news_id."");
} else {
$msg = "<script>alert(\"Du hast bereits bei diesen News gevotet!\");</script>";
}
}
setlocale(LC_TIME, "de_DE");
$monate = array("January"=>"Januar",
"February"=>"Februar",
"March"=>"März",
"April"=>"April",
"May"=>"Mai",
"June"=>"Juni",
"July"=>"Juli",
"August"=>"August",
"September"=>"September",
"October"=>"Oktober",
"November"=>"November",
"December"=>"Dezember");
?>
<style>
.watch-sparkbars {
width: 250px;
height:4px;
margin:2px 0;
border:1px solid #ccc;
overflow:hidden;
-webkit-border-radius:3px;
-moz-border-radius:3px;
border-radius:3px
}
.watch-sparkbar-likes{
float:left;
height:4px;
border-right:1px solid #fff;
background:#060
}
.watch-sparkbar-dislikes{
float:right;
height:4px;
margin-right:-1px;
background:#c00
}
#news-habblet-container {
width: 397px;
margin: 0;
}
#news-habblet-container .title {
height: 90px;
background:url(../../v2/images/news/news_top.png) no-repeat;
}
#news-habblet-container .title div {
position: relative;
width: 250px;
top: 48px;
left: 78px;
text-align: center;
font-weight: bold;
}
#news-habblet-container .title .habblet-close {
position: relative;
top: 24px;
left: 365px;
cursor: pointer;
width: 15px;
height: 15px;
background: url(../../v2/images/news/close_0.png) no-repeat;
}
#news-habblet-container .title .habblet-close:hover {
background: url(../../v2/images/news/close_1.png) no-repeat;
}
#news-habblet-container #news-ad {
padding: 10px 0 10px 42px;
}
#news-habblet-container .content-container {
background: url(../../v2/images/news/news_mid.png) repeat-y;
}
#news-habblet-container #news-articles {
width: 383px;
max-height: 410px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: 11px;
padding-left: 12px;
overflow: auto;
}
#news-habblet-container .news-footer {
height: 7px;
width: 397px;
background:url(../../v2/images/news/news_btm.png) no-repeat;
}
#news-habblet-container #news-articles .newsitem-date {
color: #888;
font-size: 10px;
margin-top: 2px;
}
#news-articles .news-title {
font-size: 14px;
font-weight: bold;
}
#news-articles p {
padding-top: 5px;
}
#news-ad .ad-message {
text-align: left;
font-size: 9px;
font-style: italic;
font-weight: bold;
padding-top: 8px;
}
#news-articles ul.articlelist li {
padding: 8px 20px;
}
#news-articles ul.articlelist li.even {
background-color: #ecece6;
}
</style>
<div id="container">
<div id="content">
<div id="column1" class="column">
<div class="habblet-container ">
<div class="cbb clearfix orange">
<h2 class="title">News</h2>
<div id="article-archive">
<?php
$sql = mysql_query("SELECT * FROM cms_news ORDER BY id DESC LIMIT 55");
if(mysql_num_rows($sql) > 0) {
$act = "t";
$act_date = time();
$i = 1;
?>
<?php while($row = mysql_fetch_assoc($sql)){ ?>
<?php
if($act == "t") {
if(date("d.m.Y", $row['published']) != date("d.m.Y", time())) {
if($i > 1) {
echo "</ul>";
}
if(date("d.m.Y", $row['published']) == date("d.m.Y", time() - 86400)) {
echo "<h2>Gestern</h2><ul>";
}
$i = 1;
$act = "m";
$act_date = $row['published'];
} else {
if($i == 1) {
echo "<h2>Heute</h2><ul>";
}
}
}
if(date("m.Y", $row['published']) != date("m.Y", $act_date)) {
echo "</ul>";
$act = "nm";
$i = 1;
$monat = strftime("%B", $row['published']);
$text = $monate[$monat]." ". date("Y", $row['published']);
$act_date = $row['published'];
if($i == 1) {
echo "<h2>".$text."</h2><ul>";
}
} else {
if(date("d.m.Y", $row['published']) != date("d.m.Y", $act_date) && $act == "m") {
echo "</ul>";
$i = 1;
$act = "nm";
$monat = strftime("%B", $row['published']);
$text = $monate[$monat]." ". date("Y", $row['published']);
$act_date = $row['published'];
if($i == 1) {
echo "<h2>".$text."</h2><ul>";
}
}
}
?>
<li><?php if($news_id !== $row['id']){ echo"<a href=\"".$path."/articles/".$row['id']."\">"; } ?>
<?php echo $row['title']; ?></a> »
<?php if($news_id !== $row['id']){ echo"</a>"; } ?></li>
<?php $i++; } ?>
</ul>
<?php } ?>
<h2>Mehr News?</h2>
<ul>
<li>
<a href="93.186.200.104/articles" class="article">Alle News anzeigen</a> »
</li>
</ul>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init()</script>
</div>
<div id="column2" class="column">
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper">
<h2><?php echo $news['title']; ?></h2>
<div class="article-meta">Geschrieben am <?php echo date('d.m.Y', $news['published']); ?>
<a href="news.php?category=<?php echo $news['category']; ?>"><?php echo $news['category']; ?></a></div>
<font color="black"><?php echo nl2br($news['longstory']); ?></p></font>
<div class="article-body">
<p><?php echo nl2br($news['shortstory']); ?></p>
<p><b><img src="./web-gallery/album1/users_online.PNG"><?php echo nl2br(HoloText($news['author'], true)); ?></b></p>
<?php
$like_percent = $news['cms_news_vote'] * 100 / $news['votes'];
$dislike_percent = $news['downvote'] * 100 / $news['votes'];
?>
</div>
<?php
if(mysql_num_rows(mysql_query("SELECT * FROM cms_ratings WHERE user_id = '".$my_id."' AND news_id = '".$news_id."'")) < 1){
?>
<?php
}
?>
<div class="article-meta"><h2>News Voting</h2>Wie gefallen dir diese News?</div> <div class="watch-sparkbars"> <div class="watch-sparkbar-likes" style="width: <?php echo $like_percent; ?>%"></div> <div class="watch-sparkbar-dislikes" style="width: <?php echo $dislike_percent; ?>%"></div> </div> <span class="watch-likes-dislikes">Gefällt <font color="green"><?php echo $news['cms_news_vote']; ?></font>, gefällt <font color="red"><?php echo $news['downvote']; ?></font> JiBBa Users nicht </span> <div class="article-body"><li> <?php
if(mysql_num_rows(mysql_query("SELECT * FROM cms_ratings WHERE user_id = '".$my_id."' AND news_id = '".$news_id."'")) < 1){
?>
<div style="float: right"><a href="./articles/<?php echo $news_id; ?>&vote=like"><img src="./web-gallery/v2/images/news/like.png"></a> <a href="./articles/<?php echo $news_id; ?>&vote=dislike"><img src="./web-gallery/v2/images/news/unlike.png"></a></div>
<?php
}
?></div>
<br><br>
</div></div></div>
<?php
if(isset($_GET['commentsite']) && is_numeric($_GET['commentsite'])) {
$site = intval($_GET['commentsite']);
} else {
$site = 1;
}
$per_page = 5;
$count = mysql_num_rows(mysql_query("SELECT * FROM `cms_news_comments` WHERE `article` = '".$news_id."'"));
$aSites = ceil($count / $per_page);
if($aSites == 0) {
$aSites = 1;
}
if($site > $aSites) {
$site = 1;
}
if($site == 1) {
$start = 0;
} else {
$start = $per_page * $site - $per_page;
}
if(isset($_POST['post_comment'])){
$selLastUser = mysql_fetch_assoc(mysql_query("SELECT * FROM `cms_news_comments` WHERE `userid` = '".$my_id."' AND `article` = '" . $news_id . "' ORDER BY `id` DESC"));
$posted_on = time();
$comment = $_POST['comment'];
if($posted_on - 60 > $selLastUser['posted_on']) {
if($comment == NULL){
$error_message = 'Netter Versuch aber ne ;)<br /><br />';
}else{
mysql_query("INSERT INTO `cms_news_comments` (`article`, `userid`, `comment`, `posted_on`) VALUES ('".$news_id."', '".$my_id."', '".htmlentities($comment)."', '".$posted_on."')");
header("Location: /articles/".$news_id."#comments");
}
} else {
$error_message = "<font size='red'>Du kannst nur jede Minute ein Kommentar schreiben!</font><br />";
}
}
$uIn = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$my_id."'"));
if(isset($_GET['delete']) && is_numeric($_GET['delete'])) {
$delete = intval($_GET['delete']);
$num = mysql_num_rows(mysql_query("SELECT * FROM `cms_news_comments` WHERE `id` = '".$delete."'"));
if($num > 0) {
if($delete && $uIn['rank'] >= 7) {
mysql_query("DELETE FROM `cms_news_comments` WHERE `id` = '".$delete."'");
}
}
header("Location: /articles/".$news_id."#comments");
}
?>
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper"><h2>Kommentar schreiben</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if($user->name != 'Guest'){
echo $error_message; ?>
<form action="./articles/<?php echo $news_id; ?>#comments" method="post">
<center><textarea name="comment" cols="70" rows="8" maxlength="500"></textarea></center><br /><br />
<input type="submit" name="post_comment" value="Kommentieren" />
</form>
<?php
}else{
echo 'Du musst eingeloggt sein um zu posten!';
}
?> <br><br>
</div>
</div>
</div>
</div>
<?php
$getComments = mysql_query("SELECT * FROM `cms_news_comments` WHERE `article` = '".$news_id."' ORDER BY `id` DESC LIMIT $start, $per_page");
?>
<a name="comments"></a>
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper"><h2>Kommentare (<?php echo $count; ?>)</h2>
<div class="article-meta"></div>
<div class="article-body">
<?php
if(mysql_num_rows($getComments) == 0){
echo 'Kein Kommentar vorhanden, sei der Erste! :)';
}else{
echo "Seite: ";
for($i = 1; $i <= $aSites; $i++) {
if($i == $site) {
echo "<b>".$i."</b> ";
} else {
echo "<a href='./articles/".$news_id."&commentsite=".$i."#comments'>".$i."</a> ";
}
}
echo '<table width="530px">';
while($Comments = mysql_fetch_assoc($getComments)){
$getUserInfo = mysql_query("SELECT * FROM `users` WHERE `id` = '".$Comments['userid']."'");
$getUserRank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user_ranklist` WHERE `userid` = '".$Comments['userid']."'"));
$userInfo = mysql_fetch_assoc($getUserInfo);
echo "
<tr>
<td width='90px' valign='top'>
<div style='float:left'><img src='http://www.habbo.de/habbo-imaging/avatarimage?figure=".$userInfo['look']."&head_direction=3&direction=4&gesture=sml'></div>
";
if($getUserRank['rank'] == 7){
echo '<br /><br /><br /><br /><br /><div align="right" style="padding-left: 35px;position: absolute; z-index:1"><img src="http://93.186.200.104/c_images/album1584/HH1.gif"></div>';
} elseif($getUserRank['rank'] == 6 OR $getUserRank['rank'] == 5 OR $userInfo['rank'] == 8 OR $userInfo['rank'] == 7) {
echo '<br /><br /><br /><br /><br /><div align="right" style="padding-left: 35px; position: absolute; z-index:1"><img src="http://93.186.200.104/c_images/album1584/cm.gif"></div>';
}
echo "
</td>
<td width='530px' valign='top'>
<strong>"; if($uIn['rank'] >= 7) { echo "<a href='./articles/".$news_id."&delete=".$Comments['id']."#comments'>X</a> "; } echo "Kommentar: ".$news_row['title']."</strong><br /><br />";
echo nl2br($Comments['comment']);
echo "
</td>
</tr>
<tr>
<td width='90px' valign='top'>
</td>
<td width='427px' align='right'>
<i>geschrieben von <strong><a href='#'>".$userInfo['username']."</a></strong></i><br />
</td>
</tr>
<tr><td colspan='2'><hr></td></tr>";
}
echo "</table>";
}
?>
</div>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
</div>
<?php require_once('./templates/community_footer.php'); ?>
Alles anzeigen