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
News comment error.
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="Decellor" data-source="post: 371707" data-attributes="member: 42657"><p>So when i try and post a comment i get the error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES ('13', '245', 'whats the error', 'Apr 7, 2016 6:35 PM')' at line 1"</p><p>My code for news.php:</p><p>[SPOILER="News.php"]</p><p>[PHP]<?php</p><p>if(isset($_GET['id']))</p><p>{</p><p>$id = mysql_real_escape_string($_GET['id']);</p><p>$query = mysql_query( "SELECT * FROM `cms_news` WHERE id = '{$id}'" );</p><p>$array = mysql_fetch_array($query);</p><p></p><p>if ($array == null)</p><p>{</p><p>$getMax = mysql_fetch_array(mysql_query("SELECT MAX(id) FROM cms_news LIMIT 1"));</p><p>header("Location: ".$_CONFIG['hotel']['url']."/index.php?url=news&id=". $getMax['MAX(id)'] ."");</p><p>exit();</p><p>}</p><p>}</p><p>?></p><p><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"</p><p>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></p><p><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"></p><p><head></p><p><meta http-equiv="content-type" content="text/html; charset=utf-8" /></p><p><title>{hotelName}: News Articles</title></p><p></p><p><script type="text/javascript"></p><p>var andSoItBegins = (new Date()).getTime();</p><p></script></p><p><link rel="shortcut icon" href="{url}/app/tpl/skins/Habbo/web-gallery/v2/favicon.ico" type="image/vnd.microsoft.icon" /></p><p><link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/web-gallery/static/styles/common.css" type="text/css" /></p><p><script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/libs2.js" type="text/javascript"></script></p><p><script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/visual.js" type="text/javascript"></script></p><p><script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/libs.js" type="text/javascript"></script></p><p><script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/common.js" type="text/javascript"></script></p><p><script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/fullcontent.js" type="text/javascript"></script></p><p></p><p><script type="text/javascript"></p><p>document.habboLoggedIn = true;</p><p>var habboName = "{username}";</p><p>var habboId = {userid};</p><p>var facebookUser = false;</p><p>var habboReqPath = "";</p><p>var habboStaticFilePath = "{url}/app/tpl/skins/Habbo/web-gallery";</p><p>var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";</p><p>var habboPartner = "";</p><p>var habboDefaultClientPopupUrl = "{url}/client";</p><p>window.name = "habboMain";</p><p>if (typeof HabboClient != "undefined") {</p><p>HabboClient.windowName = "ac96433fa782a85a4d9d1724e256d10df092be19";</p><p>HabboClient.maximizeWindow = true;</p><p>}</p><p></p><p></p><p></script></p><p></p><p><meta name="description" content="{meta_description}" /></p><p><meta name="keywords" content="{meta_keywords}" /></p><p></p><p><!--[if IE 8]></p><p><link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/web-gallery/static/styles/ie8.css" type="text/css" /></p><p><![endif]--></p><p><!--[if lt IE 8]></p><p><link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/web-gallery/static/styles/ie.css" type="text/css" /></p><p><![endif]--></p><p><!--[if lt IE 7]></p><p><link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/web-gallery/static/styles/ie6.css" type="text/css" /></p><p><script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/pngfix.js" type="text/javascript"></script></p><p><script type="text/javascript"></p><p>try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}</p><p></script></p><p></p><p><style type="text/css"></p><p>body { behavior: url(/js/csshover.htc); }</p><p></style></p><p><![endif]--></p><p><meta name="build" content="63-BUILD2470 - 30.09.2013 11:10 - com" /></p><p></p><p><style type="text/css"></p><p>input[type="text"], input[type="password"] {</p><p>background-color: #F1F1F1;</p><p>border: 1px solid #999999;</p><p>width: 175px;</p><p>padding: 5px;</p><p>font-family: verdana;</p><p>font-size: 10px;</p><p>color: #666666;</p><p>}</p><p></p><p>input[type="submit"] {</p><p>background-color: #F1F1F1;</p><p>border: 1px solid #999999;</p><p>padding: 5px;</p><p>font-family: verdana;</p><p>font-size: 10px;</p><p>color: #666666;</p><p>}</p><p></p><p>textarea {</p><p>background-color: #F1F1F1;</p><p>border: 1px solid #999999;</p><p>padding: 5px;</p><p>width: 528px;</p><p>max-width: 528px;</p><p>height: 70px;</p><p>font-family: verdana;</p><p>font-size: 10px;</p><p>color: #666666;</p><p>}</p><p></p><p>select {</p><p>background-color: #F1F1F1;</p><p>border: 1px solid #999999;</p><p>padding: 5px;</p><p>font-family: verdana;</p><p>font-size: 10px;</p><p>color: #666666;</p><p>}</p><p></style></p><p></head></p><p><?php</p><p>if (isset($_GET['deleteID']) && $_GET['deleteID'] != null && is_numeric($_GET['deleteID']))</p><p>{</p><p>$deleteID = filter($_GET['deleteID']);</p><p>if ($_SESSION['user']['rank'] >= 5)</p><p>{</p><p>$getRank = mysql_fetch_array(mysql_query("SELECT `rank` FROM `users` WHERE `id` = '".$_SESSION['user']['id']."'"));</p><p>if ($getRank >= 5)</p><p>{</p><p>mysql_query("DELETE FROM `site_news_comments` WHERE `id` = '".$deleteID."'");</p><p>mysql_query("INSERT INTO `stafflogs` (`type`,`userid`,`action`,`timestamp`) VALUES ('CMS','".$_SESSION['user']['id']."','Deleted a news comment','".time()."')");</p><p>}</p><p>}</p><p>}else if (isset($_GET['banID']) && $_GET['banID'] != null && is_numeric($_GET['banID']))</p><p>{</p><p>$banID = filter($_GET['banID']);</p><p>if ($_SESSION['user']['rank'] >= 5)</p><p>{</p><p>$getRank = mysql_fetch_array(mysql_query("SELECT `rank` FROM `users` WHERE `id` = '".$_SESSION['user']['id']."'"));</p><p>if ($getRank >= 5)</p><p>{</p><p>$getComments = mysql_query("SELECT * FROM `site_news_comments` WHERE `id` = '".$banID."'") or die(mysql_error());</p><p>if (mysql_num_rows($getComments) > 0)</p><p>{</p><p>$commentData = mysql_fetch_array($getComments);</p><p>mysql_query("DELETE FROM `site_news_comments` WHERE `userid` = '".$commentData['userid']."'") or die(mysql_error());</p><p>mysql_query("UPDATE `users` SET `cms_comment_banned` = '1' WHERE `id` = '".$commentData['userid']."' LIMIT 1");</p><p>mysql_query("INSERT INTO `stafflogs` (`type`,`userid`,`action`,`timestamp`) VALUES ('CMS','".$_SESSION['user']['id']."','Banned a user from posting news comments.','Banned user ID: ('".filter($_GET['ban'])."')','".time()."')");</p><p>}</p><p>}</p><p>}</p><p>}</p><p>?></p><p><body id="news" class=" "></p><p><div id="overlay"></div></p><p></p><p><?php</p><p></p><p>$navigatorID = 2;</p><p>require_once ('app/tpl/skins/Habbo/template/header.php');</p><p></p><p>?></p><p></p><p></p><p><div id="content-container"></p><p></p><p><div id="navi2-container" class="pngbg"></p><p><div id="navi2" class="pngbg clearfix"></p><p><ul></p><p><?php</p><p></p><p>$subNavigatorID = 2;</p><p>require_once ('app/tpl/skins/Habbo/template/sub_header.php');</p><p></p><p>?></p><p></ul></p><p></div></p><p></div></p><p></p><p><div id="container"></p><p><div id="content" style="position: relative" class="clearfix"></p><p><div id="column1" class="column"></p><p><div class="habblet-container "> </p><p><div class="cbb clearfix orange "></p><p><h2 class="title"><span style="float: center;">News</span></h2> </p><p></p><p><div id="article-archive"></p><p><?php</p><p>{</p><p>for ($i = 0; $i < 6; $i++)</p><p>{</p><p>$sectionName = "";</p><p>$sectionCutoffMax = 0;</p><p>$sectionCutoffMin = 0;</p><p></p><p>switch ($i)</p><p>{</p><p>case 0:</p><p>$sectionName = 'Today';</p><p>$sectionCutoffMax = time();</p><p>$sectionCutoffMin = time() - 86400;</p><p>break;</p><p></p><p>case 1:</p><p>$sectionName = 'Yesterday';</p><p>$sectionCutoffMax = time() - 86400;</p><p>$sectionCutoffMin = time() - 172800;</p><p>break;</p><p></p><p>case 2:</p><p>$sectionName = 'This week';</p><p>$sectionCutoffMax = time() - 172800;</p><p>$sectionCutoffMin = time() - 604800;</p><p>break;</p><p></p><p>case 3:</p><p>$sectionName = 'Last week';</p><p>$sectionCutoffMax = time() - 604800;</p><p>$sectionCutoffMin = time() - 1209600;</p><p>break;</p><p></p><p>case 4:</p><p>$sectionName = 'This month';</p><p>$sectionCutoffMax = time() - 1209600;</p><p>$sectionCutoffMin = time() - 2592000;</p><p>break;</p><p></p><p>case 5:</p><p>$sectionName = 'Last month';</p><p>$sectionCutoffMax = time() - 2592000;</p><p>$sectionCutoffMin = time() - 5184000;</p><p>break;</p><p>}</p><p></p><p>$q = "SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax . " ORDER BY published DESC";</p><p>$getArticles = mysql_query($q);</p><p>if (mysql_num_rows($getArticles) > 0)</p><p>{</p><p>echo '<h2>' . $sectionName . '</h2>';</p><p></p><p>while ($a = mysql_fetch_assoc($getArticles))</p><p>{</p><p>if($a['id'] == $_GET['id'])</p><p>{</p><p>echo '' . $a['title'] . '&nbsp;&raquo;';</p><p>}else</p><p>{</p><p>echo '<li><a href="/index.php?url=news&id=' . $a['id'] . '">' . $a['title'] . '&nbsp;&raquo;</a></li>';</p><p>}</p><p>}</p><p>}</p><p>}</p><p>}</p><p>?></p><p></div></p><p></div></p><p></div></p><p><script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script></p><p></div></p><p></p><p><div id="column2" class="column"></p><p><div class="habblet-container "></p><p><div class="cbb clearfix notitle "></p><p><div id="article-wrapper"></p><p><h2>{newsTitle}</h2></p><p></p><p><div class="article-meta">{newsDate}</div></p><p></p><p><div class="article-body"></p><p><br></p><p>{newsContent}</p><p><style type="text/css"> .style5 {</p><p>font-weight: bold;</p><p>color: #F66200;</p><p>background: url() no-repeat;</p><p>background: url()no-repeat,url(http://www.boonforums.com/styles/sub_bgs/bg6.gif);</p><p>padding-left: 1px;</p><p>}</style></p><p><span class="style5">Posted by: {newsAuthor}</span></p><p></div></p><p></div></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><?php</p><p>$checkBan = mysql_query("SELECT `cms_comment_banned` FROM `users` WHERE `cms_comment_banned` = '1' AND `id` = '".$_SESSION['user']['id']."' LIMIT 1");</p><p>if(mysql_num_rows($checkBan) > 0)</p><p>{</p><p>echo '</p><p><div class="habblet-container "></p><p><div class="cbb clearfix default "></p><p><h2 class="title">Banned from posting news comments!</h2></p><p><div style="padding: 5px;"></p><p><p align="center">You\'re banned from posting news comments, due to this you cannot post comments.</p></p><p></div></p><p></div></p><p></div>';</p><p>}else</p><p>{</p><p>if(isset($_POST['post_comment']) && $_SESSION['user']['id'] != null)</p><p>{</p><p>$getArticle = mysql_query("SELECT * FROM `cms_news` WHERE `id` = '".filter($_GET['id'])."'") or die(mysql_error());</p><p>if (mysql_num_rows($getArticle) > 0)</p><p>{</p><p>$articleInfo = mysql_fetch_array($getArticle) or die(mysql_error());</p><p></p><p>if (mysql_num_rows($checkBan) > 0)</p><p>{</p><p>$errorMessage = 'You\'re banned from leaving a comment.';</p><p>}else</p><p>{</p><p>if($_POST['comment'] == NULL)</p><p>{</p><p>$errorMessage = 'You have left a field empty.';</p><p>}else</p><p>{</p><p>$checkInfo = mysql_query("SELECT * FROM `site_news_comments` WHERE `article` = '".filter($_GET['id'])."' ORDER BY `id` DESC LIMIT 1") or die(mysql_error());</p><p>$newsInfo = mysql_fetch_array($checkInfo);</p><p>if($newsInfo['userid'] == $_SESSION['user']['id'])</p><p>{</p><p>$errorMessage = 'Hey! The last comment was from you, let somebody else comment first!';</p><p>}else</p><p>{</p><p>mysql_query("INSERT INTO `site_news_comments` (`id`, `article`, `userid`, `comment`, `posted_on`,) VALUES ('".filter($_GET['id'])."', '".$_SESSION['user']['id']."', '".filter($_POST['comment'])."', '".date("M j, Y g:i A")."')") or die(mysql_error());</p><p>$successMessage = 'You have successfully left a comment.';</p><p>}</p><p>}</p><p>}</p><p>}</p><p>}</p><p></p><p>echo'</p><p><div class="habblet-container "></p><p><div class="cbb clearfix default "></p><p><h2 class="title">Post Comment</h2></p><p><div style="padding: 5px;">';</p><p></p><p>if (isset($errorMessage))</p><p>{</p><p>echo '</p><p><div class="action-error flash-message"></p><p><div class="rounded"></p><p><div class="rounded-done">'.$errorMessage.'</div></p><p></div></p><p></div>';</p><p>}elseif (isset($successMessage))</p><p>{</p><p>echo '</p><p><div class="action-confirmation flash-message"></p><p><div class="rounded"></p><p><div class="rounded-done">'.$successMessage.'</div></p><p></div></p><p></div>';</p><p>}</p><p></p><p>echo '</p><p><form action="" method="post"></p><p><textarea name="comment" maxlength="500"></textarea><br /><br /></p><p><center><input type="submit" name="post_comment" value="Post Comment" /></center></p><p></form></p><p><script type="text/javascript">if (!$(document.body).hasClassName(\'process-template\')) { Rounder.init(); }</script></p><p></div></p><p></div></p><p></div>';</p><p>} </p><p>?></p><p><div class="habblet-container "></p><p><div class="cbb clearfix notitle "></p><p><div id="article-wrapper"></p><p><?php</p><p>$getComments = mysql_query("SELECT * FROM `site_news_comments` WHERE `article` = '".filter($_GET['id'])."' ORDER BY `id` DESC");</p><p>?></p><p></p><p><h2>Comments (<?php echo mysql_num_rows($getComments); ?>)</h2></p><p><div class="article-meta"></div></p><p><div style="padding:5px"></p><p><?php</p><p>if(mysql_num_rows($getComments) == 0)</p><p>{</p><p>echo 'Sorry, but no one has posted a comment yet.';</p><p>}else</p><p>{</p><p>echo '</p><p><table style="word-break: break-all; width="528px">';</p><p>while($commentInfo = mysql_fetch_array($getComments))</p><p>{</p><p>$userInfo = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".$commentInfo['userid']."'"));</p><p>echo '</p><p><tr></p><p><td width="90px" valign="top"></p><p><div style="height: 80px; width: 50px; float: left; overflow: hidden;"><img src="http://www.habbo.fr/habbo-imaging/avatarimage?figure='.$userInfo['look'].'"></div>';</p><p>if($userInfo['username'] == 'Kirito' || $userInfo['username'] == 'sketch')</p><p>{</p><p>echo '<div style="position: absolute; z-index:1 alt="Owner""><img src="{url}/c_images/album1584/ADM.gif"></div>';</p><p>}elseif($userInfo['rank'] == 9)</p><p>{</p><p>echo '';</p><p>}elseif($userInfo['rank'] == 8)</p><p>{</p><p>echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/ADM.gif"></div>';</p><p>}elseif($userInfo['rank'] == 7)</p><p>{</p><p>echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/ADM.gif"></div>';</p><p>}elseif($userInfo['rank'] == 6)</p><p>{</p><p>echo '<div style="position: absolute; z-index:1 alt="Moderator""><img src="{url}/c_images/album1584/ADM.gif"></div>';</p><p>}elseif($userInfo['rank'] == 5)</p><p>{</p><p>echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/ADM.gif"></div>';</p><p>}elseif($userInfo['rank'] == 4)</p><p>{</p><p>echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/HBA.gif"></div>';</p><p>}elseif($userInfo['rank'] == 3)</p><p>{</p><p>echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/VIP.gif"></div>';</p><p>}elseif($userInfo['user']['rank'] == 2)</p><p>{</p><p>echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/VIP.gif]"></div>';</p><p>}</p><p></p><p>if ($_SESSION['user']['rank'] >= 5)</p><p>{</p><p>echo '<br/><br/><br/><br/><br/><br/><br/></p><p><a href="{url}/index.php?url=news&id='.$_GET['id'].'&deleteID='.$commentInfo['id'].'">Delete</a> |</p><p><a href="{url}/index.php?url=news&id='.$_GET['id'].'&banID='.$commentInfo['id'].'">Ban</a>';</p><p>}</p><p>echo '</td></p><p><td width="427px" valign="top"></p><p><strong>RE: {newsTitle}</strong><br /><br />'.$commentInfo['comment'].'</p><p></td></p><p></tr></p><p></p><p><tr></p><p><td width="90px" valign="top"></td></p><p><td width="427px" align="right"></p><p><div align="right"><i>Posted by <strong><a href="{url}/home/'.$userInfo['username'].'">'.$userInfo['username'].'</a></strong> on '.$commentInfo['posted_on'].'</i></div><br /><br /></p><p><div style="width:100%; height:1px; background-color:#ccc; margin-top:-17px;"></div></p><p></td></p><p></tr>';</p><p>}</p><p>echo '</table>';</p><p>} ?></p><p></div></p><p></div></p><p></div></p><p></div></p><p><script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script></p><p></div></p><p><?php include('includes/checktheban.php'); ?></p><p><?php require_once ('app/tpl/skins/Habbo/template/footer.php'); ?></p><p><?php include_once ("forcevote.php");</p><p>[/PHP]</p><p>[/SPOILER]</p><p>I have the table i think its something to do with the id of the table idk? some one help please </p><p></p><p>My table look like this : <a href="http://prntscr.com/apdyrw" target="_blank">http://prntscr.com/apdyrw</a></p><p>[doublepost=1460054496,1460054418][/doublepost]Oh i think im also missing the cms_comment)_banned table? idk how i would make it</p></blockquote><p></p>
[QUOTE="Decellor, post: 371707, member: 42657"] So when i try and post a comment i get the error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES ('13', '245', 'whats the error', 'Apr 7, 2016 6:35 PM')' at line 1" My code for news.php: [SPOILER="News.php"] [PHP]<?php if(isset($_GET['id'])) { $id = mysql_real_escape_string($_GET['id']); $query = mysql_query( "SELECT * FROM `cms_news` WHERE id = '{$id}'" ); $array = mysql_fetch_array($query); if ($array == null) { $getMax = mysql_fetch_array(mysql_query("SELECT MAX(id) FROM cms_news LIMIT 1")); header("Location: ".$_CONFIG['hotel']['url']."/index.php?url=news&id=". $getMax['MAX(id)'] .""); exit(); } } ?> <!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" xml:lang="en" lang="en" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>{hotelName}: News Articles</title> <script type="text/javascript"> var andSoItBegins = (new Date()).getTime(); </script> <link rel="shortcut icon" href="{url}/app/tpl/skins/Habbo/web-gallery/v2/favicon.ico" type="image/vnd.microsoft.icon" /> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/web-gallery/static/styles/common.css" type="text/css" /> <script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/libs2.js" type="text/javascript"></script> <script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/visual.js" type="text/javascript"></script> <script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/libs.js" type="text/javascript"></script> <script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/common.js" type="text/javascript"></script> <script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/fullcontent.js" type="text/javascript"></script> <script type="text/javascript"> document.habboLoggedIn = true; var habboName = "{username}"; var habboId = {userid}; var facebookUser = false; var habboReqPath = ""; var habboStaticFilePath = "{url}/app/tpl/skins/Habbo/web-gallery"; var habboImagerUrl = "http://www.habbo.com/habbo-imaging/"; var habboPartner = ""; var habboDefaultClientPopupUrl = "{url}/client"; window.name = "habboMain"; if (typeof HabboClient != "undefined") { HabboClient.windowName = "ac96433fa782a85a4d9d1724e256d10df092be19"; HabboClient.maximizeWindow = true; } </script> <meta name="description" content="{meta_description}" /> <meta name="keywords" content="{meta_keywords}" /> <!--[if IE 8]> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/web-gallery/static/styles/ie8.css" type="text/css" /> <![endif]--> <!--[if lt IE 8]> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/web-gallery/static/styles/ie.css" type="text/css" /> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/web-gallery/static/styles/ie6.css" type="text/css" /> <script src="{url}/app/tpl/skins/Habbo/web-gallery/static/js/pngfix.js" type="text/javascript"></script> <script type="text/javascript"> try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {} </script> <style type="text/css"> body { behavior: url(/js/csshover.htc); } </style> <![endif]--> <meta name="build" content="63-BUILD2470 - 30.09.2013 11:10 - com" /> <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; } 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: 528px; max-width: 528px; 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> </head> <?php if (isset($_GET['deleteID']) && $_GET['deleteID'] != null && is_numeric($_GET['deleteID'])) { $deleteID = filter($_GET['deleteID']); if ($_SESSION['user']['rank'] >= 5) { $getRank = mysql_fetch_array(mysql_query("SELECT `rank` FROM `users` WHERE `id` = '".$_SESSION['user']['id']."'")); if ($getRank >= 5) { mysql_query("DELETE FROM `site_news_comments` WHERE `id` = '".$deleteID."'"); mysql_query("INSERT INTO `stafflogs` (`type`,`userid`,`action`,`timestamp`) VALUES ('CMS','".$_SESSION['user']['id']."','Deleted a news comment','".time()."')"); } } }else if (isset($_GET['banID']) && $_GET['banID'] != null && is_numeric($_GET['banID'])) { $banID = filter($_GET['banID']); if ($_SESSION['user']['rank'] >= 5) { $getRank = mysql_fetch_array(mysql_query("SELECT `rank` FROM `users` WHERE `id` = '".$_SESSION['user']['id']."'")); if ($getRank >= 5) { $getComments = mysql_query("SELECT * FROM `site_news_comments` WHERE `id` = '".$banID."'") or die(mysql_error()); if (mysql_num_rows($getComments) > 0) { $commentData = mysql_fetch_array($getComments); mysql_query("DELETE FROM `site_news_comments` WHERE `userid` = '".$commentData['userid']."'") or die(mysql_error()); mysql_query("UPDATE `users` SET `cms_comment_banned` = '1' WHERE `id` = '".$commentData['userid']."' LIMIT 1"); mysql_query("INSERT INTO `stafflogs` (`type`,`userid`,`action`,`timestamp`) VALUES ('CMS','".$_SESSION['user']['id']."','Banned a user from posting news comments.','Banned user ID: ('".filter($_GET['ban'])."')','".time()."')"); } } } } ?> <body id="news" class=" "> <div id="overlay"></div> <?php $navigatorID = 2; require_once ('app/tpl/skins/Habbo/template/header.php'); ?> <div id="content-container"> <div id="navi2-container" class="pngbg"> <div id="navi2" class="pngbg clearfix"> <ul> <?php $subNavigatorID = 2; require_once ('app/tpl/skins/Habbo/template/sub_header.php'); ?> </ul> </div> </div> <div id="container"> <div id="content" style="position: relative" class="clearfix"> <div id="column1" class="column"> <div class="habblet-container "> <div class="cbb clearfix orange "> <h2 class="title"><span style="float: center;">News</span></h2> <div id="article-archive"> <?php { for ($i = 0; $i < 6; $i++) { $sectionName = ""; $sectionCutoffMax = 0; $sectionCutoffMin = 0; switch ($i) { case 0: $sectionName = 'Today'; $sectionCutoffMax = time(); $sectionCutoffMin = time() - 86400; break; case 1: $sectionName = 'Yesterday'; $sectionCutoffMax = time() - 86400; $sectionCutoffMin = time() - 172800; break; case 2: $sectionName = 'This week'; $sectionCutoffMax = time() - 172800; $sectionCutoffMin = time() - 604800; break; case 3: $sectionName = 'Last week'; $sectionCutoffMax = time() - 604800; $sectionCutoffMin = time() - 1209600; break; case 4: $sectionName = 'This month'; $sectionCutoffMax = time() - 1209600; $sectionCutoffMin = time() - 2592000; break; case 5: $sectionName = 'Last month'; $sectionCutoffMax = time() - 2592000; $sectionCutoffMin = time() - 5184000; break; } $q = "SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax . " ORDER BY published DESC"; $getArticles = mysql_query($q); if (mysql_num_rows($getArticles) > 0) { echo '<h2>' . $sectionName . '</h2>'; while ($a = mysql_fetch_assoc($getArticles)) { if($a['id'] == $_GET['id']) { echo '' . $a['title'] . ' »'; }else { echo '<li><a href="/index.php?url=news&id=' . $a['id'] . '">' . $a['title'] . ' »</a></li>'; } } } } } ?> </div> </div> </div> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> </div> <div id="column2" class="column"> <div class="habblet-container "> <div class="cbb clearfix notitle "> <div id="article-wrapper"> <h2>{newsTitle}</h2> <div class="article-meta">{newsDate}</div> <div class="article-body"> <br> {newsContent} <style type="text/css"> .style5 { font-weight: bold; color: #F66200; background: url() no-repeat; background: url()no-repeat,url(http://www.boonforums.com/styles/sub_bgs/bg6.gif); padding-left: 1px; }</style> <span class="style5">Posted by: {newsAuthor}</span> </div> </div> </div> </div> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> <?php $checkBan = mysql_query("SELECT `cms_comment_banned` FROM `users` WHERE `cms_comment_banned` = '1' AND `id` = '".$_SESSION['user']['id']."' LIMIT 1"); if(mysql_num_rows($checkBan) > 0) { echo ' <div class="habblet-container "> <div class="cbb clearfix default "> <h2 class="title">Banned from posting news comments!</h2> <div style="padding: 5px;"> <p align="center">You\'re banned from posting news comments, due to this you cannot post comments.</p> </div> </div> </div>'; }else { if(isset($_POST['post_comment']) && $_SESSION['user']['id'] != null) { $getArticle = mysql_query("SELECT * FROM `cms_news` WHERE `id` = '".filter($_GET['id'])."'") or die(mysql_error()); if (mysql_num_rows($getArticle) > 0) { $articleInfo = mysql_fetch_array($getArticle) or die(mysql_error()); if (mysql_num_rows($checkBan) > 0) { $errorMessage = 'You\'re banned from leaving a comment.'; }else { if($_POST['comment'] == NULL) { $errorMessage = 'You have left a field empty.'; }else { $checkInfo = mysql_query("SELECT * FROM `site_news_comments` WHERE `article` = '".filter($_GET['id'])."' ORDER BY `id` DESC LIMIT 1") or die(mysql_error()); $newsInfo = mysql_fetch_array($checkInfo); if($newsInfo['userid'] == $_SESSION['user']['id']) { $errorMessage = 'Hey! The last comment was from you, let somebody else comment first!'; }else { mysql_query("INSERT INTO `site_news_comments` (`id`, `article`, `userid`, `comment`, `posted_on`,) VALUES ('".filter($_GET['id'])."', '".$_SESSION['user']['id']."', '".filter($_POST['comment'])."', '".date("M j, Y g:i A")."')") or die(mysql_error()); $successMessage = 'You have successfully left a comment.'; } } } } } echo' <div class="habblet-container "> <div class="cbb clearfix default "> <h2 class="title">Post Comment</h2> <div style="padding: 5px;">'; if (isset($errorMessage)) { echo ' <div class="action-error flash-message"> <div class="rounded"> <div class="rounded-done">'.$errorMessage.'</div> </div> </div>'; }elseif (isset($successMessage)) { echo ' <div class="action-confirmation flash-message"> <div class="rounded"> <div class="rounded-done">'.$successMessage.'</div> </div> </div>'; } echo ' <form action="" method="post"> <textarea name="comment" maxlength="500"></textarea><br /><br /> <center><input type="submit" name="post_comment" value="Post Comment" /></center> </form> <script type="text/javascript">if (!$(document.body).hasClassName(\'process-template\')) { Rounder.init(); }</script> </div> </div> </div>'; } ?> <div class="habblet-container "> <div class="cbb clearfix notitle "> <div id="article-wrapper"> <?php $getComments = mysql_query("SELECT * FROM `site_news_comments` WHERE `article` = '".filter($_GET['id'])."' ORDER BY `id` DESC"); ?> <h2>Comments (<?php echo mysql_num_rows($getComments); ?>)</h2> <div class="article-meta"></div> <div style="padding:5px"> <?php if(mysql_num_rows($getComments) == 0) { echo 'Sorry, but no one has posted a comment yet.'; }else { echo ' <table style="word-break: break-all; width="528px">'; while($commentInfo = mysql_fetch_array($getComments)) { $userInfo = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".$commentInfo['userid']."'")); echo ' <tr> <td width="90px" valign="top"> <div style="height: 80px; width: 50px; float: left; overflow: hidden;"><img src="http://www.habbo.fr/habbo-imaging/avatarimage?figure='.$userInfo['look'].'"></div>'; if($userInfo['username'] == 'Kirito' || $userInfo['username'] == 'sketch') { echo '<div style="position: absolute; z-index:1 alt="Owner""><img src="{url}/c_images/album1584/ADM.gif"></div>'; }elseif($userInfo['rank'] == 9) { echo ''; }elseif($userInfo['rank'] == 8) { echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/ADM.gif"></div>'; }elseif($userInfo['rank'] == 7) { echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/ADM.gif"></div>'; }elseif($userInfo['rank'] == 6) { echo '<div style="position: absolute; z-index:1 alt="Moderator""><img src="{url}/c_images/album1584/ADM.gif"></div>'; }elseif($userInfo['rank'] == 5) { echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/ADM.gif"></div>'; }elseif($userInfo['rank'] == 4) { echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/HBA.gif"></div>'; }elseif($userInfo['rank'] == 3) { echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/VIP.gif"></div>'; }elseif($userInfo['user']['rank'] == 2) { echo '<div style="position: absolute; z-index:1"><img src="{url}/c_images/album1584/VIP.gif]"></div>'; } if ($_SESSION['user']['rank'] >= 5) { echo '<br/><br/><br/><br/><br/><br/><br/> <a href="{url}/index.php?url=news&id='.$_GET['id'].'&deleteID='.$commentInfo['id'].'">Delete</a> | <a href="{url}/index.php?url=news&id='.$_GET['id'].'&banID='.$commentInfo['id'].'">Ban</a>'; } echo '</td> <td width="427px" valign="top"> <strong>RE: {newsTitle}</strong><br /><br />'.$commentInfo['comment'].' </td> </tr> <tr> <td width="90px" valign="top"></td> <td width="427px" align="right"> <div align="right"><i>Posted by <strong><a href="{url}/home/'.$userInfo['username'].'">'.$userInfo['username'].'</a></strong> on '.$commentInfo['posted_on'].'</i></div><br /><br /> <div style="width:100%; height:1px; background-color:#ccc; margin-top:-17px;"></div> </td> </tr>'; } echo '</table>'; } ?> </div> </div> </div> </div> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> </div> <?php include('includes/checktheban.php'); ?> <?php require_once ('app/tpl/skins/Habbo/template/footer.php'); ?> <?php include_once ("forcevote.php"); [/PHP] [/SPOILER] I have the table i think its something to do with the id of the table idk? some one help please My table look like this : [URL]http://prntscr.com/apdyrw[/URL] [doublepost=1460054496,1460054418][/doublepost]Oh i think im also missing the cms_comment)_banned table? idk how i would make it [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
News comment error.
Top