Whyte
New Member
- Nov 11, 2012
- 16
- 2
Hiya Guys, Can yous help me with this?
The comment goes out of the text. How can I fix this?
Here is my code;
Thanks.
The comment goes out of the text. How can I fix this?
Here is my code;
Code:
<?php
/*================================================================+\
|| # Theme created by Shaheem EDITED By Diaxa
|| # Keep copyrights above for respect
\+================================================================*/
require_once('./app/tpl/skins/Shango/templates/header.php');
?>
<div id="main_left">
<div class="content-box">
<h2 class="title">{newsTitle}</h2>
<div class="content-box-content">
{newsContent}
<br /><br />
<div style="float: right;">- <b>{newsAuthor}</b></div>
<br />
<br />
<div style="float: right;"><i>{newsDate}</i></div>
<br />
</div>
</div>
</div>
<div id="main_right">
<div class="news-articles-box">
<h2 class="title2">More Articles</h2>
<div style="padding:10px;">
{newsList}
</div>
</div><br/><br/>
</div>
<div id="main_left">
<div class="content-box">
<h2 class="title">Comments</h2>
<div class="content-box-content">
<?php
if(isset($_POST['post_comment']))
$posted_on = date("M j, Y g:i A");
if (filter(! isset($_POST['comment']))) {
$_POST['comment'] = '';
}
$comment = strip_tags (filter($_POST['comment']));
if($comment == NULL){
//define("ERROR", "You have to type in a reply!<br /><br />");
//$error_message = 'You have to type in a reply!<br /><br />';
}else{
if (isLogged)
{
mysql_query("INSERT INTO site_news_comments (article, userid, comment, posted_on, author) VALUES ('".htmlentities($_GET['id'])."', '".$_SESSION['userid']."', '".filter($comment)."', '".$posted_on."', '" . $_SESSION['user']['username']. "');");
define('SUCCESS', 'You have successfully posted a comment on this news article!');
define("ERROR", "<br>Thanks for your reply!<br />");
//$error_message = 'Thanks for your reply!<br /><br />';
}
}
?>
<?php
if($userPosts >= 5)
{
echo "<br /><br />You are only allowed to make 5 comments on one article!<br /><br />";
}
if(defined("SUCCESS")){
?>
<?php
}
if(defined("ERROR")) {
echo "You've succesfully posted a comment!<br /><br />";
?>
<?php
}
else
{
?>
<form action="" method="post">
<textarea name="comment" maxlength="500"></textarea><br /><br />
<input type="submit" align="right" name="post_comment" value="Place Comment"/>
</form>
<?php
}
?>
<style type="text/css">
input[type="text"], input[type="password"] {
background-color: #F1F1F1;
border: 1px solid #999999;
width: 175px;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
float:right;
}
input[type="submit"] {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
textarea {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
width: 97%;
height: 70px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
select {
background-color: #F1F1F1;
border: 1px solid #999999;
padding: 5px;
font-family: verdana;
font-size: 10px;
color: #666666;
}
</style>
<?php
$getComments = mysql_query("SELECT * FROM site_news_comments WHERE article = '".htmlentities($_GET['id'])."' ORDER by id DESC");
?>
<?php
if(mysql_num_rows($getComments) == 0) {
echo "'<br><br><br><br>There aren't any comments yet for this article.";
} else {
echo '<table width="528px">';
while($Comments = mysql_fetch_array($getComments)){
$getUserInfo = mysql_query("SELECT * FROM users WHERE username = '".$Comments['author']."'");
$userInfo = mysql_fetch_array($getUserInfo);
echo '
<tr>
<td width="90px" valign="top"></div>
<div style="
height: 65px;
width: 50px;
float: left;
overflow: hidden;
">
<div style="float:left"><img position:absolute; src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$userInfo['look'].'&size=b&direction=2&head_direction=3&gesture=sml&size=2"></div>
';
if($userInfo['rank'] >= 5) {
echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/ADM.gif"></div>';
}
if($userInfo['rank'] == 3) {
echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/XXX.gif"></div>';
}
if($userInfo['rank'] == 4) {
echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/XXX.gif"></div>';
}
if($userInfo['rank'] == 2) {
echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/VIP.gif"></div>';
}
echo '
</td>
<td width="427px" valign="top">
<i>'.$userInfo['username'].'</i>
<br /><br /><FONT face="Verdana" size="1px"> '.$Comments['comment'].'</font>
</td>
</tr>
<tr>
<td width="100px" valign="top">
</td>
<td width="100%" align="right">
</div>
<br>
<div style="width:88%; height:1px; background-color:#ccc; margin-top:-17px;float:left;"></div>
</td>
</tr>';
}
echo '</table>';
}
?>
</div>
</div><br/>
</div>
<?php
require_once('./app/tpl/skins/Shango/templates/footer.php');
?>
Thanks.