articles.php

+4
Rayant
Gomez
Saigon
Ceos
8 participantes

Ceos Ceos  • 22.01.14 13:10

articles.php Empty articles.php 22.01.14 13:10

O que deseja: Uma página da noticia

Nome do que deseja: articles.php

Print do que deseja (Se possível): http://prntscr.com/2lk5o4 e http://prntscr.com/2lk5qm

Onde viu O que deseja: http://habbonhotel.com.br

Deve ser compativel com: NewCrypto

Se escolheu outros, especifique:

Comentários adicionais: Olá, encontrei essa página no habbon/hapix e gostei muito delas, vocês poderiam me dizer onde posso achá-la? caso tenham o link para download, passe-me estaria ajudando muito.

Saigon Saigon  • 22.01.14 13:15

articles.php Empty Re: articles.php 22.01.14 13:15

Olá, 
Ela é a HobbeCMS editada você pode encontrar aqui no fórum.

Ceos Ceos  • 22.01.14 13:26

articles.php Empty Re: articles.php 22.01.14 13:26

Olá amigo!
A página articles dessa CMS, é igual a todas.
Como citei a cima eu quero uma igual do habbon
não precisa ser igual, mas que apenas tenha a opção de votar

avatar Gomez  • 22.01.14 13:54

articles.php Empty Re: articles.php 22.01.14 13:54

Reputação da mensagem: 100% (1 votos)
Procura por MaisCMS ela tem.

Rayant Rayant  • 26.01.14 1:03

articles.php Empty Re: articles.php 26.01.14 1:03

Olá, esta cms aqui tem, como dita pelo usuário acima: Clique aqui

Bet4 Bet4  • 26.01.14 1:25

articles.php Empty Re: articles.php 26.01.14 1:25

Espero que sirva!

Restore Restore  • 30.01.14 11:17

articles.php Empty Re: articles.php 30.01.14 11:17

O Autor possui 24 horas para informar se a questão foi resolvida

lai0n lai0n  • 30.01.14 12:03

Restore Restore  • 04.02.14 0:44

articles.php Empty Re: articles.php 04.02.14 0:44

ALERTA DA MODERAÇÃO
Tópico Fechado
O Autor não apresentou resposta
Movido á Habbo Hotel >> Pedidos >> Pedidos Finalizados

Bet4 Bet4  • 04.02.14 2:24

articles.php Empty Re: articles.php 04.02.14 2:24

Essa articles, possui nessa cms: Clique Aqui

Je4n Je4n  • 04.02.14 2:45

articles.php Empty Re: articles.php 04.02.14 2:45

Reputação da mensagem: 100% (1 votos)
Bem, vamos lá. Arquivo articles.php
Código:

<?php
#####################################################################
#||||| Project MyHobba desenvolvido por @rtiag0   |||||#
#||||| Criado por @rtiag0 - HTML, PHP, CSS & Data_classes      |||||#
# ----------------------------------------------------------------- #
#||||| © Copyright 2012. Hobba 2011 - Open Source Software     |||||#
#||||| © Copyright 2012. LavvosCMS - DATA_CLASSES Estrutura   |||||#
#||||| © Copyright 2012. Sulake Corporation - Habbo Arquivos   |||||#
#####################################################################

require_once('./inc/hotel_core.php');
require_once('./inc/hotel_session.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);
 $pagename = "Noticias - ".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 = "Notícias - ".HoloText($news['title'])."";
}

 //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/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/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 blue">
 <h2 class="title">Notícias</h2>
<div id="article-archive">
<?php

if ($news_id > 0)
{
 for ($i = 0; $i < 7; $i++)
 {
 $sectionName = "";
 $sectionCutoffMax = 0;
 $sectionCutoffMin = 0;
 
switch ($i)
 {
 case 0:
 
$sectionName = "Hoje";
 $sectionCutoffMax = time();
 $sectionCutoffMin = time() - 86400;
 break;
 
case 1:
 
$sectionName = "Ontem";
 $sectionCutoffMax = time() - 86400;
 $sectionCutoffMin = time() - 172800;
 break;
 
case 2: 
 
$sectionName = "Essa Semana";
 $sectionCutoffMax = time() - 172800;
 $sectionCutoffMin = time() - 604800;
 break;
 
case 3:
 
$sectionName = "Semana Passada";
 $sectionCutoffMax = time() - 604800;
 $sectionCutoffMin = time() - 1209600;
 break;
 
case 4:
 
$sectionName = "Esse Mês";
 $sectionCutoffMax = time() - 1209600;
 $sectionCutoffMin = time() - 2592000;
 break;
 
case 5:
 
$sectionName = "Mês Passado";
 $sectionCutoffMax = time() - 2592000;
 $sectionCutoffMin = time() - 5184000;
 break;
               

            case 6:
 
$sectionName = "Outros Meses";
 $sectionCutoffMax = time() - 3592000;
 $sectionCutoffMin = time() - 5684000;
 break;

 }

 $sql = mysql_query("SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax .  " ORDER BY published DESC"); 
 if(mysql_num_rows($sql) > 0){
?>

 <?php echo "<h2>"; echo $sectionName; echo "</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 } } } ?>

<ul>
 <li>
 <a href="<?php echo $path; ?>/articles/" class="article">Mais Notícias »</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">
 <h2><?php echo HoloText($news['title']); ?><img src="http://habbonhotel.com.br/web-gallery/v2/images/promo_neuter.gif" sttyle="float: right;"></h2>
 <div class="article-meta">Publicado em <?php echo date('d/m/Y', $news['published']); ?> <a href="articles/category/<?php echo $shortname; ?>"><?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 (HoloText($news['longstory'])); ?></p>
 <div class="article-body">
 <p><?php echo (HoloText($news['shortstory'], true)); ?></p>
 <div class="article-body"><b><?php echo $news['author']; ?></b><br>
 
</div>
 <!-- SISTEMA DE CURTIDAS -->

<hr sttyle="border:#ccc 1px dotted;" />
<div sttyle="background-color:#F5F5F5; border:1px solid #E9E9E9; padding:5px; border-radius:5px;">

<?php if(mysql_num_rows($usercheck = mysql_query("SELECT id_user FROM cms_news_vote WHERE id_user = '".$my_id."' AND id_news = '".$news_id."'")) < 1){ ?>
<?php } ?>
<?php if(mysql_num_rows($usercheck = mysql_query("SELECT id_user FROM cms_news_vote WHERE id_user = '".$my_id."' AND id_news = '".$news_id."'")) < 1){ ?>
 
<a href="<?php echo $path; ?>/articles/<?php echo $news_id; ?>&vote=like"><img src="http://habbonhotel.com.br/web-gallery/v2/images/like.png"></a>
 <a href="<?php echo $path; ?>/articles/<?php echo $news_id; ?>&vote=unlike"><img src="http://habbonhotel.com.br/web-gallery/v2/images/unlike.png"></a><?php } ?>
 
<!-- RESULTADOS -->
 <p><span sttyle="color: #008000; font-size: small;"><?php echo $like; ?> <span sttyle="color: #000000;">Pessoas gostaram da notícia.<br /></span></span><span sttyle="color: #ff0000; font-size: small;"><?php echo $unlike; ?> </span><span sttyle="font-size: small;">Pessoas não gostaram da notícia.
</span></p>
<script>alert(\"Obrigado por votar nesta notícia, assim poderemos saber se realmente você gostou :-)\");</script>
 
<!-- FIM SISTEMA DE CURTIDAS -->
</div>
 
    <hr sttyle="border:#ccc 1px dotted;" />
 
</div>

</div></div>
 

</div>
</div>


<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>


</div>

<div id="column3" class="column">
<?php require_once('./templates/community_ads.php'); ?>
</div>

<?php require_once('./templates/community_footer.php'); ?>

Agora execute em sua database:
Código:

-- phpMyAdmin SQL Dump
-- version 3.4.9
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tempo de Geração: 01/02/2014 às 22h06min
-- Versão do Servidor: 5.5.20
-- Versão do PHP: 5.3.10

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Banco de Dados: `baaaaaaaca`
--

-- --------------------------------------------------------

--
-- Estrutura da tabela `cms_news_vote`
--

CREATE TABLE IF NOT EXISTS `cms_news_vote` (
  `id_user` int(11) NOT NULL,
  `id_news` int(11) NOT NULL,
  `vote_like` enum('0','1') NOT NULL DEFAULT '0',
  `vote_unlike` enum('0','1') NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Obs: Lembre-se que se sua configuração não estiver nos diretórios como essa, troque.

De
require_once('./inc/hotel_core.php');
require_once('./inc/hotel_session.php');


Para
require_once('./data_classes/server-data.php_data_classes-core.php.php');
require_once('./data_classes/server-data.php_data_classes-session.php.php');


Pronto, só isso.

Restore Restore  • 06.02.14 22:28

articles.php Empty Re: articles.php 06.02.14 22:28

ALERTA DA MODERAÇÃO
Tópico Fechado
O Autor não apresentou resposta
Movido á Habbo Hotel >> Pedidos >> Pedidos Finalizados


Permissões neste sub-fórum
Não podes responder a tópicos

BH Servers

Recomendamos a BH Servers com proteção DDOS gratuita em Cloud Server de alta performance. Entrega imediata.