RevCMS News List

Detox

Member
Jul 24, 2010
365
24
Trying to turn this

28aowad.png


into this:
2epjxgl.png


I think it has to do with this

PHP:
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', '&laquo; <a href="/news/'.$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);
    }
 

Zippy

Member
Aug 5, 2010
92
28
It's part smarty for example {hotelName} <- that is a smarty code.
anything that is in { } <- those brackets only uses smarty.
No lol, you're making yourself look stupid. There is no such thing as "Smarty code". The {hotelName} syntax is used by Smarty, yes, but it isn't "Smarty code".
 

Zippy

Member
Aug 5, 2010
92
28
I never said Smarty Code... It uses part smarty... Syntax yes, but how can I get it to look from what I asked for...?
I took the code from either the original UberCMS or PHPRetro. You can do the same, quite easily.

Not going to spoon feed you. I've told you where you can get the code. It's simply a copy and paste job. Don't be so lazy and do something for yourself for once.
 

Users who are viewing this thread

Top