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 Bugged news
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="AlexFallen" data-source="post: 113709" data-attributes="member: 4641"><p><strong>EDIT:</strong></p><p><strong>Replace your class.form.php with this.</strong></p><p>Try and see if this does anything.</p><p> </p><p>[CODE] <?php</p><p> </p><p>namespace Revolution;</p><p>if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }</p><p>class forms implements iForms</p><p>{</p><p> </p><p>public $error;</p><p> </p><p>final public function setData()</p><p>{</p><p>global $engine;</p><p>foreach($_POST as $key => $value)</p><p>{</p><p>if($value != null)</p><p>{</p><p>$this->$key = $engine->secure($value);</p><p>}</p><p>else</p><p>{</p><p>$this->error = 'Please fill in all fields';</p><p>return;</p><p>}</p><p>}</p><p> </p><p>}</p><p> </p><p>final public function unsetData()</p><p>{</p><p>global $template;</p><p>foreach($this as $key => $value)</p><p>{</p><p>unset($this->$key); </p><p>} </p><p>}</p><p> </p><p>final public function writeData($key)</p><p>{</p><p>global $template;</p><p>echo $this->$key;</p><p>}</p><p> </p><p>final public function outputError()</p><p>{</p><p>global $template;</p><p>if(isset($this->error))</p><p>{</p><p>echo "<div id='message'> " . $this->error . " </div>";</p><p>}</p><p>}</p><p> </p><p>/* Manage different pages */</p><p> </p><p>final public function getPageNews()</p><p>{</p><p>global $template, $engine;</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 WHERE id != '" . $engine->secure($_GET['id']) . "' ORDER BY id DESC");</p><p> </p><p>while($news1 = mysql_fetch_array($result))</p><p>{</p><p>$template->setParams('newsList', '&laquo; <a href="index.php?url=news&id='.$news1["id"].'">' . $news1['title'] . '</a><br/>');</p><p>}</p><p> </p><p>$news = $engine->fetch_assoc("SELECT title, shortstory, longstory, 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('newsAuthor', $news['author']);</p><p>$template->setParams('newsDate', date("d-m-y", $news['published']));</p><p>$template->setParams('newsPreview', $news['shortstory']); </p><p> </p><p>unset($result);</p><p>unset($news1);</p><p>unset($news);</p><p>}</p><p> </p><p>final public function getPageHome()</p><p>{</p><p>global $template, $engine;</p><p>$a = 1;</p><p>$data = mysql_query("SELECT title, id, published, shortstory, image FROM cms_news ORDER BY id DESC LIMIT 5");</p><p> </p><p>while($news = mysql_fetch_array($data, MYSQL_ASSOC))</p><p>{</p><p>$template->setParams('newsTitle-' . $a, $news['title']);</p><p>$template->setParams('newsID-' . $a, $news['id']);</p><p>$template->setParams('newsDate-' . $a, date("d-m-y", $news['published']));</p><p>$template->setParams('newsPreview' . $a, $news['shortstory']);</p><p>$template->setParams('newsCaption-' . $a, $news['shortstory']);</p><p>$template->setParams('newsIMG-' . $a, $news['image']);</p><p>$a++;</p><p>}</p><p> </p><p>unset($news);</p><p>unset($data);</p><p>}</p><p> </p><p>}</p><p> </p><p>?> [/CODE]</p></blockquote><p></p>
[QUOTE="AlexFallen, post: 113709, member: 4641"] [B]EDIT:[/B] [B]Replace your class.form.php with this.[/B] Try and see if this does anything.[B][/B] [CODE] <?php namespace Revolution; if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); } class forms implements iForms { public $error; final public function setData() { global $engine; foreach($_POST as $key => $value) { if($value != null) { $this->$key = $engine->secure($value); } else { $this->error = 'Please fill in all fields'; return; } } } final public function unsetData() { global $template; foreach($this as $key => $value) { unset($this->$key); } } final public function writeData($key) { global $template; echo $this->$key; } final public function outputError() { global $template; if(isset($this->error)) { echo "<div id='message'> " . $this->error . " </div>"; } } /* Manage different pages */ final public function getPageNews() { global $template, $engine; if(!isset($_GET['id']) || !is_numeric($_GET['id'])) { $_GET['id'] = 1; } $result = mysql_query("SELECT title, id FROM cms_news WHERE id != '" . $engine->secure($_GET['id']) . "' ORDER BY id DESC"); while($news1 = mysql_fetch_array($result)) { $template->setParams('newsList', '« <a href="index.php?url=news&id='.$news1["id"].'">' . $news1['title'] . '</a><br/>'); } $news = $engine->fetch_assoc("SELECT title, shortstory, longstory, 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('newsAuthor', $news['author']); $template->setParams('newsDate', date("d-m-y", $news['published'])); $template->setParams('newsPreview', $news['shortstory']); unset($result); unset($news1); unset($news); } final public function getPageHome() { global $template, $engine; $a = 1; $data = mysql_query("SELECT title, id, published, shortstory, image FROM cms_news ORDER BY id DESC LIMIT 5"); while($news = mysql_fetch_array($data, MYSQL_ASSOC)) { $template->setParams('newsTitle-' . $a, $news['title']); $template->setParams('newsID-' . $a, $news['id']); $template->setParams('newsDate-' . $a, date("d-m-y", $news['published'])); $template->setParams('newsPreview' . $a, $news['shortstory']); $template->setParams('newsCaption-' . $a, $news['shortstory']); $template->setParams('newsIMG-' . $a, $news['image']); $a++; } unset($news); unset($data); } } ?> [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
RevCMS Bugged news
Top