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 help
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="shaheemz" data-source="post: 104573" data-attributes="member: 12496"><p><span style="font-family: 'Verdana'"><span style="color: #222222">Hey coders,</span></span></p><p> </p><p><span style="font-family: 'Verdana'"><span style="color: #222222">I need some help with a few things (revcms):</span></span></p><p> </p><p><span style="font-size: 12px"><span style="font-family: 'Verdana'"><span style="color: #222222"><strong>Problem 1:</strong></span></span></span></p><p> </p><p><span style="font-family: 'Verdana'"><span style="color: #222222">- I have a newslist.. my newsarticle opens when i click on the link in the newslist but the link disappears.</span></span></p><p><span style="font-family: 'Verdana'"><span style="color: #222222">Who can help me with this?</span></span></p><p> </p><p><span style="font-family: 'Verdana'"><span style="color: #222222">Image:</span></span></p><p><a href="http://i47.tinypic.com/23vzsq1.png" target="_blank"><span style="font-family: 'Verdana'">http://i47.tinypic.com/23vzsq1.png</span></a></p><p> </p><p> </p><p>===================================</p><p> </p><p><strong><span style="font-family: 'Verdana'"><span style="color: #222222"><span style="font-size: 12px">Problem 2:</span></span></span></strong></p><p> </p><p><span style="font-size: 10px"><span style="font-family: 'Verdana'"><span style="color: #222222"><strong>- </strong>Oke. My me-page is showing news article 1-5 but it looks like this when i only have 2 news articles:</span></span></span></p><p> </p><p> </p><p><span style="color: #222222"><span style="font-size: 10px"><span style="font-family: 'Verdana'"><strong>1. test</strong></span></span></span><span style="font-family: 'Verdana'"><span style="color: #222222">27-05-2012</span></span></p><p><span style="color: #222222"><span style="font-size: 10px"><span style="font-family: 'Verdana'"><strong>2. test</strong></span></span></span><span style="font-family: 'Verdana'"><span style="color: #222222">27-05-2012</span></span></p><p><span style="color: #222222"><span style="font-size: 10px"><span style="font-family: 'Verdana'"><strong>3. newsTitle-3</strong>newsDate-3</span></span></span></p><p><span style="color: #222222"><span style="font-size: 10px"><span style="font-family: 'Verdana'"><strong>4. newsTitle-4</strong>newsDate-4</span></span></span></p><p><span style="color: #222222"><span style="font-size: 10px"><span style="font-family: 'Verdana'"><strong>5. newsTitle-5</strong>newsDate-5</span></span></span></p><p> </p><p><span style="color: #222222"><span style="font-size: 10px"><span style="font-family: 'Verdana'">Can someone fix this for me so it will say "No news" instead of just newsTitle or newsDate?</span></span></span></p><p> </p><p> </p><p>[PHP]<?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, 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> </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('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>?>[/PHP]</p></blockquote><p></p>
[QUOTE="shaheemz, post: 104573, member: 12496"] [FONT=Verdana][COLOR=#222222]Hey coders,[/COLOR][/FONT] [FONT=Verdana][COLOR=#222222]I need some help with a few things (revcms):[/COLOR][/FONT] [SIZE=3][FONT=Verdana][COLOR=#222222][B]Problem 1:[/B][/COLOR][/FONT][/SIZE] [FONT=Verdana][COLOR=#222222]- I have a newslist.. my newsarticle opens when i click on the link in the newslist but the link disappears.[/COLOR][/FONT] [FONT=Verdana][COLOR=#222222]Who can help me with this?[/COLOR][/FONT] [FONT=Verdana][COLOR=#222222]Image:[/COLOR][/FONT] [URL='http://i47.tinypic.com/23vzsq1.png'][FONT=Verdana]http://i47.tinypic.com/23vzsq1.png[/FONT][/URL] =================================== [B][FONT=Verdana][COLOR=#222222][SIZE=3]Problem 2:[/SIZE][/COLOR][/FONT][/B] [SIZE=2][FONT=Verdana][COLOR=#222222][B]- [/B]Oke. My me-page is showing news article 1-5 but it looks like this when i only have 2 news articles:[/COLOR][/FONT][/SIZE] [COLOR=#222222][SIZE=2][FONT=Verdana][B]1. test[/B][/FONT][/SIZE][/COLOR][FONT=Verdana][COLOR=#222222]27-05-2012[/COLOR][/FONT] [COLOR=#222222][SIZE=2][FONT=Verdana][B]2. test[/B][/FONT][/SIZE][/COLOR][FONT=Verdana][COLOR=#222222]27-05-2012[/COLOR][/FONT] [COLOR=#222222][SIZE=2][FONT=Verdana][B]3. newsTitle-3[/B]newsDate-3[/FONT][/SIZE][/COLOR] [COLOR=#222222][SIZE=2][FONT=Verdana][B]4. newsTitle-4[/B]newsDate-4[/FONT][/SIZE][/COLOR] [COLOR=#222222][SIZE=2][FONT=Verdana][B]5. newsTitle-5[/B]newsDate-5[/FONT][/SIZE][/COLOR] [COLOR=#222222][SIZE=2][FONT=Verdana]Can someone fix this for me so it will say "No news" instead of just newsTitle or newsDate?[/FONT][/SIZE][/COLOR] [PHP]<?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, 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'])); 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('newsCaption-' . $a, $news['shortstory']); $template->setParams('newsIMG-' . $a, $news['image']); $a++; } unset($news); unset($data); } } ?>[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
RevCMS help
Top