Blank News Page

Detox

Member
Jul 24, 2010
365
24
Every Time I go to my news page I get blank.

2sa0azd.png


news.php file

PHP:
<!DOCTYPE html>
<?php include('includes/checktheban.php'); ?>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>{hotelName} - News Articles</title>
       
        <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/common.css" type="text/css">
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs2.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/visual.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/common.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/fullcontent.js"></script>

        <style type="text/css">input[type="text"],input[type="password"]{background-color:#F1F1F1;border:1px solid #999999;width:175px;padding:5px;font-family:verdana;font-size:10px;color:#666666;}input[type="submit"]{background-color:#F1F1F1;border:1px solid #999999;padding:5px;font-family:verdana;font-size:10px;color:#666666;}textarea{background-color:#F1F1F1;border:1px solid #999999;padding:5px;width:517px;height:70px;font-family:verdana;font-size:10px;color:#666666;}select{background-color:#F1F1F1;border:1px solid #999999;padding:5px;font-family:verdana;font-size:10px;color:#666666;}</style>
       
        <script type="text/javascript">
            document.habboLoggedIn = true;
            var habboName = "{username}";
            var habboId = {userid};
            var habboReqPath = "";
            var habboStaticFilePath = "{url}/app/tpl/skins/Habbo";
            var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";
            var habboPartner = "";
            var habboDefaultClientPopupUrl = "{url}/client";
            window.name = "habboMain";
            if (typeof HabboClient != "undefined") {
                HabboClient.windowName = "eac955c8dbc88172421193892a3e98fc7402021a";
                HabboClient.maximizeWindow = true;
            }
        </script>
       
        <!--[if IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie8.css" type="text/css">
        <![endif]-->
        <!--[if lt IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie.css" type="text/css" />
        <![endif]-->
        <!--[if lt IE 7]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie6.css" type="text/css" />
            <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/pngfix.js"></script>
            <script type="text/javascript">
                try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
            </script>
            <style type="text/css">
                body { behavior: url({url}/app/tpl/skins/Habbo/js/csshover.htc); }
            </style>
        <![endif]-->
    </head>
   
    <body id="news">
   
        <div id="overlay"></div>
             <?php 

$navigatorID = 2;
require_once ('includes/header.php'); 

?>
            </div>
            </div>
        </div>
        <div id="content-container">
            <div id="navi2-container" class="pngbg">
                <div id="navi2" class="pngbg clearfix">
                    <ul>
                        <?php 

$subNavigatorID = 2;
require_once ('includes/subnavi.php'); 

?>
                    </ul>
                </div>
            </div>
            <div id="container">
            <div id="content" style="position: relative" class="clearfix">
            <div id="column1" class="column">
            <div class="habblet-container ">
            <div class="cbb clearfix default ">
            <h2 class="title">News</h2>
            <div id="article-archive">
                                       
 <?php
    for ($i = 0; $i < 7; $i++)
    {
        $sectionName = '';
        $sectionCutoffMax = 0;
        $sectionCutoffMin = 0;
       
        switch ($i)
        {
            case 0:
           
                $sectionName = 'Today';
                $sectionCutoffMax = time();
                $sectionCutoffMin = time() - 86400;
                break;
               
            case 1:
           
                $sectionName = 'Yesterday';
                $sectionCutoffMax = time() - 86400;
                $sectionCutoffMin = time() - 172800;
                break;
               
            case 2: 
           
                $sectionName = 'This week';
                $sectionCutoffMax = time() - 172800;
                $sectionCutoffMin = time() - 604800;
                break;
               
            case 3:
           
                $sectionName = 'Last week';
                $sectionCutoffMax = time() - 604800;
                $sectionCutoffMin = time() - 1209600;
                break;
               
            case 4:
           
                $sectionName = 'This month';
                $sectionCutoffMax = time() - 1209600;
                $sectionCutoffMin = time() - 2592000;
                break;
               
            case 5:
           
                $sectionName = 'Last month';
                $sectionCutoffMax = time() - 2592000;
                $sectionCutoffMin = time() - (60 * 60 * 24 * 365);
                break;
        }
       
        $q = "SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax .  " ORDER BY published DESC LIMIT 50";
        $getArticles = mysql_query($q);

        if (mysql_num_rows($getArticles) > 0)
        {
                echo '<h2>' . $sectionName . '</h2> 
                <ul>';

            while ($a = mysql_fetch_assoc($getArticles))
            {
?>
    <li>
    <?php if($news_id !== $a['id']){ echo"<a href=\"".$path."/news/".$a['id']."\" class=\"article-".$a['id']."\">"; } ?>
    <?php echo $a['title']; ?>&raquo;</a>
    <?php if($news_id !== $a['id']){ echo"</a>"; } ?></li>
    <?php }
echo '
</ul>
';
        }
    }

?>
                                </div>
                            </div>
                        </div>
                        <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                </div>
<div id="column2" class="column">
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper">
                                    <h2>{newsTitle}</h2>
                                    <div class="article-meta">Posted {newsDate}</div>
                                    <p class="summary">{newsTitle}</p>
                                    <div class="article-body">
                                        {newsContent}
                                        <br><br>
                                        <p><font face="Verdana" size="1"><b>- {newsAuthor}</b></p>
                                        <script type="text/javascript" language="Javascript">
                                            document.observe("dom:loaded", function() {
                                                $$('.article-images a').each(function(a) {
                                                    Event.observe(a, 'click', function(e) {
                                                        Event.stop(e);
                                                        Overlay.lightbox(a.href, "Image is loading");
                                                    });
                                                });
                                               
                                                $$('a.article-2729').each(function(a) {
                                                    a.replace(a.innerHTML);
                                                });
                                            });
                                        </script>
                                    </div>
                                </div>
                            </div>
                    <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                   
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            HabboView.run();
        </script>

        <!--[if lt IE 7]>
            <script type="text/javascript">
                Pngfix.doPngImageFix();
            </script>
        <![endif]-->
       
        <div id="footer" >
            <?php include('includes/footer.php'); ?>
            <?php include('includes/checktheban.php'); ?>
        </div>
   
    </body>
</html>
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
This doesn't solve your issue, but you're including 'checktheban.php' you only need to include it once.

You have it once at the top and the bottom.
 

Detox

Member
Jul 24, 2010
365
24
This doesn't solve your issue, but you're including 'checktheban.php' you only need to include it once.

You have it once at the top and the bottom.

Thanks I never even notice that.

On the side note. I've resolved the issue temporarily. Now Its not showing the side
dh48at.png
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Do you know what you changed? Was it table name or column names?

Try and run this query:

'SELECT * FROM cms_news WHERE published >= '1474295670' AND published <= '1475678070' ORDER BY published DESC LIMIT 50;'

Does it error? (However it could also not be showing as there is no other articles?)
 
May 1, 2015
470
154
Hi,
I believe that code there is slightly wrong.
Try this
Code:
<?php
    {
    for ($i = 0; $i < 6; $i++)
        {
            $sectionName = "";
            $sectionCutoffMax = 0;
            $sectionCutoffMin = 0;
       
            switch ($i)
            {
                    case 0:
               
                            $sectionName = 'Today';
                            $sectionCutoffMax = time();
                            $sectionCutoffMin = time() - 86400;
                            break;
                       
                    case 1:
               
                            $sectionName = 'Yesterday';
                            $sectionCutoffMax = time() - 86400;
                            $sectionCutoffMin = time() - 172800;
                            break;
                       
                    case 2:
               
                            $sectionName = 'This week';
                            $sectionCutoffMax = time() - 172800;
                            $sectionCutoffMin = time() - 604800;
                            break;
                       
                    case 3:
               
                            $sectionName = 'Last week';
                            $sectionCutoffMax = time() - 604800;
                            $sectionCutoffMin = time() - 1209600;
                            break;
                       
                    case 4:
               
                            $sectionName = 'This month';
                            $sectionCutoffMax = time() - 1209600;
                            $sectionCutoffMin = time() - 2592000;
                            break;
                       
                    case 5:
               
                            $sectionName = 'Last month';
                            $sectionCutoffMax = time() - 2592000;
                            $sectionCutoffMin = time() - 5184000;
                            break;
            }
       
            $q = "SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax .  " ORDER BY published DESC";
            $getArticles = mysql_query($q);
            if (mysql_num_rows($getArticles) > 0)
            {
                    echo '<h2>' . $sectionName . '</h2>';
               
                    while ($a = mysql_fetch_assoc($getArticles))
                    {
                        if($a['id'] == $_GET['id'])
                        {
                        echo '' . $a['title'] . '&nbsp;&raquo;';
                        }
                        else
                        {
                        echo '<li><a href="/index.php?url=news&id=' . $a['id'] . '">' . $a['title'] . '&nbsp;&raquo;</a></li>';
                        }
                    }
            }
        }
    }
?>
 

iGlenn

:)
Jul 21, 2015
618
92
Thanks I never even notice that.

On the side note. I've resolved the issue temporarily. Now Its not showing the side
dh48at.png
after examining the code you're missing {newsList} under <div id="article-archive"> i fixed it for you, just replace your news code with this and it should work :p
HTML:
<!DOCTYPE html>
<?php include('includes/checktheban.php'); ?>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>{hotelName} - News Articles</title>
      
        <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/common.css" type="text/css">
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs2.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/visual.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/common.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/fullcontent.js"></script>

        <style type="text/css">input[type="text"],input[type="password"]{background-color:#F1F1F1;border:1px solid #999999;width:175px;padding:5px;font-family:verdana;font-size:10px;color:#666666;}input[type="submit"]{background-color:#F1F1F1;border:1px solid #999999;padding:5px;font-family:verdana;font-size:10px;color:#666666;}textarea{background-color:#F1F1F1;border:1px solid #999999;padding:5px;width:517px;height:70px;font-family:verdana;font-size:10px;color:#666666;}select{background-color:#F1F1F1;border:1px solid #999999;padding:5px;font-family:verdana;font-size:10px;color:#666666;}</style>
      
        <script type="text/javascript">
            document.habboLoggedIn = true;
            var habboName = "{username}";
            var habboId = {userid};
            var habboReqPath = "";
            var habboStaticFilePath = "{url}/app/tpl/skins/Habbo";
            var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";
            var habboPartner = "";
            var habboDefaultClientPopupUrl = "{url}/client";
            window.name = "habboMain";
            if (typeof HabboClient != "undefined") {
                HabboClient.windowName = "eac955c8dbc88172421193892a3e98fc7402021a";
                HabboClient.maximizeWindow = true;
            }
        </script>
      
        <!--[if IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie8.css" type="text/css">
        <![endif]-->
        <!--[if lt IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie.css" type="text/css" />
        <![endif]-->
        <!--[if lt IE 7]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie6.css" type="text/css" />
            <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/pngfix.js"></script>
            <script type="text/javascript">
                try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
            </script>
            <style type="text/css">
                body { behavior: url({url}/app/tpl/skins/Habbo/js/csshover.htc); }
            </style>
        <![endif]-->
    </head>
  
    <body id="news">
  
        <div id="overlay"></div>
             <?php

$navigatorID = 2;
require_once ('includes/header.php');

?>
            </div>
            </div>
        </div>
        <div id="content-container">
            <div id="navi2-container" class="pngbg">
                <div id="navi2" class="pngbg clearfix">
                    <ul>
                        <?php

$subNavigatorID = 2;
require_once ('includes/subnavi.php');

?>
                    </ul>
                </div>
            </div>
            <div id="container">
            <div id="content" style="position: relative" class="clearfix">
            <div id="column1" class="column">
            <div class="habblet-container ">
            <div class="cbb clearfix default ">
            <h2 class="title">News</h2>
            <div id="article-archive">
                <ul>
                  {newsList}
                           </ul>           
 </div>
 <?php
    for ($i = 0; $i < 7; $i++)
    {
        $sectionName = '';
        $sectionCutoffMax = 0;
        $sectionCutoffMin = 0;
      
        switch ($i)
        {
            case 0:
          
                $sectionName = 'Today';
                $sectionCutoffMax = time();
                $sectionCutoffMin = time() - 86400;
                break;
              
            case 1:
          
                $sectionName = 'Yesterday';
                $sectionCutoffMax = time() - 86400;
                $sectionCutoffMin = time() - 172800;
                break;
              
            case 2:
          
                $sectionName = 'This week';
                $sectionCutoffMax = time() - 172800;
                $sectionCutoffMin = time() - 604800;
                break;
              
            case 3:
          
                $sectionName = 'Last week';
                $sectionCutoffMax = time() - 604800;
                $sectionCutoffMin = time() - 1209600;
                break;
              
            case 4:
          
                $sectionName = 'This month';
                $sectionCutoffMax = time() - 1209600;
                $sectionCutoffMin = time() - 2592000;
                break;
              
            case 5:
          
                $sectionName = 'Last month';
                $sectionCutoffMax = time() - 2592000;
                $sectionCutoffMin = time() - (60 * 60 * 24 * 365);
                break;
        }
      
        $q = "SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax .  " ORDER BY published DESC LIMIT 50";
        $getArticles = mysql_query($q);

        if (mysql_num_rows($getArticles) > 0)
        {
                echo '<h2>' . $sectionName . '</h2>
                <ul>';

            while ($a = mysql_fetch_assoc($getArticles))
            {
?>
    <li>
    <?php if($news_id !== $a['id']){ echo"<a href=\"".$path."/news/".$a['id']."\" class=\"article-".$a['id']."\">"; } ?>
    <?php echo $a['title']; ?>&raquo;</a>
    <?php if($news_id !== $a['id']){ echo"</a>"; } ?></li>
    <?php }
echo '
</ul>
';
        }
    }

?>
                                </div>
                            </div>
                        </div>
                        <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                </div>
<div id="column2" class="column">
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper">
                                    <h2>{newsTitle}</h2>
                                    <div class="article-meta">Posted {newsDate}</div>
                                    <p class="summary">{newsTitle}</p>
                                    <div class="article-body">
                                        {newsContent}
                                        <br><br>
                                        <p><font face="Verdana" size="1"><b>- {newsAuthor}</b></p>
                                        <script type="text/javascript" language="Javascript">
                                            document.observe("dom:loaded", function() {
                                                $$('.article-images a').each(function(a) {
                                                    Event.observe(a, 'click', function(e) {
                                                        Event.stop(e);
                                                        Overlay.lightbox(a.href, "Image is loading");
                                                    });
                                                });
                                              
                                                $$('a.article-2729').each(function(a) {
                                                    a.replace(a.innerHTML);
                                                });
                                            });
                                        </script>
                                    </div>
                                </div>
                            </div>
                    <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                  
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            HabboView.run();
        </script>

        <!--[if lt IE 7]>
            <script type="text/javascript">
                Pngfix.doPngImageFix();
            </script>
        <![endif]-->
      
        <div id="footer" >
            <?php include('includes/footer.php'); ?>
            <?php include('includes/checktheban.php'); ?>
        </div>
  
    </body>
</html>
 

Detox

Member
Jul 24, 2010
365
24
Do you know what you changed? Was it table name or column names?

Try and run this query:

'SELECT * FROM cms_news WHERE published >= '1474295670' AND published <= '1475678070' ORDER BY published DESC LIMIT 50;'

Does it error? (However it could also not be showing as there is no other articles?)

So the run the query it was successful but when I refreshed my page nothing changed at all. But I fixed couple of things, so it worked. But for some reason the #'s are reflecting as This Month. When I posted it today so I really suck at math is there a way you can break down the published timestamp.

2hozih1.png


(Side Note: How do you get the article title bolded?)

27y1mvr.png
 
May 1, 2015
470
154
after examining the code you're missing {newsList} under <div id="article-archive"> i fixed it for you, just replace your news code with this and it should work :p
HTML:
<!DOCTYPE html>
<?php include('includes/checktheban.php'); ?>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>{hotelName} - News Articles</title>
     
        <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/common.css" type="text/css">
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs2.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/visual.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/common.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/fullcontent.js"></script>

        <style type="text/css">input[type="text"],input[type="password"]{background-color:#F1F1F1;border:1px solid #999999;width:175px;padding:5px;font-family:verdana;font-size:10px;color:#666666;}input[type="submit"]{background-color:#F1F1F1;border:1px solid #999999;padding:5px;font-family:verdana;font-size:10px;color:#666666;}textarea{background-color:#F1F1F1;border:1px solid #999999;padding:5px;width:517px;height:70px;font-family:verdana;font-size:10px;color:#666666;}select{background-color:#F1F1F1;border:1px solid #999999;padding:5px;font-family:verdana;font-size:10px;color:#666666;}</style>
     
        <script type="text/javascript">
            document.habboLoggedIn = true;
            var habboName = "{username}";
            var habboId = {userid};
            var habboReqPath = "";
            var habboStaticFilePath = "{url}/app/tpl/skins/Habbo";
            var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";
            var habboPartner = "";
            var habboDefaultClientPopupUrl = "{url}/client";
            window.name = "habboMain";
            if (typeof HabboClient != "undefined") {
                HabboClient.windowName = "eac955c8dbc88172421193892a3e98fc7402021a";
                HabboClient.maximizeWindow = true;
            }
        </script>
     
        <!--[if IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie8.css" type="text/css">
        <![endif]-->
        <!--[if lt IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie.css" type="text/css" />
        <![endif]-->
        <!--[if lt IE 7]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie6.css" type="text/css" />
            <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/pngfix.js"></script>
            <script type="text/javascript">
                try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
            </script>
            <style type="text/css">
                body { behavior: url({url}/app/tpl/skins/Habbo/js/csshover.htc); }
            </style>
        <![endif]-->
    </head>
 
    <body id="news">
 
        <div id="overlay"></div>
             <?php

$navigatorID = 2;
require_once ('includes/header.php');

?>
            </div>
            </div>
        </div>
        <div id="content-container">
            <div id="navi2-container" class="pngbg">
                <div id="navi2" class="pngbg clearfix">
                    <ul>
                        <?php

$subNavigatorID = 2;
require_once ('includes/subnavi.php');

?>
                    </ul>
                </div>
            </div>
            <div id="container">
            <div id="content" style="position: relative" class="clearfix">
            <div id="column1" class="column">
            <div class="habblet-container ">
            <div class="cbb clearfix default ">
            <h2 class="title">News</h2>
            <div id="article-archive">
                <ul>
                  {newsList}
                           </ul>          
 </div>
 <?php
    for ($i = 0; $i < 7; $i++)
    {
        $sectionName = '';
        $sectionCutoffMax = 0;
        $sectionCutoffMin = 0;
     
        switch ($i)
        {
            case 0:
         
                $sectionName = 'Today';
                $sectionCutoffMax = time();
                $sectionCutoffMin = time() - 86400;
                break;
             
            case 1:
         
                $sectionName = 'Yesterday';
                $sectionCutoffMax = time() - 86400;
                $sectionCutoffMin = time() - 172800;
                break;
             
            case 2:
         
                $sectionName = 'This week';
                $sectionCutoffMax = time() - 172800;
                $sectionCutoffMin = time() - 604800;
                break;
             
            case 3:
         
                $sectionName = 'Last week';
                $sectionCutoffMax = time() - 604800;
                $sectionCutoffMin = time() - 1209600;
                break;
             
            case 4:
         
                $sectionName = 'This month';
                $sectionCutoffMax = time() - 1209600;
                $sectionCutoffMin = time() - 2592000;
                break;
             
            case 5:
         
                $sectionName = 'Last month';
                $sectionCutoffMax = time() - 2592000;
                $sectionCutoffMin = time() - (60 * 60 * 24 * 365);
                break;
        }
     
        $q = "SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax .  " ORDER BY published DESC LIMIT 50";
        $getArticles = mysql_query($q);

        if (mysql_num_rows($getArticles) > 0)
        {
                echo '<h2>' . $sectionName . '</h2>
                <ul>';

            while ($a = mysql_fetch_assoc($getArticles))
            {
?>
    <li>
    <?php if($news_id !== $a['id']){ echo"<a href=\"".$path."/news/".$a['id']."\" class=\"article-".$a['id']."\">"; } ?>
    <?php echo $a['title']; ?>&raquo;</a>
    <?php if($news_id !== $a['id']){ echo"</a>"; } ?></li>
    <?php }
echo '
</ul>
';
        }
    }

?>
                                </div>
                            </div>
                        </div>
                        <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                </div>
<div id="column2" class="column">
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper">
                                    <h2>{newsTitle}</h2>
                                    <div class="article-meta">Posted {newsDate}</div>
                                    <p class="summary">{newsTitle}</p>
                                    <div class="article-body">
                                        {newsContent}
                                        <br><br>
                                        <p><font face="Verdana" size="1"><b>- {newsAuthor}</b></p>
                                        <script type="text/javascript" language="Javascript">
                                            document.observe("dom:loaded", function() {
                                                $$('.article-images a').each(function(a) {
                                                    Event.observe(a, 'click', function(e) {
                                                        Event.stop(e);
                                                        Overlay.lightbox(a.href, "Image is loading");
                                                    });
                                                });
                                             
                                                $$('a.article-2729').each(function(a) {
                                                    a.replace(a.innerHTML);
                                                });
                                            });
                                        </script>
                                    </div>
                                </div>
                            </div>
                    <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                 
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            HabboView.run();
        </script>

        <!--[if lt IE 7]>
            <script type="text/javascript">
                Pngfix.doPngImageFix();
            </script>
        <![endif]-->
     
        <div id="footer" >
            <?php include('includes/footer.php'); ?>
            <?php include('includes/checktheban.php'); ?>
        </div>
 
    </body>
</html>
That's not needed as the code is selecting the title directly from the cms_news table.
 

Detox

Member
Jul 24, 2010
365
24
after examining the code you're missing {newsList} under <div id="article-archive"> i fixed it for you, just replace your news code with this and it should work :p
HTML:
<!DOCTYPE html>
<?php include('includes/checktheban.php'); ?>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>{hotelName} - News Articles</title>
     
        <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/common.css" type="text/css">
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs2.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/visual.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/libs.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/common.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/fullcontent.js"></script>

        <style type="text/css">input[type="text"],input[type="password"]{background-color:#F1F1F1;border:1px solid #999999;width:175px;padding:5px;font-family:verdana;font-size:10px;color:#666666;}input[type="submit"]{background-color:#F1F1F1;border:1px solid #999999;padding:5px;font-family:verdana;font-size:10px;color:#666666;}textarea{background-color:#F1F1F1;border:1px solid #999999;padding:5px;width:517px;height:70px;font-family:verdana;font-size:10px;color:#666666;}select{background-color:#F1F1F1;border:1px solid #999999;padding:5px;font-family:verdana;font-size:10px;color:#666666;}</style>
     
        <script type="text/javascript">
            document.habboLoggedIn = true;
            var habboName = "{username}";
            var habboId = {userid};
            var habboReqPath = "";
            var habboStaticFilePath = "{url}/app/tpl/skins/Habbo";
            var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";
            var habboPartner = "";
            var habboDefaultClientPopupUrl = "{url}/client";
            window.name = "habboMain";
            if (typeof HabboClient != "undefined") {
                HabboClient.windowName = "eac955c8dbc88172421193892a3e98fc7402021a";
                HabboClient.maximizeWindow = true;
            }
        </script>
     
        <!--[if IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie8.css" type="text/css">
        <![endif]-->
        <!--[if lt IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie.css" type="text/css" />
        <![endif]-->
        <!--[if lt IE 7]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Habbo/styles/ie6.css" type="text/css" />
            <script type="text/javascript" src="{url}/app/tpl/skins/Habbo/js/pngfix.js"></script>
            <script type="text/javascript">
                try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
            </script>
            <style type="text/css">
                body { behavior: url({url}/app/tpl/skins/Habbo/js/csshover.htc); }
            </style>
        <![endif]-->
    </head>
 
    <body id="news">
 
        <div id="overlay"></div>
             <?php

$navigatorID = 2;
require_once ('includes/header.php');

?>
            </div>
            </div>
        </div>
        <div id="content-container">
            <div id="navi2-container" class="pngbg">
                <div id="navi2" class="pngbg clearfix">
                    <ul>
                        <?php

$subNavigatorID = 2;
require_once ('includes/subnavi.php');

?>
                    </ul>
                </div>
            </div>
            <div id="container">
            <div id="content" style="position: relative" class="clearfix">
            <div id="column1" class="column">
            <div class="habblet-container ">
            <div class="cbb clearfix default ">
            <h2 class="title">News</h2>
            <div id="article-archive">
                <ul>
                  {newsList}
                           </ul>          
 </div>
 <?php
    for ($i = 0; $i < 7; $i++)
    {
        $sectionName = '';
        $sectionCutoffMax = 0;
        $sectionCutoffMin = 0;
     
        switch ($i)
        {
            case 0:
         
                $sectionName = 'Today';
                $sectionCutoffMax = time();
                $sectionCutoffMin = time() - 86400;
                break;
             
            case 1:
         
                $sectionName = 'Yesterday';
                $sectionCutoffMax = time() - 86400;
                $sectionCutoffMin = time() - 172800;
                break;
             
            case 2:
         
                $sectionName = 'This week';
                $sectionCutoffMax = time() - 172800;
                $sectionCutoffMin = time() - 604800;
                break;
             
            case 3:
         
                $sectionName = 'Last week';
                $sectionCutoffMax = time() - 604800;
                $sectionCutoffMin = time() - 1209600;
                break;
             
            case 4:
         
                $sectionName = 'This month';
                $sectionCutoffMax = time() - 1209600;
                $sectionCutoffMin = time() - 2592000;
                break;
             
            case 5:
         
                $sectionName = 'Last month';
                $sectionCutoffMax = time() - 2592000;
                $sectionCutoffMin = time() - (60 * 60 * 24 * 365);
                break;
        }
     
        $q = "SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax .  " ORDER BY published DESC LIMIT 50";
        $getArticles = mysql_query($q);

        if (mysql_num_rows($getArticles) > 0)
        {
                echo '<h2>' . $sectionName . '</h2>
                <ul>';

            while ($a = mysql_fetch_assoc($getArticles))
            {
?>
    <li>
    <?php if($news_id !== $a['id']){ echo"<a href=\"".$path."/news/".$a['id']."\" class=\"article-".$a['id']."\">"; } ?>
    <?php echo $a['title']; ?>&raquo;</a>
    <?php if($news_id !== $a['id']){ echo"</a>"; } ?></li>
    <?php }
echo '
</ul>
';
        }
    }

?>
                                </div>
                            </div>
                        </div>
                        <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                </div>
<div id="column2" class="column">
<div class="habblet-container ">
<div class="cbb clearfix notitle ">
<div id="article-wrapper">
                                    <h2>{newsTitle}</h2>
                                    <div class="article-meta">Posted {newsDate}</div>
                                    <p class="summary">{newsTitle}</p>
                                    <div class="article-body">
                                        {newsContent}
                                        <br><br>
                                        <p><font face="Verdana" size="1"><b>- {newsAuthor}</b></p>
                                        <script type="text/javascript" language="Javascript">
                                            document.observe("dom:loaded", function() {
                                                $$('.article-images a').each(function(a) {
                                                    Event.observe(a, 'click', function(e) {
                                                        Event.stop(e);
                                                        Overlay.lightbox(a.href, "Image is loading");
                                                    });
                                                });
                                             
                                                $$('a.article-2729').each(function(a) {
                                                    a.replace(a.innerHTML);
                                                });
                                            });
                                        </script>
                                    </div>
                                </div>
                            </div>
                    <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                 
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">
            HabboView.run();
        </script>

        <!--[if lt IE 7]>
            <script type="text/javascript">
                Pngfix.doPngImageFix();
            </script>
        <![endif]-->
     
        <div id="footer" >
            <?php include('includes/footer.php'); ?>
            <?php include('includes/checktheban.php'); ?>
        </div>
 
    </body>
</html>

your code made it funky looking.
 

Detox

Member
Jul 24, 2010
365
24
its the same skin you're using so maybe just take the news code from that cms or whatever and match the tab links and such with your old maybe?

Habboon Never released their CMS so I wouldn't know. But I do know it has something to do with this

PHP:
<?php
    for ($i = 0; $i < 7; $i++)
    {
        $sectionName = '';
        $sectionCutoffMax = 0;
        $sectionCutoffMin = 0;
       
        switch ($i)
        {
            case 0:
           
                $sectionName = 'Today';
                $sectionCutoffMax = time();
                $sectionCutoffMin = time() - 86400;
                break;
               
            case 1:
           
                $sectionName = 'Yesterday';
                $sectionCutoffMax = time() - 86400;
                $sectionCutoffMin = time() - 172800;
                break;
               
            case 2: 
           
                $sectionName = 'This week';
                $sectionCutoffMax = time() - 172800;
                $sectionCutoffMin = time() - 604800;
                break;
               
            case 3:
           
                $sectionName = 'Last week';
                $sectionCutoffMax = time() - 604800;
                $sectionCutoffMin = time() - 1209600;
                break;
               
            case 4:
           
                $sectionName = 'This month';
                $sectionCutoffMax = time() - 1209600;
                $sectionCutoffMin = time() - 2592000;
                break;
               
            case 5:
           
                $sectionName = 'Last month';
                $sectionCutoffMax = time() - 2592000;
                $sectionCutoffMin = time() - (60 * 60 * 24 * 365);
                break;
        }
       
        $q = "SELECT * FROM cms_news WHERE published >= " . $sectionCutoffMin . " AND published <= " . $sectionCutoffMax .  " ORDER BY published DESC LIMIT 50";
        $getArticles = mysql_query($q);

        if (mysql_num_rows($getArticles) > 0)
        {
                echo '<h2>' . $sectionName . '</h2> 
                <ul>';

            while ($a = mysql_fetch_assoc($getArticles))
            {
?>
    <li>
    <?php if($news_id !== $a['id']){ echo"<a href=\"".$path."/news/".$a['id']."\" class=\"article-".$a['id']."\">"; } ?>
    <?php echo $a['title']; ?> &raquo;</a>
    <?php if($news_id !== $a['id']){ echo"</a>"; } ?></li>
    <?php }
echo '
</ul>
';
        }
    }

?>
 

Users who are viewing this thread

Top