Kewp³+¹ Kewp³+¹  • 15.06.12 13:37

Alguém tira os comentários por favor?  Empty Alguém tira os comentários por favor? 15.06.12 13:37

Olá vim aqui pedir para vocês retirarem a parte dos comentários da notícia.

Aqui está minha página Articles!

Código:
<?php
define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('global.php');
define("THIS_SCRIPT", 'articles');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><?php echo $sitename." - ".$lang['articles'];; ?></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script type="text/javascript" src="Public/JS/jquery.history.js"></script>
   <script type="text/javascript">
      function doPostComment() {
         comment = $("#our_comment").val();
         story = $("#storyid").val();
         uid = $("#uid").val();
         
         if( comment.length < 1 && comment == "Enter your comment here...") {
            return false;
         }
         
         $("#OurNewComment > #Comment").html("<strong><?php echo $_SESSION['username']; ?></strong> <?php echo $lang['time_now']; ?><br />" + comment);
         $("#OurNewComment").show("slow");
         $(".CommentInput").hide("slow");
         $.post("./functions/postcomment.php", { comment: comment, story: story, uid: uid });
      
      }
   </script>
    <link type="text/css" rel="stylesheet" href="Public/Styles/<?php echo $currentstyle ?>/CSS/main.css" />
</head>

<body id="news_body">
 
<div class="mainBox">
   <?php include("header.php"); ?>
   <?php include("system/communitynav.php"); ?>

   <div class="mid" id="midcontent">

<?php
if(!isset($_GET['story']) || !is_numeric($_GET['story']))
{
$articleq = mysql_query("SELECT * FROM cms_news ORDER BY id DESC LIMIT 1");
}
else
{
$articleq = mysql_query("SELECT * FROM cms_news WHERE id = '".addslashes($_GET['story'])."' LIMIT 1");
}
$article = mysql_fetch_array($articleq);
$authorq = mysql_query("SELECT * FROM users WHERE id = '".$article['author']."' LIMIT 1");
$author = mysql_fetch_array($authorq);
$recentstoriesq = mysql_query("SELECT * FROM cms_news ORDER BY id DESC LIMIT 25");
?>



   <input type="hidden" value="<?php echo $article['id']; ?>" name="storyid" id="storyid" />
   <input type="hidden" value="<?php echo $users->UserID($core->EscapeString($_SESSION['username'])); ?>" name="uid" id="uid" />

<div class="column" id="column1">
   <div class="contentBox">
      <div class="boxHeader verde"><?php echo $lang['recent_news']; ?></div>
      <div class="boxContent">
         <?php
            while($recentstories = mysql_fetch_array($recentstoriesq))
         {
            echo '<a href="?story='.$recentstories['id'].'">'.$recentstories['title'].' »</a><br />';
         }
         ?>
      </div>
   </div>
</div>
      
<div class="column" id="column2">

   <div class="contentBox">
      <div class="boxHeader"><?php echo stripslashes($article['title']); ?></div>
      <div class="boxContent">
         <div class="story"><?php echo stripslashes($article['longstory']); ?></div>
         <div class="extrainfo">
            <div class="poster"><?php echo $lang['author']; ?>: <a href="home.php?u=<?php echo $author['username']; ?>"><?php echo $author['username']; ?></a></div>
            <div class="date"><?php echo $lang['published']; ?>: <?php echo @date("d-m-Y",$article['published']); ?></div>
         </div>
      </div>
   </div>


<?php
$commentsq = mysql_query("SELECT * FROM cms_comments WHERE story = '".addslashes($article['id'])."' ORDER BY id ASC");
?>

   <div class="boxContent">
    <?php
   $style = 'left';
   while($comments = mysql_fetch_array($commentsq))
   {
      $authorq = mysql_query("SELECT * FROM users WHERE id = '".$comments['author']."' LIMIT 1");
      $author = mysql_fetch_array($authorq);
   ?>
         <div class="UserComment <?php echo $style; ?>">
            <div class="Avatar"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=<?php echo $author['look']; if($style == 'right') echo '&direction=4'; ?>" alt="<?php echo $author['username']; ?>" /></div>
            <p class="triangle-border <?php echo $style; ?> <?php if($author['rank'] == 7) echo 'staff'; ?>" id="Comment">
               <strong><a href="home.php?u=<?php echo $author['username']; ?>"><?php echo $author['username']; ?></a></strong> on <?php echo @date("d-m-Y",$comments['date']); ?><br />
               <?php echo $comments['comment']; ?>
            </p>
         </div>
         <?php
         if($style == 'left')
         $style = 'right';
         else
         $style = 'left';
         }
         ?>
         <div class="UserComment <?php echo $style; ?>" style="display: none" id="OurNewComment">
            <div class="Avatar"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=<?php echo $users->UserInfo($core->EscapeString($_SESSION['username']), 'look'); if($style == 'right') echo '&direction=4'; ?>" alt="<?php echo $users->UserInfo($core->EscapeString($_SESSION['username']), 'look') ?>" /></div>

            <p class="triangle-border <?php echo $style; ?>" id="Comment">
               placeholder
            </p>
         </div>
         <div class="CommentInput">
            <div class="MyAvatar"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=<?php echo $users->UserInfo($core->EscapeString($_SESSION['username']), 'look'); ?>" alt="<?php echo $core->EscapeString($_SESSION['username']); ?>" /></div>
            <div class="Comment"><textarea class="triangle-border left" onfocus="this.value=''; setbg('##e5fff3');" id="our_comment"><?php echo $lang['enter_comment']; ?></textarea></div>
            <div class="Submitbtn right">
                <button type="submit" class="positive" name="submitcomment" onmousedown="doPostComment();"><?php echo $lang['submit']; ?></button>
              </div>
         </div>
   </div>
</div>
      
<?php include("system/sideads.php"); ?>

   </div>

   <?php include("system/footer.php"); ?>
</div>

</body>
</html>


Obrigadoo :D

Gabrieldlm Gabrieldlm  • 15.06.12 13:43

Alguém tira os comentários por favor?  Empty Re: Alguém tira os comentários por favor? 15.06.12 13:43

Olá, tente esse:

Código:
<?php
define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('global.php');
define("THIS_SCRIPT", 'articles');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><?php echo $sitename." - ".$lang['articles'];; ?></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script type="text/javascript" src="Public/JS/jquery.history.js"></script>
  <script type="text/javascript">
      function doPostComment() {
        comment = $("#our_comment").val();
        story = $("#storyid").val();
        uid = $("#uid").val();
       
        if( comment.length < 1 && comment == "Enter your comment here...") {
            return false;
        }
       
        $("#OurNewComment > #Comment").html("<strong><?php echo $_SESSION['username']; ?></strong> <?php echo $lang['time_now']; ?><br />" + comment);
        $("#OurNewComment").show("slow");
        $(".CommentInput").hide("slow");
        $.post("./functions/postcomment.php", { comment: comment, story: story, uid: uid });
     
      }
  </script>
    <link type="text/css" rel="stylesheet" href="Public/Styles/<?php echo $currentstyle ?>/CSS/main.css" />
</head>

<body id="news_body">
 
<div class="mainBox">
  <?php include("header.php"); ?>
  <?php include("system/communitynav.php"); ?>

  <div class="mid" id="midcontent">

<?php
if(!isset($_GET['story']) || !is_numeric($_GET['story']))
{
$articleq = mysql_query("SELECT * FROM cms_news ORDER BY id DESC LIMIT 1");
}
else
{
$articleq = mysql_query("SELECT * FROM cms_news WHERE id = '".addslashes($_GET['story'])."' LIMIT 1");
}
$article = mysql_fetch_array($articleq);
$authorq = mysql_query("SELECT * FROM users WHERE id = '".$article['author']."' LIMIT 1");
$author = mysql_fetch_array($authorq);
$recentstoriesq = mysql_query("SELECT * FROM cms_news ORDER BY id DESC LIMIT 25");
?>



  <input type="hidden" value="<?php echo $article['id']; ?>" name="storyid" id="storyid" />
  <input type="hidden" value="<?php echo $users->UserID($core->EscapeString($_SESSION['username'])); ?>" name="uid" id="uid" />

<div class="column" id="column1">
  <div class="contentBox">
      <div class="boxHeader verde"><?php echo $lang['recent_news']; ?></div>
      <div class="boxContent">
        <?php
            while($recentstories = mysql_fetch_array($recentstoriesq))
        {
            echo '<a href="?story='.$recentstories['id'].'">'.$recentstories['title'].' »</a><br />';
        }
        ?>
      </div>
  </div>
</div>
     
<div class="column" id="column2">

  <div class="contentBox">
      <div class="boxHeader"><?php echo stripslashes($article['title']); ?></div>
      <div class="boxContent">
        <div class="story"><?php echo stripslashes($article['longstory']); ?></div>
        <div class="extrainfo">
            <div class="poster"><?php echo $lang['author']; ?>: <a href="home.php?u=<?php echo $author['username']; ?>"><?php echo $author['username']; ?></a></div>
            <div class="date"><?php echo $lang['published']; ?>: <?php echo @date("d-m-Y",$article['published']); ?></div>
        </div>
      </div>
  </div>


<?php
$commentsq = mysql_query("SELECT * FROM cms_comments WHERE story = '".addslashes($article['id'])."' ORDER BY id ASC");
?>
<?php include("system/sideads.php"); ?>

  </div>

  <?php include("system/footer.php"); ?>
</div>

</body>
</html>

Se tiver algum bug post um print

Até mais!

The Flash The Flash  • 15.06.12 13:45

Alguém tira os comentários por favor?  Empty Re: Alguém tira os comentários por favor? 15.06.12 13:45

Ponha o seguinte código:
Código:

<?php
define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('global.php');
define("THIS_SCRIPT", 'articles');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><?php echo $sitename." - ".$lang['articles'];; ?></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script type="text/javascript" src="Public/JS/jquery.history.js"></script>
   <script type="text/javascript">
      function doPostComment() {
         comment = $("#our_comment").val();
         story = $("#storyid").val();
         uid = $("#uid").val();
         
         if( comment.length < 1 && comment == "Digite seu comentário aqui!") {
            return false;
         }
         
         $("#OurNewComment > #Comment").html("<strong><?php echo $_SESSION['username']; ?></strong> <?php echo $lang['time_now']; ?><br />" + comment);
         $("#OurNewComment").show("slow");
         $(".CommentInput").hide("slow");
         $.post("./functions/postcomment.php", { comment: comment, story: story, uid: uid });
      
      }
   </script>
    <link type="text/css" rel="stylesheet" href="Public/Styles/<?php echo $currentstyle ?>/CSS/main.css" />
</head>

<body id="news_body">
 
<div class="mainBox">
   <?php include("header.php"); ?>
   <?php include("system/communitynav.php"); ?>

   <div class="mid" id="midcontent">

<?php
if(!isset($_GET['story']) || !is_numeric($_GET['story']))
{
$articleq = mysql_query("SELECT * FROM cms_news ORDER BY id DESC LIMIT 1");
}
else
{
$articleq = mysql_query("SELECT * FROM cms_news WHERE id = '".addslashes($_GET['story'])."' LIMIT 1");
}
$article = mysql_fetch_array($articleq);
$authorq = mysql_query("SELECT * FROM users WHERE id = '".$article['author']."' LIMIT 1");
$author = mysql_fetch_array($authorq);
$recentstoriesq = mysql_query("SELECT * FROM cms_news ORDER BY id DESC LIMIT 25");
?>



   <input type="hidden" value="<?php echo $article['id']; ?>" name="storyid" id="storyid" />
   <input type="hidden" value="<?php echo $users->UserID($core->EscapeString($_SESSION['username'])); ?>" name="uid" id="uid" />

<div class="column" id="column1">
   <div class="contentBox">
      <div class="boxHeader verde"><?php echo $lang['recent_news']; ?></div>
      <div class="boxContent">
         <?php
            while($recentstories = mysql_fetch_array($recentstoriesq))
         {
            echo '<a href="?story='.$recentstories['id'].'">'.$recentstories['title'].' »</a><br />';
         }
         ?>
      </div>
   </div>
</div>
      
<div class="column" id="column2">

   <div class="contentBox">
      <div class="boxHeader"><?php echo stripslashes($article['title']); ?></div>
      <div class="boxContent">
         <div class="story"><?php echo stripslashes($article['longstory']); ?></div>
         <div class="extrainfo">
            <div class="poster"><?php echo $lang['author']; ?>: <a href="home.php?u=<?php echo $author['username']; ?>"><?php echo $author['username']; ?></a></div>
            <div class="date"><?php echo $lang['published']; ?>: <?php echo @date("d-m-Y",$article['published']); ?></div>
         </div>
      </div>
   </div>


<?php
$commentsq = mysql_query("SELECT * FROM cms_comments WHERE story = '".addslashes($article['id'])."' ORDER BY id ASC");
?>

   <div class="boxContent">
    <?php
   $style = 'left';
   while($comments = mysql_fetch_array($commentsq))
   {
      $authorq = mysql_query("SELECT * FROM users WHERE id = '".$comments['author']."' LIMIT 1");
      $author = mysql_fetch_array($authorq);
   ?>
         <div class="UserComment <?php echo $style; ?>">
            <div class="Avatar"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=<?php echo $author['look']; if($style == 'right') echo '&direction=4'; ?>" alt="<?php echo $author['username']; ?>" /></div>
            <p class="triangle-border <?php echo $style; ?> <?php if($author['rank'] == 7) echo 'staff'; ?>" id="Comment">
               <strong><a href="home.php?u=<?php echo $author['username']; ?>"><?php echo $author['username']; ?></a></strong> on <?php echo @date("d-m-Y",$comments['date']); ?><br />
               <?php echo $comments['comment']; ?>
            </p>
         </div>
         <?php
         if($style == 'left')
         $style = 'right';
         else
         $style = 'left';
         }
         ?>
         <div class="UserComment <?php echo $style; ?>" style="display: none" id="OurNewComment">
            <div class="Avatar"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=<?php echo $users->UserInfo($core->EscapeString($_SESSION['username']), 'look'); if($style == 'right') echo '&direction=4'; ?>" alt="<?php echo $users->UserInfo($core->EscapeString($_SESSION['username']), 'look') ?>" /></div>

            <p class="triangle-border <?php echo $style; ?>" id="Comment">
               placeholder
            </p>
         </div>
         <div class="CommentInput">
            <div class="MyAvatar"><img src="http://www.habbo.com/habbo-imaging/avatarimage?figure=<?php echo $users->UserInfo($core->EscapeString($_SESSION['username']), 'look'); ?>" alt="<?php echo $core->EscapeString($_SESSION['username']); ?>" /></div>
            <div class="Comment"><textarea class="triangle-border left" onfocus="this.value=''; setbg('##e5fff3');" id="our_comment"><?php echo $lang['enter_comment']; ?></textarea></div>
            <div class="Submitbtn right">
                <button type="submit" class="positive" name="submitcomment" onmousedown="doPostComment();"><?php echo $lang['submit']; ?></button>
              </div>
         </div>
   </div>
</div>
      


   </div>

   <?php include("system/footer.php"); ?>
</div>

</body>
</html>

Código retirado do seguinte tópico: https://www.power-pixel.net/t19974-facilcolocando-comentarios-nas-noticiascomimagens

Conteúdo patrocinado  • 

Alguém tira os comentários por favor?  Empty Re: Alguém tira os comentários por favor?

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.