[HELP] News bug

Central

Imagination is more important than knowledge.
Feb 22, 2015
709
107
You must be registered for see images attach


I have had a recent problem and I don't know how to fix it. When I create News Article for my Hotel (hamachi retro) it doesn't enter all of what I want it to, for example, it wouldn't show all of this text, it will show at least 4/6 words.

I have been quite annoyed with this problem and reverted to seek assistance from DevBest users, do you know how to fix this problem?
 

Khalil

IDK
Dec 6, 2011
1,642
786
Can you help me with that?

I would assume there is a part in your forms class (app/tpl/class.forms.php), that looks something like this:
PHP:
$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']));

Find that part and replace it by:
PHP:
$news = $engine->fetch_assoc("SELECT * 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('newsSummary', $news['shortstory']);
 
Last edited:

Central

Imagination is more important than knowledge.
Feb 22, 2015
709
107
Wicket could you send me a hk news create and news page maybe that would be helpful.
 
Khalil, I had done that but thanks and it had applied more text, but it doesnt do a great deal of it
 

Wickd

The first member of the Knights of the Pink Table
Jan 15, 2013
1,936
612
Remove {newsSummary}, i doubt it's doing anything it's just plain text(as it's not defined in classes) so like i said can you share your news.php with us?
 

Central

Imagination is more important than knowledge.
Feb 22, 2015
709
107
PHP:
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>{hotelName} - News</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>
        <link rel="shortcut icon" href="{url}/favicon.ico" type="image/vnd.microsoft.icon" /><script
       
        <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>
        <div id="header-container">
            <div id="header" class="clearfix">
                <h1><a href="{url}/"></a></h1>
                <div id="subnavi">
                    <div id="subnavi-user">
                                          <div style="margin-top:7px"><b>Fact:</b> <script language="JavaScript">


var r_text = new Array ();


r_text[0] = "Telling your friends about {hotelName} will make it even more fun!";


r_text[1] = "{hotelName} Hotel no longer charges for VIP, it is completely free!";


r_text[2] = "{hotelName} Hotel will only keep on growing if you vote daily!";


r_text[3] = "You can buy Super VIP to help cover our server bills!";


r_text[4] = "{hotelName} Hotel opened on February 17, 2012";

r_text[5] = "{hotelName} Hotel is a new and developing retro hotel!";


var i = Math.floor(5*Math.random())





document.write(r_text[i]);





</script>
</div>
                    </div>
                    <div id="subnavi-search">
                        <div id="subnavi-search-upper">
                            <ul id="subnavi-search-links">
                                <li><a href="{url}/logout" style="color:#000">Sign Out</a></li>
                            </ul>
                        </div>
                    </div>
                    <div id="to-hotel">
                        <a href="{url}/api.php" class="new-button green-button" target="eac955c8dbc88172421193892a3e98fc7402021a" onclick="HabboClient.openOrFocus(this); return false;"><b>Enter {hotelName} Hotel</b><i></i></a>
                    </div>
                </div>
                <ul id="navi">
                    <li class="metab"><a href="{url}/me">{username} <img src="{url}/app/tpl/skins/Habbo/images/id.png" style="vertical-align: middle;"></a><span></span></li>
                    <li class="selected"><strong>Community</strong><span></span></li>
                    <li><a href="{url}/badgeshop/index.php">BadgeShop</a><span></span></li>
                    <li><a href="{url}/shop">Shop</a><span></span></li>
                    <li><a href="{url}/values">Rare Values</a><span></span></li>
                    <li><a href="http://37.59.192.132/values">Forums</a><span></span></li>
                </ul>
                <div id="habbos-online"><div class="rounded"><span>{online} members online</span></div></div>
            </div>
        </div>
        <div id="content-container">
            <div id="navi2-container" class="pngbg">
                <div id="navi2" class="pngbg clearfix">
                    <ul>
                        <li><a href="{url}/community">Community</a></li>
                        <li class="selected">News</a></li>
                        <li class=" last"><a href="{url}/staff">Staff</a></li>
                        <li class=" last"><a href="http://tinychat.com/converse">Tinychat</a></li>
                        <li class=" last"><a href="{url}/rules"><font color="red"><strong>Hotel Rules</strong></font></a></li>
                        <li class=" last"><a href="{url}/online">Online Users</a></li>
<li class="last"><a href="{url}/events">Event Staff</a></li>
                       
                    </ul>
                </div>
            </div>
           
            <div id="container">

<div id="content" style="position: relative" class="clearfix">



<div class="habblet-container" style="position: relative; left: 0px; top: 0px; width: 83%;">

<div class="cbb clearfix ">

<div id="habboclub-info" class="box-content">



<script type="text/javascript">
    <!--
    var _adynamo_client = "32cdce96-0813-41c5-84bd-3de99fd8dbef";
    var _adynamo_width = 728;
    var _adynamo_height = 90;
    //-->
</script>
<script type="text/javascript" src="http://static.addynamo.net/ad/js/deliverAds.js"></script>

</div>
</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>
                            </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>
                               
                                    <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>
                        </div>
                        <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                                <div class="habblet-container ">
                            <div class="cbb clearfix notitle ">
                                <div id="article-wrapper">
<div class="fb-comments" data-href="{url}/index.php?url=news&id={newsID}" data-num-posts="10" data-width="530"></div>
                                </div>
                            </div>
                        </div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
        <script type="text/javascript">
            HabboView.run();
        </script>

        <!--[if lt IE 7]>
            <script type="text/javascript">
                Pngfix.doPngImageFix();
            </script>
        <![endif]-->
       
               
       <div id="footer"><p>&copy; Copyright 2012 <a href="http://habtunehotel.com/" target="_New"><b>{hotelName} Hotel</b></a>. All rights reserved.<br>

Powered by <b>NaumanCMS</b></a> by Nauman and <a href="http://www.otaku-studios.com/" target="_blank">Phoenix</a> 3.7.2 (Build 13843)<br>{hotelName} Hotel is owned and operated by Nauman.</p>      </div>
   
   
    </body>
</html>
 
i sent the full file php ok have a read and this is my class forms
PHP:
$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('newsSummary', $news['shortstory']);
 

Wickd

The first member of the Knights of the Pink Table
Jan 15, 2013
1,936
612
Probably this,remove it.
Code:
<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>
 

Central

Imagination is more important than knowledge.
Feb 22, 2015
709
107
Ok, i had removed it, and it still doesnt show all of the text, it displays more of the text, but not a great deal of it.
 

Central

Imagination is more important than knowledge.
Feb 22, 2015
709
107
its not cos i have a different cms that doesnt have comments or facebook comments and still doesnt work, so ..sffsogsjg
 

Users who are viewing this thread

Top