Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

MySQLi Help

Junior Spellweaver
Joined
Apr 3, 2013
Messages
127
Reaction score
2
Hi,
I posted in the Habbo section, but I feel this is a more appropriate section to go for support in regards to coding. So I'm using a CMS that is coded in MySQLi (knock-off of RevCMS) and I've been having some issues.


The news isn't reading correctly for some reason, as you can see:
Blasteh - MySQLi Help - RaGEZONE Forums



But, it is in the database table (cms_news), and reads right, except for the URL which I'm guessing is due to web.config.
Blasteh - MySQLi Help - RaGEZONE Forums



Fixed the news preview, just need them to show on /me


The class for news/forms:
PHP:
        final public function getPageNews()            {                global $template, $engine;                           if(!isset($_GET['id']) || !is_numeric($_GET['id']))                    {                        $_GET['id'] = 1;                    }                        $result = dbquery("SELECT title, id FROM cms_news WHERE id != '" . $engine->secure($_GET['id']) . "' ORDER BY id DESC");                                       while($news1 = mysqli_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, shortstory, author, published FROM cms_news WHERE id = '" . $engine->secure($_GET['id']) . "' LIMIT 1");                        $author = $engine->fetch_assoc("SELECT look FROM users WHERE username = ".$news['author']." LIMIT 1");                        $template->setParams('newsTitle', $news['title']);                        $template->setParams('newsContent', $news['longstory']);                        $template->setParams('newsAuthor', $news['author']);                        $template->setParams('newsDate', date("M d, Y", $news['published']));                        $template->setParams('newsPreview', $news['shortstory']);                        $template->setParams('authorLook', $author['look']);                                   unset($result);                        unset($news1);                        unset($news);            }          final public function getPageHome()        {            global $template, $engine;            $a = 1;            $data = dbquery("SELECT title, id, published, shortstory, image FROM cms_news ORDER BY id DESC LIMIT 5");                             while($news = mysqli_fetch_array($data, MYSQLI_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);        }         }
 
Back
Top