1. Tired of not being able to see links? Want to chat with other members? Need help?

News MySQLi Help

Discussion in 'Habbo Help & Support' started by Blasteh, Oct 1, 2017.

  1. Blasteh

    Blasteh sut min pik

    Hi,
    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:
    upload_2017-10-1_17-27-45.png

    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.
    upload_2017-10-1_17-28-29.png

    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''&laquo; <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($dataMYSQLI_ASSOC))
                {
                    
    $template->setParams('newsTitle-' $a$news['title']);
                    
    $template->setParams('newsID-' $a$news['id']);
                    
    $template->setParams('newsDate-' $adate("d-m-y"$news['published']));
                    
    $template->setParams('newsCaption-' $a$news['shortstory']);
                    
    $template->setParams('newsIMG-' $a$news['image']);
                    
    $a++;
                }
                
                unset(
    $news);
                unset(
    $data);
            }
            
        }
     
    Last edited: Oct 1, 2017
  2. JMG

    JMG wut wut

    Looks like ordinary RevCMS..?

    If not why not just copy code from the original RevCMS release.
     
  3. Blasteh

    Blasteh sut min pik

    The backend has snippets from Rev, it's not RevCMS.

    Even copying it from the original doesn't help the original problem.
     
  4. JMG

    JMG wut wut

    From experience I can’t imagine a lot of help, maybe a few Google seasions? After all it is years old.
     
  5. Antisj

    Antisj Member

    So..
    {newstitle} etc isnt doing it's job?
     
  6. Blasteh

    Blasteh sut min pik

    It’s not RevCMS, as stated. The other classes are recoded, paths are not the same, etc. I can’t google it as the CMS was coded for Hablix. The creator is in University and our time zones are the exact opposite.

    Sadly, no.
     
  7. Detox

    Detox High Roller

    Try doing research on here [ Want to see this link? Register ! ] & [ Want to see this link? Register ! ] Because just by slighting reading the code it's looks like it might have something to do with fetch_array and fetch_assoc but just like looking at your images It able to pull it on news.php
     
  8. Ninja

    Ninja Yes Master Sensei | Black belt

    I think it’s to do with one of the classes. Try class template?
     
    Platinum likes this.
  9. Blasteh

    Blasteh sut min pik

    I took a peak, played with the code a bit - no luck.

    Everything that is supposed to be in it, is in the class.
     
  10. Ninja

    Ninja Yes Master Sensei | Black belt

    Let me hop onto my laptop hold on.
    --- Double Post Merged, Oct 9, 2017, Original Post Date: Oct 9, 2017 ---
    Host a teamviewer (you can pm me of u wish)
     
    Blasteh likes this.
  11. Wickd

    Wickd The first member of the Knights of the Pink Table

    Check the image directory.
     
  12. Ninja

    Ninja Yes Master Sensei | Black belt

    It is not about the image url, its about reading the title if I am correct?
     
    Blasteh likes this.
  13. Blasteh

    Blasteh sut min pik

    That is correct. For some reason, news article do not display.
     

Share This Page

Loading...