rCMS ~ (uberCMS) How Do I Get News Comments?

Stranger

Member
Apr 19, 2011
67
0
I'd just like to fix this error, and enable comments.
aaiv4i.png


If you know how to fix it, REPLY NOW! ;D
 

Teh-Epic

New Member
Jul 30, 2010
34
1
<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 ;
 

Users who are viewing this thread

Top