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 Releases
CMS Releases
RevCMS Working 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="GarettM" data-source="post: 287707" data-attributes="member: 839"><p>Hey this will <strong>NOT</strong> work for your hotels but look at the code it could help make your comments better. (cherry pick)</p><p>[PHP]<?php</p><p> /**</p><p> * Flabbo.us</p><p> *</p><p> * Powered By RevolutionCMS</p><p> *</p><p> * @author GarettMcCarty</p><p> * @version 1.0.0</p><p> */</p><p> </p><p> namespace Revolution;</p><p> </p><p> $article = (!isset($_GET['id']) || !is_numeric($_GET['id'])) ? 1 : $_GET['id'];</p><p> </p><p> $comments = $revolution->engine->query('SELECT * FROM `cms_news` WHERE id = ' . $article);</p><p> </p><p> $refresh = false;</p><p> </p><p> if(isset($_POST['comment']))</p><p> {</p><p> $date = date("M j, Y g:i");</p><p> $data = (isset($_POST['comment']) && strlen($_POST['comment']) <= 150) ? $_POST['comment'] : '';</p><p> </p><p> if(strlen($data) > 2)</p><p> {</p><p> $revolution->engine->query('INSERT INTO cms_comments (story, comment, date, author) VALUES ('.$article.', \''. $data.'\', \''.$date.'\', '.$_SESSION['user']['id'].');');</p><p> </p><p> }</p><p> }</p><p></p><p> $query = $revolution->engine->query('SELECT * FROM cms_comments WHERE story = ' . $article . ' ORDER BY id DESC');</p><p> $comments = $query->num_rows;</p><p>?></p><p><!DOCTYPE html></p><p><html lang="en"></p><p> <head></p><p> <meta http-equiv="content-type" content="text/html; charset=utf-8"></p><p> <title>{hotelName} - News</title></p><p> </p><p> <link rel="stylesheet" href="{url}/app/template/skins/Habbo/styles/common.css" type="text/css"></p><p> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/libs2.js"></script></p><p> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/visual.js"></script></p><p> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/libs.js"></script></p><p> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/common.js"></script></p><p> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/fullcontent.js"></script></p><p> </p><p> <style></p><p> #logo {</p><p> margin-top: -30px;</p><p> background: url('{url}/app/template/skins/Habbo/images/logo.png') no-repeat;</p><p> background-size: cover;</p><p> width: 220px;</p><p> height: 90px;</p><p> }</p><p> </style></p><p> </p><p> <!--[if IE 8]></p><p> <link rel="stylesheet" href="{url}/app/template/skins/Habbo/styles/ie8.css" type="text/css"></p><p> <![endif]--></p><p> <!--[if lt IE 8]></p><p> <link rel="stylesheet" href="{url}/app/template/skins/Habbo/styles/ie.css" type="text/css" /></p><p> <![endif]--></p><p> <!--[if lt IE 7]></p><p> <link rel="stylesheet" href="{url}/app/template/skins/Habbo/styles/ie6.css" type="text/css" /></p><p> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/pngfix.js"></script></p><p> <script type="text/javascript"></p><p> try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}</p><p> </script></p><p> <style type="text/css"></p><p> body { behavior: url({url}/app/template/skins/Habbo/js/csshover.htc); }</p><p> </style></p><p> <![endif]--></p><p> </head></p><p> </p><p> <body id="news"></p><p> </p><p> <div id="overlay"></div></p><p> <div id="header-container"></p><p> <div id="header" class="clearfix"></p><p> <h1></p><p> <a href="{url}/"></p><p> <div id="logo"></div></p><p> </a></p><p> </h1></p><p> <div id="subnavi"></p><p> <div id="subnavi-search"></p><p> <div id="subnavi-search-upper"></p><p> <ul id="subnavi-search-links"></p><p> <li><a href="{url}/logout" style="color:#000">Sign Out</a></li></p><p> </ul></p><p> </div></p><p> </div></p><p> <div id="to-hotel"></p><p> <a href="{url}/client" class="new-button green-button" target="eac955c8dbc88172421193892a3e98fc7402021a" onclick="HabboClient.openOrFocus(this); return false;"><b>Enter {hotelName} Hotel</b><i></i></a></p><p> </div></p><p> </div></p><p> <ul id="navi"></p><p> <li class="metab"><a href="{url}/me">{username}</a><span></span></li></p><p> <li class="selected"><strong>Community</strong><span></span></li></p><p> {housekeeping}</p><p> </ul></p><p> <div id="habbos-online"><div class="rounded"><span>{online} members online</span></div></div></p><p> </div></p><p> </div></p><p> <div id="content-container"></p><p> <div id="navi2-container" class="pngbg"></p><p> <div id="navi2" class="pngbg clearfix"></p><p> <ul></p><p> <li class=""><a href="{url}/community">Community</a></li></p><p> <li class="selected">News</li></p><p> <li class=" last"><a href="{url}/staff">Staff</a></li></p><p> </ul></p><p> </div></p><p> </div></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 default "></p><p> <h2 class="title">News</h2></p><p> <div id="article-archive"></p><p> <ul></p><p> {newsList}</p><p> </ul></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> <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> <div class="article-meta">Posted {newsDate}</div></p><p> </p><p> <div class="article-body"></p><p> {newsContent}</p><p> <br><br></p><p> <p><font face="Verdana" size="1"><b>- {newsAuthor}</b></p></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-2729').each(function(a) {</p><p> a.replace(a.innerHTML);</p><p> });</p><p> });</p><p> </script></p><p> </div></p><p> </div></p><p> </div></p><p> </div></p><p> <div class="habblet-container "> </p><p> <div class="cbb clearfix notitle"></p><p> <div id="article-wrapper"></p><p> <h2>Comments (<?php echo $comments; ?>)</h2></p><p> <div class="article-meta">Post a new comment</div></p><p> <p class="summary"></p><p> <form method="post" action="{url}/news"></p><p> <textarea name="comment" cols="83" rows="2" placeholder="Share your thoughts..."></textarea></p><p> <input type="submit" value="comment" style="vertical-align: right; text-align: right;" class="commentGo"></p><p> </form></p><p> </p></p><p> </div></p><p> </div></p><p> </div></p><p> <div class="habblet-container orange"></p><p> <div class="cbb clearfix notitle"></p><p> <?php</p><p> if($reload == true) {</p><p> echo '<p> Please Reload </p>';</p><p> }</p><p> if($comments > 0):</p><p> while($comment = $query->fetch_assoc()):</p><p> $info = $revolution->engine->query('SELECT * FROM users WHERE id = ' . $comment['author']);</p><p> $info = $info->fetch_assoc();</p><p> </p><p> if($comment['id'] % 2 == 0):</p><p> ?></p><p> <!-- Begin Comment --></p><p> <div style="width: 600px; display: block;"></p><p> <div style="width: 420px; height: 90px; display: inline-block;vertical-align: top;margin: 0;padding-top: 20px; text-align: right;"></p><p> <b> <?php echo $info['username']; ?> </b></p><p> <br /></p><p> <p><?php echo $comment['comment']; ?> </p></p><p> </div></p><p> <div style="width: 100px; height: 90px; display: inline-block;vertical-align: top;margin: 0"></p><p> <img src="http://avatar-retro.com/habbo-imaging/avatarimage.php?figure=<?php echo $info['look']; ?>&action=std&direction=4&head_direction=4&gesture=std&size=m&img_format=gif" style="margin-top: -20px; margin-left: 10px;" /></p><p> </div></p><p> </div></p><p> <!-- End Comment --></p><p> <?php</p><p> else:</p><p> ?></p><p> <!-- Begin Comment --></p><p> <div style="width: 600px; display: block;"></p><p> <div style="width: 100px; height: 90px; display: inline-block;vertical-align: top;margin: 0"></p><p> <img src="http://avatar-retro.com/habbo-imaging/avatarimage.php?figure=<?php echo $info['look']; ?>" style="margin-top: -20px; margin-left: 10px;" /></p><p> </div></p><p> <div style="width: 420px; height: 90px; display: inline-block;vertical-align: top;margin: 0;padding-top: 20px;"></p><p> <b> <?php echo $info['username']; ?> </b></p><p> <br /></p><p> <p><?php echo $comment['comment']; ?> </p></p><p> </div></p><p> </div></p><p> <!-- End Comment --></p><p> <?php</p><p> endif;</p><p> unset($info);</p><p> </p><p> endwhile;</p><p> endif;</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> </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> <script type="text/javascript"></p><p> HabboView.run();</p><p> </script></p><p></p><p> <!--[if lt IE 7]></p><p> <script type="text/javascript"></p><p> Pngfix.doPngImageFix();</p><p> </script></p><p> <![endif]--></p><p> </p><p> <div id="footer" ></p><p> <p>2014 &copy {hotelName}. {hotelName} is not affiliated with saluke and does not recieve income from this site.</p></p><p> </div></p><p> </p><p> </body></p><p></html>[/PHP]</p><p></p><p>remove this and it could work i guess?</p><p>[CODE]</p><p>revolution-></p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="GarettM, post: 287707, member: 839"] Hey this will [B]NOT[/B] work for your hotels but look at the code it could help make your comments better. (cherry pick) [PHP]<?php /** * Flabbo.us * * Powered By RevolutionCMS * * @author GarettMcCarty * @version 1.0.0 */ namespace Revolution; $article = (!isset($_GET['id']) || !is_numeric($_GET['id'])) ? 1 : $_GET['id']; $comments = $revolution->engine->query('SELECT * FROM `cms_news` WHERE id = ' . $article); $refresh = false; if(isset($_POST['comment'])) { $date = date("M j, Y g:i"); $data = (isset($_POST['comment']) && strlen($_POST['comment']) <= 150) ? $_POST['comment'] : ''; if(strlen($data) > 2) { $revolution->engine->query('INSERT INTO cms_comments (story, comment, date, author) VALUES ('.$article.', \''. $data.'\', \''.$date.'\', '.$_SESSION['user']['id'].');'); } } $query = $revolution->engine->query('SELECT * FROM cms_comments WHERE story = ' . $article . ' ORDER BY id DESC'); $comments = $query->num_rows; ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>{hotelName} - News</title> <link rel="stylesheet" href="{url}/app/template/skins/Habbo/styles/common.css" type="text/css"> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/libs2.js"></script> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/visual.js"></script> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/libs.js"></script> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/common.js"></script> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/fullcontent.js"></script> <style> #logo { margin-top: -30px; background: url('{url}/app/template/skins/Habbo/images/logo.png') no-repeat; background-size: cover; width: 220px; height: 90px; } </style> <!--[if IE 8]> <link rel="stylesheet" href="{url}/app/template/skins/Habbo/styles/ie8.css" type="text/css"> <![endif]--> <!--[if lt IE 8]> <link rel="stylesheet" href="{url}/app/template/skins/Habbo/styles/ie.css" type="text/css" /> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" href="{url}/app/template/skins/Habbo/styles/ie6.css" type="text/css" /> <script type="text/javascript" src="{url}/app/template/skins/Habbo/js/pngfix.js"></script> <script type="text/javascript"> try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {} </script> <style type="text/css"> body { behavior: url({url}/app/template/skins/Habbo/js/csshover.htc); } </style> <![endif]--> </head> <body id="news"> <div id="overlay"></div> <div id="header-container"> <div id="header" class="clearfix"> <h1> <a href="{url}/"> <div id="logo"></div> </a> </h1> <div id="subnavi"> <div id="subnavi-search"> <div id="subnavi-search-upper"> <ul id="subnavi-search-links"> <li><a href="{url}/logout" style="color:#000">Sign Out</a></li> </ul> </div> </div> <div id="to-hotel"> <a href="{url}/client" class="new-button green-button" target="eac955c8dbc88172421193892a3e98fc7402021a" onclick="HabboClient.openOrFocus(this); return false;"><b>Enter {hotelName} Hotel</b><i></i></a> </div> </div> <ul id="navi"> <li class="metab"><a href="{url}/me">{username}</a><span></span></li> <li class="selected"><strong>Community</strong><span></span></li> {housekeeping} </ul> <div id="habbos-online"><div class="rounded"><span>{online} members online</span></div></div> </div> </div> <div id="content-container"> <div id="navi2-container" class="pngbg"> <div id="navi2" class="pngbg clearfix"> <ul> <li class=""><a href="{url}/community">Community</a></li> <li class="selected">News</li> <li class=" last"><a href="{url}/staff">Staff</a></li> </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 default "> <h2 class="title">News</h2> <div id="article-archive"> <ul> {newsList} </ul> </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">Posted {newsDate}</div> <div class="article-body"> {newsContent} <br><br> <p><font face="Verdana" size="1"><b>- {newsAuthor}</b></p> <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-2729').each(function(a) { a.replace(a.innerHTML); }); }); </script> </div> </div> </div> </div> <div class="habblet-container "> <div class="cbb clearfix notitle"> <div id="article-wrapper"> <h2>Comments (<?php echo $comments; ?>)</h2> <div class="article-meta">Post a new comment</div> <p class="summary"> <form method="post" action="{url}/news"> <textarea name="comment" cols="83" rows="2" placeholder="Share your thoughts..."></textarea> <input type="submit" value="comment" style="vertical-align: right; text-align: right;" class="commentGo"> </form> </p> </div> </div> </div> <div class="habblet-container orange"> <div class="cbb clearfix notitle"> <?php if($reload == true) { echo '<p> Please Reload </p>'; } if($comments > 0): while($comment = $query->fetch_assoc()): $info = $revolution->engine->query('SELECT * FROM users WHERE id = ' . $comment['author']); $info = $info->fetch_assoc(); if($comment['id'] % 2 == 0): ?> <!-- Begin Comment --> <div style="width: 600px; display: block;"> <div style="width: 420px; height: 90px; display: inline-block;vertical-align: top;margin: 0;padding-top: 20px; text-align: right;"> <b> <?php echo $info['username']; ?> </b> <br /> <p><?php echo $comment['comment']; ?> </p> </div> <div style="width: 100px; height: 90px; display: inline-block;vertical-align: top;margin: 0"> <img src="http://avatar-retro.com/habbo-imaging/avatarimage.php?figure=<?php echo $info['look']; ?>&action=std&direction=4&head_direction=4&gesture=std&size=m&img_format=gif" style="margin-top: -20px; margin-left: 10px;" /> </div> </div> <!-- End Comment --> <?php else: ?> <!-- Begin Comment --> <div style="width: 600px; display: block;"> <div style="width: 100px; height: 90px; display: inline-block;vertical-align: top;margin: 0"> <img src="http://avatar-retro.com/habbo-imaging/avatarimage.php?figure=<?php echo $info['look']; ?>" style="margin-top: -20px; margin-left: 10px;" /> </div> <div style="width: 420px; height: 90px; display: inline-block;vertical-align: top;margin: 0;padding-top: 20px;"> <b> <?php echo $info['username']; ?> </b> <br /> <p><?php echo $comment['comment']; ?> </p> </div> </div> <!-- End Comment --> <?php endif; unset($info); endwhile; endif; ?> </div> </div> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> </div> </div> </div> </div> <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script> <script type="text/javascript"> HabboView.run(); </script> <!--[if lt IE 7]> <script type="text/javascript"> Pngfix.doPngImageFix(); </script> <![endif]--> <div id="footer" > <p>2014 © {hotelName}. {hotelName} is not affiliated with saluke and does not recieve income from this site.</p> </div> </body> </html>[/PHP] remove this and it could work i guess? [CODE] revolution-> [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
CMS Releases
RevCMS Working News Comments!
Top