Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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";
- $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);
- } 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 = "Noticias";
- }
- //SISTEMA DE VOTAÇÃO INICIA AQUI
- 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/comunidade/articles/".$news_id."");
- } else {
- $msg = "<script>alert(\"Obrigado por votar nesta notícia, assim poderemos saber se realmente você gostou :-) \");</script>";
- }
- }
- $images = explode(",",$news['images']);
- 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/comunidade/articles/".$news_id."");
- } else {
- $msg = "<script>alert(\"Você já votou nesta notícia!\");</script>";
- }
- }
- // TERMINA AQUI //
- require_once('./templates/community_subheader.php');
- require_once('./templates/community_header.php');
- ?>
- <div id="container">
- <div id="content">
- <div id="column1" class="column">
- <div class="habblet-container ">
- <div class="cbb clearfix orange">
- <h2 class="title">Noticias</h2>
- <div id="article-archive">
- <?php
- $sql = mysql_query("SELECT * FROM cms_news ORDER BY id DESC");
- if(mysql_num_rows($sql) > 0){
- ?>
- <h2>Últimas Noticias</h2>
- <ul>
- <?php while($row = mysql_fetch_assoc($sql)){ ?>
- <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 } ?>
- </ul>
- <?php } ?>
- <h2>Mais Noticias ?</h2>
- <ul>
- <li>
- <a href="<?php echo $path; ?>/articles" class="article">Mais noticias</a> »
- </li>
- </ul>
- </div>
- </div>
- </div>
- <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
- </div>
- <?php
- $votecheck = mysql_query("SELECT * FROM cms_news_vote WHERE id_news = '".$news_id."'");
- $votecount = mysql_num_rows($votecheck);
- if($votecount < 1){
- $percentlike = "50";
- $percentunlike = "50";
- $like = "0";
- $unlike = "0";
- } else {
- $percentlike = 100 / $votecount * mysql_evaluate("SELECT COUNT(*) FROM cms_news_vote WHERE id_news = '".$news_id."' AND vote_like = '1'");
- $percentunlike = 100 / $votecount * mysql_evaluate("SELECT COUNT(*) FROM cms_news_vote WHERE id_news = '".$news_id."' AND vote_unlike = '1'");
- $like = mysql_evaluate("SELECT COUNT(*) FROM cms_news_vote WHERE id_news = '".$news_id."' AND vote_like = '1'");
- $unlike = mysql_evaluate("SELECT COUNT(*) FROM cms_news_vote WHERE id_news = '".$news_id."' AND vote_unlike = '1'");
- }
- ?>
- <div id="column2" class="column">
- <div class="habblet-container ">
- <div class="cbb clearfix notitle ">
- <div id="article-wrapper"><div style="width:125px; height:55px; float:right; margin-right:-10px; margin-top:2px;">
- </a>
- <img src="http://192.168.1.166/bim0/noticiapostada.gif" width="100" height="16" /></div><h2><?php echo HoloText($news['title']); ?> </h2>
- <div class="article-meta"><a href="articles/category/<?php echo $shortname; ?>"></a> </div>
- <script type="text/javascript" language="Javascript">
- document.observe("dom:loaded", function() {
- $$('.article-images a').each(function(a) {
- Event.observe(a, 'click', function(e) {
- Event.stop(e);
- Overlay.lightbox(a.href, "Carregando imagem...");
- });
- });
- $$('<?php echo $row['id']; ?>').each(function(a) {
- a.replace(a.innerHTML);
- });
- });
- </script>
- <p class="summary"><?php echo $news['longstory']; ?></p>
- <div class="article-body">
- <p><?php echo (HoloText($news['shortstory'], true)); ?></p>
- </div>
- </script>
- <style>
- #infos{background-color:#EEE;border:1px solid #CCC;border-radius:5px;padding:5px;width:530px;}#positivo{width:auto;text-decoration:none;height:15px;padding-top:5px;padding-bottom:4px;padding-left:5px;padding-right:25px;border:1px solid #007900;float:left;color:#FFFFFF;font-weight:bold;font-size:11px;margin:2px;background:url() right no-repeat #00AA00;border-radius:2px;}#negativo{width:auto;height:15px;padding-top:5px;padding-bottom:4px;padding-left:5px;padding-right:25px;border:1px solid #C81E15;float:left;color:#FFFFFF;font-weight:bold;font-size:11px;margin:2px;background:url() right no-repeat #E8372E;border-radius:2px;}</style>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
- <script>
- var $a = jQuery.noConflict()
- function avaliar_noticias(id, avaliar, eleitor, autor){
- $a("#avaliar_noticias").html('<img style="margin-right:30px" src="<?Php echo $path; ?>/seth0r/carregando.gif" />');
- $a("#avaliar_noticias").load("/noticias_avaliacao.php?id="+id+"¬a="+avaliar+"&eleitor="+eleitor+"&autor="+autor);
- }
- </script>
- <div id="infos" style="margin-left:-6px">
- <div style="width:40px; height:60px; background: url(http://i.imgur.com/6eIXCaW.png); margin-top:6px; margin-left:6px; float:left;"><div style="background-image:url('http://avatar-retro.com/habbo-imaging/avatarimage?figure="></div></div>
- <div style="width:205px; height:56px; margin-top:5px; float:left; margin-left:10px; font-size:10px; color:#666666;">
- <div style="margin-top:2px;">Autor: <b><a href="/hall-user.php?user=<?php echo $news['author']; ?>"><?php echo $news['author']; ?></a>
- </body>
- </html> </b><br></div>
- <div style="margin-top:2px;">Vizualizações: <b>1</b><br></div>
- <div style="margin-top:2px;">Link: <b><a href="/articles/<?php echo $news['id']; ?>">Clique aqui</a></b></div>
- <div style="margin-top:2px;">Última vez visto em: <b><?php echo date('d-m-Y H:i:s', $myrow['last_online']); echo""; ?></b></div>
- </div>
- <div style="width:1px; height:45px; background:#CCCCCC; float:left; margin-top:12px;"></div>
- <div style="width:129px; height:10px; margin-top:5px; float:left; margin-left:10px; font-size:10px; color:#666666;">
- <br>
- <div style="width:125px; height:55px; float:right; margin-right:-45px; margin-top:-6px;">
- </a>
- <img src="http://192.168.1.166/web-gallery/v2/images/habbo.png" width="112" height="59" /></div>
- </div>
- <div style="width:530px; height:5px;"></div>
- <div style="width:530px; height:auto; overflow:hidden; padding:5px 0px 5px 7px" id="avaliar_noticias">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="column2" class="column">
- <div class="habblet-container ">
- <div class="cbb clearfix notitle ">
- <div id="article-wrapper">
- <div class="fb-comments" data-href="http://habbluz.biz/comunidade/articles/" data-width="530" data-numposts="5"></div>
- <div id="fb-root"></div>
- <script>Comentário aqui</script>
- </div>
- </div></div></div>
- <?php require_once('./templates/community_footer.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement