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
[RevCMS] News.php
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="Zymf" data-source="post: 278510" data-attributes="member: 20865"><p>@j4ck believes it's possibly something to do with my class_forms... I can't see anything but hopefully someone else might?</p><p>[PHP]final public function getPageNews()</p><p> {</p><p> global $template, $engine, $_CONFIG;</p><p> </p><p> if(!isset($_GET['id']) || !is_numeric($_GET['id']))</p><p> {</p><p> $_GET['id'] = 1;</p><p> }</p><p> $result = mysql_query("SELECT title, id FROM cms_news ORDER BY id DESC");</p><p> </p><p> while($news1 = mysql_fetch_array($result))</p><p> {</p><p> if($news1['id'] == $_GET['id'])</p><p> {</p><p> $template->setParams('newsList', '<li class="newslist">'.$news1['title'].'&raquo</li>');</p><p> }</p><p> else</p><p> {</p><p> $template->setParams('newsList', '<li class="newslist"><a href="'.$_CONFIG['hotel']['url'].'/index.php?url=news&id='.$news1['id'].'">'.$news1['title'].'&raquo</a></li>');</p><p> }</p><p> }</p><p> </p><p> $news = $engine->fetch_assoc("SELECT title, longstory, shortstory, author, published FROM cms_news WHERE id = '" . $engine->secure($_GET['id']) . "' LIMIT 1");</p><p> $template->setParams('newsTitle', $news['title']);</p><p> $template->setParams('newsContent', $news['longstory']);</p><p> $template->setParams('newsPreview', $news['shortstory']);</p><p> $template->setParams('newsAuthor', $news['author']);</p><p> $template->setParams('newsDate', date("d-m-y H:h", $news['published']));</p><p> </p><p> unset($result);</p><p> unset($news1);</p><p> unset($news);</p><p> }[/PHP]</p><p></p><p>News.php</p><p>[PHP]</p><p><?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></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> <link rel="shortcut icon" href="{url}/favicon.ico?<?php echo time() ?>" type="image/x-icon"/></p><p> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/common.css?<?php echo time() ?>" type="text/css"></p><p> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs2.js?<?php echo time() ?>"></script></p><p> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/visual.js?<?php echo time() ?>"></script></p><p> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs.js?<?php echo time() ?>"></script></p><p> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/common.js?<?php echo time() ?>"></script></p><p> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/fullcontent.js?<?php echo time() ?>"></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 habboReqPath = "";</p><p> var habboStaticFilePath = "{url}/app/tpl/skins/Habbo";</p><p> var habboImagerUrl = "http://www.habbo.com.tr/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 = "eac955c8dbc88172421193892a3e98fc7402021a";</p><p> HabboClient.maximizeWindow = true;</p><p> }</p><p> </script></p><p> </p><p> <!--[if IE 8]></p><p> <link rel="stylesheet" href="{url}/app/tpl/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/tpl/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/tpl/skins/Habbo/styles/ie6.css" type="text/css" /></p><p> <script type="text/javascript" src="{url}/app/tpl/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/tpl/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><a href="{url}/"></a></h1></p><p> <div id="subnavi"></p><p> <div id="subnavi-user"></p><p> <div style="margin-top:7px;font-size:10px"></p><p> <?php include"randomFacts.php" ?></p><p> </div></p><p> </div></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;font-size:10px;">Sign Out</a></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="05efbade773135677a28f2b338c5bdf93774237c" onclick="HabboClient.openOrFocus(this); return false;"><b>Enter {hotelName}</b><i></i></a></p><p> <?php if($_SESSION['user']['rank'] >= 1) { echo '<a href="{url}/shop" class="new-button red-button" action="_new" style="left: -5px;"><b>Store</b><i></i></a>'; } ?></p><p> </div></p><p> </div></p><p> <ul id="navi"></p><p> <li class="metab"><a href="{url}/me"><?php echo ($_SESSION['user']['username']); ?></a><span></span></li></p><p> <li class="selected"><strong>Community</strong><span></span></li></p><p> <li class="viptab"><a href="{url}/shop">Shop</a><span></span></li></p><p> <li class="viptab5"><a href="http://facebook.com/basehabbo" target="_blank">Facebook</a><span></span></li></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}/community/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 class="summary">{newsPreview}</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> <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> </div></p><p> </p><p> </body></p><p></html>[/PHP]</p><p></p><p>cms_news table structure:</p><p><img src="http://gyazo.com/a06197c5246255863f08730b06177a7b.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </p><p></p><p></p><p>Hopefully that's enough info for anyone who's willing to help.</p></blockquote><p></p>
[QUOTE="Zymf, post: 278510, member: 20865"] @j4ck believes it's possibly something to do with my class_forms... I can't see anything but hopefully someone else might? [PHP]final public function getPageNews() { global $template, $engine, $_CONFIG; if(!isset($_GET['id']) || !is_numeric($_GET['id'])) { $_GET['id'] = 1; } $result = mysql_query("SELECT title, id FROM cms_news ORDER BY id DESC"); while($news1 = mysql_fetch_array($result)) { if($news1['id'] == $_GET['id']) { $template->setParams('newsList', '<li class="newslist">'.$news1['title'].'»</li>'); } else { $template->setParams('newsList', '<li class="newslist"><a href="'.$_CONFIG['hotel']['url'].'/index.php?url=news&id='.$news1['id'].'">'.$news1['title'].'»</a></li>'); } } $news = $engine->fetch_assoc("SELECT title, longstory, shortstory, author, published FROM cms_news WHERE id = '" . $engine->secure($_GET['id']) . "' LIMIT 1"); $template->setParams('newsTitle', $news['title']); $template->setParams('newsContent', $news['longstory']); $template->setParams('newsPreview', $news['shortstory']); $template->setParams('newsAuthor', $news['author']); $template->setParams('newsDate', date("d-m-y H:h", $news['published'])); unset($result); unset($news1); unset($news); }[/PHP] 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> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>{hotelName} - News</title> <link rel="shortcut icon" href="{url}/favicon.ico?<?php echo time() ?>" type="image/x-icon"/> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/common.css?<?php echo time() ?>" type="text/css"> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs2.js?<?php echo time() ?>"></script> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/visual.js?<?php echo time() ?>"></script> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs.js?<?php echo time() ?>"></script> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/common.js?<?php echo time() ?>"></script> <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/fullcontent.js?<?php echo time() ?>"></script> <script type="text/javascript"> document.habboLoggedIn = true; var habboName = "{username}"; var habboId = {userid}; var habboReqPath = ""; var habboStaticFilePath = "{url}/app/tpl/skins/Habbo"; var habboImagerUrl = "http://www.habbo.com.tr/habbo-imaging/"; var habboPartner = ""; var habboDefaultClientPopupUrl = "{url}/client"; window.name = "habboMain"; if (typeof HabboClient != "undefined") { HabboClient.windowName = "eac955c8dbc88172421193892a3e98fc7402021a"; HabboClient.maximizeWindow = true; } </script> <!--[if IE 8]> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie8.css" type="text/css"> <![endif]--> <!--[if lt IE 8]> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie.css" type="text/css" /> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie6.css" type="text/css" /> <script type="text/javascript" src="{url}/app/tpl/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/tpl/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}/"></a></h1> <div id="subnavi"> <div id="subnavi-user"> <div style="margin-top:7px;font-size:10px"> <?php include"randomFacts.php" ?> </div> </div> <div id="subnavi-search"> <div id="subnavi-search-upper"> <ul id="subnavi-search-links"> <li><a href="{url}/logout" style="color:#000;font-size:10px;">Sign Out</a> </ul> </div> </div> <div id="to-hotel"> <a href="{url}/client" class="new-button green-button" target="05efbade773135677a28f2b338c5bdf93774237c" onclick="HabboClient.openOrFocus(this); return false;"><b>Enter {hotelName}</b><i></i></a> <?php if($_SESSION['user']['rank'] >= 1) { echo '<a href="{url}/shop" class="new-button red-button" action="_new" style="left: -5px;"><b>Store</b><i></i></a>'; } ?> </div> </div> <ul id="navi"> <li class="metab"><a href="{url}/me"><?php echo ($_SESSION['user']['username']); ?></a><span></span></li> <li class="selected"><strong>Community</strong><span></span></li> <li class="viptab"><a href="{url}/shop">Shop</a><span></span></li> <li class="viptab5"><a href="http://facebook.com/basehabbo" target="_blank">Facebook</a><span></span></li> </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}/community/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> <p class="summary">{newsPreview}</p> <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> <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" > </div> </body> </html>[/PHP] cms_news table structure: [IMG]http://gyazo.com/a06197c5246255863f08730b06177a7b.png[/IMG] Hopefully that's enough info for anyone who's willing to help. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
[RevCMS] News.php
Top