Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
rCMS ~ (uberCMS) How Do I Get News Comments?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Teh-Epic" data-source="post: 32160" data-attributes="member: 701"><p><div class="habblet-container "> </p><p><div class="cbb clearfix notitle "> </p><p> </p><p> </p><p> <div id="article-wrapper"> </p><p> </p><p> <h2>%news_article_title%</h2> </p><p> </p><p> <div class="article-meta"></p><p> <?php if ($news_article_id > 0) { ?></p><p> %news_article_date%</p><p> %news_category%</p><p> <?php } ?> </p><p> </div> </p><p> </p><p> <?php if (strlen(trim($news_article_summary)) > 0) { ?> </p><p> <p class="summary"></p><p> </p><p> %news_article_summary%</p><p> </p><p> </p> </p><p> <?php } ?></p><p> </p><p> <div class="article-body"> </p><p> </p><p> %news_article_body%</p><p> </p><p> </div></p><p> </p><p> <?php if ($news_article_id > 0) { ?></p><p> <script type="text/javascript" language="Javascript"> </p><p> document.observe("dom:loaded", function() {</p><p> $$('.article-images a').each(function(a) {</p><p> Event.observe(a, 'click', function(e) {</p><p> Event.stop(e);</p><p> Overlay.lightbox(a.href, "Image is loading");</p><p> });</p><p> });</p><p> </p><p> $$('a.article-%news_article_id%').each(function(a) {</p><p> a.replace(a.innerHTML);</p><p> });</p><p> });</p><p> </script> </p><p> <?php } ?></p><p></p><p> </div> </p><p> </p><p></div></p><p></div> </p><p><script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> </p><p></p><p><div class="habblet-container "></p><p> <div class="cbb clearfix notitle "></p><p> <div id="article-wrapper"><h2>Post Comment</h2></p><p> <div class="article-meta"></div></p><p> <div class="article-body"></p><p> <?php</p><p> echo 'You must login to post a comment.';</p><p> ?></p><p> <form action="" method="post"></p><p> <textarea name="comment" maxlength="500"></textarea><br /><br /></p><p> <input type="submit" name="post_comment" value="Post Comment" /></p><p> </form></p><p> <?php</p><p> echo 'You must login to post a comment.';</p><p> </p><p> ?></p><p> </div></p><p> </div></p><p> </div></p><p></div></p><p> </p><p><?php</p><p>$getComments = mysql_query("SELECT * FROM cms_news_comments WHERE article = '".$id['id']."' ORDER by id DESC");</p><p>?></p><p><div class="habblet-container "></p><p> <div class="cbb clearfix notitle "></p><p> <div id="article-wrapper"><h2>Comments (<?php echo mysql_num_rows($getComments); ?>)</h2></p><p> <div class="article-meta"></div></p><p> <div class="article-body"></p><p> <?php</p><p> if(mysql_num_rows($getComments) == 0){</p><p> echo 'Sorry, but no one has posted a comment yet.';</p><p> }else{</p><p> echo '<table width="528px">';</p><p> while($Comments = mysql_fetch_array($getComments)){</p><p> $getUserInfo = mysql_query("SELECT * FROM users WHERE id = '".$Comments['userid']."'");</p><p> $userInfo = mysql_fetch_array($getUserInfo);</p><p> echo '</p><p> <tr></p><p> <td width="90px" valign="top"></p><p> <div style="float:left"><img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='.$userInfo['figure'].'&size=b&direction=2&head_direction=3&gesture=sml&size=m"></div></p><p> ';</p><p> if($userInfo['rank'] > 5){</p><p> echo '<div style="position: absolute; z-index:1"><img src="http://habbocity.ath.cx/26_6d82813456b38f80ad83a827eef0fde3/c_images/ADM.gif"></div>';</p><p> }</p><p> echo '</p><p> </td></p><p> <td width="427px" valign="top"></p><p> <strong>RE: '.$news_row['title'].'</strong><br /><br />'.$Comments['comment'].'</p><p> </td></p><p> </tr></p><p> <tr></p><p> <td width="90px" valign="top"></p><p> </td></p><p> <td width="427px" align="right"></p><p> <i>Posted by <strong><a href="#">'.$userInfo['name'].'</a></strong> on '.$Comments['posted_on'].'</i><br /><br /></p><p> </td></p><p> </tr>';</p><p> }</p><p> echo '</table>';</p><p> }</p><p> ?></p><p> </div></p><p> </div></p><p> </div></p><p></div></p><p> </p><p> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script></p><p></p><p></p><p></p><p></p><p>There u go.</p><p></p><p></p><p>Edit:</p><p></p><p>Heres SQL code.</p><p>CREATE TABLE IF NOT EXISTS `cms_news_comments` (</p><p> `id` int(11) NOT NULL AUTO_INCREMENT,</p><p> `article` int(11) NOT NULL,</p><p> `userid` int(11) NOT NULL,</p><p> `comment` varchar(500) NOT NULL,</p><p> `posted_on` varchar(150) NOT NULL DEFAULT '',</p><p> PRIMARY KEY (`id`)</p><p>) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=254 ;</p></blockquote><p></p>
[QUOTE="Teh-Epic, post: 32160, member: 701"] <div class="habblet-container "> <div class="cbb clearfix notitle "> <div id="article-wrapper"> <h2>%news_article_title%</h2> <div class="article-meta"> <?php if ($news_article_id > 0) { ?> %news_article_date% %news_category% <?php } ?> </div> <?php if (strlen(trim($news_article_summary)) > 0) { ?> <p class="summary"> %news_article_summary% </p> <?php } ?> <div class="article-body"> %news_article_body% </div> <?php if ($news_article_id > 0) { ?> <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, "Image is loading"); }); }); $$('a.article-%news_article_id%').each(function(a) { a.replace(a.innerHTML); }); }); </script> <?php } ?> </div> </div> </div> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> <div class="habblet-container "> <div class="cbb clearfix notitle "> <div id="article-wrapper"><h2>Post Comment</h2> <div class="article-meta"></div> <div class="article-body"> <?php echo 'You must login to post a comment.'; ?> <form action="" method="post"> <textarea name="comment" maxlength="500"></textarea><br /><br /> <input type="submit" name="post_comment" value="Post Comment" /> </form> <?php echo 'You must login to post a comment.'; ?> </div> </div> </div> </div> <?php $getComments = mysql_query("SELECT * FROM cms_news_comments WHERE article = '".$id['id']."' ORDER by id DESC"); ?> <div class="habblet-container "> <div class="cbb clearfix notitle "> <div id="article-wrapper"><h2>Comments (<?php echo mysql_num_rows($getComments); ?>)</h2> <div class="article-meta"></div> <div class="article-body"> <?php if(mysql_num_rows($getComments) == 0){ echo 'Sorry, but no one has posted a comment yet.'; }else{ echo '<table width="528px">'; while($Comments = mysql_fetch_array($getComments)){ $getUserInfo = mysql_query("SELECT * FROM users WHERE id = '".$Comments['userid']."'"); $userInfo = mysql_fetch_array($getUserInfo); echo ' <tr> <td width="90px" valign="top"> <div style="float:left"><img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?figure='.$userInfo['figure'].'&size=b&direction=2&head_direction=3&gesture=sml&size=m"></div> '; if($userInfo['rank'] > 5){ echo '<div style="position: absolute; z-index:1"><img src="http://habbocity.ath.cx/26_6d82813456b38f80ad83a827eef0fde3/c_images/ADM.gif"></div>'; } echo ' </td> <td width="427px" valign="top"> <strong>RE: '.$news_row['title'].'</strong><br /><br />'.$Comments['comment'].' </td> </tr> <tr> <td width="90px" valign="top"> </td> <td width="427px" align="right"> <i>Posted by <strong><a href="#">'.$userInfo['name'].'</a></strong> on '.$Comments['posted_on'].'</i><br /><br /> </td> </tr>'; } echo '</table>'; } ?> </div> </div> </div> </div> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> There u go. Edit: Heres SQL code. CREATE TABLE IF NOT EXISTS `cms_news_comments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `article` int(11) NOT NULL, `userid` int(11) NOT NULL, `comment` varchar(500) NOT NULL, `posted_on` varchar(150) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=254 ; [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
rCMS ~ (uberCMS) How Do I Get News Comments?
Top