• 0
Sign in to follow this  
Scofield

fluxcp rss news

Question

how do I fix these ipb news systems
codes

application.php

CMSNewsRSS'                => 'http://heroragnarok.com.br/forum/index.php?/forum/6-manuten%C3%A7%C3%B5es-e-atualiza%C3%A7%C3%B5es.xml',        // Use if CMSNewsType = 2


    'CMSNewsRSS2'                => 'http://heroragnarok.com.br/forum/index.php?/forum/49-changelog.xml',        // Use if CMSNewsType = 2
    'CMSNewsRSS3'                => 'http://heroragnarok.com.br/forum/index.php?/forum/7-eventos-e-promo%C3%A7%C3%B5es.xml',        // Use if CMSNewsType = 2
    'CMSNewsLimit'                => 4,                        // Number of news items to display

news.php

<?php if (!defined('FLUX_ROOT')) exit; ?>
<?php if(Flux::config('CMSNewsOnHomepage')): ?>
    <?php if($newstype == '2'):?>
        <?php if(isset($xml) && isset($xml->channel)): ?>
        <div class="newsDiv">
            <?php foreach($xml->channel->item as $rssItem): ?>
                <?php $i++; if($i <= $newslimit): ?>

                    <div class="wcontainer">
                    <h2 style="color: green"><?php echo $rssItem->title ?></h2>
                        <span class="newsDate">Data: <?php echo date(Flux::config('DateFormat'),strtotime($rssItem->pubDate))?></span>
                        <p><?php echo $rssItem->description ?></p>
                        
                        <a class="news_link" href="<?php echo $rssItem->link ?>"><small><?php echo htmlspecialchars(Flux::message('XCMSNewsLink')) ?></small></a>
                        <div class="clear"></div>
                    </div>
                <?php endif ?>
            <?php endforeach; ?> 
        </div>
        <?php else: ?>
            <p>
                <?php echo htmlspecialchars(Flux::message('XCMSNewsRSSNotFound')) ?><br/><br/>
            </p>
        <?php endif ?>
    <?php endif ?>
<?php endif ?>

news3.php

<?php


if (!defined('FLUX_ROOT')) exit;
$title = null;
$newslimit = 4;
$newstype = (int)Flux::config('CMSNewsType');
if($newstype == '2'){
    $news = Flux::config('FluxTables.CMSNewsTable'); 
    $sql = "SELECT title, body, link, author, created, modified FROM {$server->loginDatabase}.$news ORDER BY id DESC LIMIT $newslimit";
    $sth = $server->connection->getStatement($sql);
    $sth->execute();
    $news = $sth->fetchAll();
} elseif($newstype == '2'){
    $content = file_get_contents(Flux::config('CMSNewsRSS3'));
    if($content) {
        $i = 0;
        $xml = new SimpleXmlElement($content);
    }
}
?>
<?php if(Flux::config('CMSNewsOnHomepage')): ?>
    <?php if($newstype == '1'):?>
        <?php if($news): ?>
            Utilize o newstype = 2
        <?php else: ?>
            <?php echo htmlspecialchars(Flux::message('XCMSNewsEmpty')) ?>
        <?php endif ?>
    <?php elseif($newstype == '2'):?>
        <?php if(isset($xml) && isset($xml->channel)): ?>
            <?php foreach($xml->channel->item as $rssItem): ?>
                <?php $i++; if($i <= $newslimit): ?>
                <li>
                    <a href="<?php echo $rssItem->link ?>"><?php echo $rssItem->title ?></a><br />
                    <small>
                        <i class="icon-calendar"></i> 
                        Data: <?php echo date(Flux::config('DateFormat'),strtotime($rssItem->pubDate))?>
                    </small>
                </li>
                <?php endif ?>
            <?php endforeach; ?> 
        <?php else: ?>
                <?php echo htmlspecialchars(Flux::message('XCMSNewsRSSNotFound')) ?><br/><br/>
        <?php endif ?>
    <?php endif ?>
<?php endif ?>

 

error

 

Sem título.jpg

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this