Jump to content
  • 0

fluxcp rss news


Geralt

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  108
  • Reputation:   0
  • Joined:  12/26/12
  • Last Seen:  

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

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1616
  • Joined:  03/26/12
  • Last Seen:  

Your if-statement is checking for type 2, and then doing an else-if check for type 2 for no reason.

if($newstype == '2'){


} elseif($newstype == '2'){

}

You need to sort out your if-statements before you can display information correctly.

Link to comment
Share on other sites

×
×
  • Create New...