Ejemplo n.º 1
0
<?php

global $all_news;
// News content is in here
require_once 'editme.php';
$c = 0;
foreach ($all_news as $id => $news_row) {
    if ($c++ == 2) {
        break;
    }
    list($title, $content, $date) = $news_row;
    $url = news_individual_link($date, $title);
    print "<h5><a href=\"{$url}\">" . $title . "</a></h5>";
    print "<p>";
    print trim_characters(news_format_body($content), 0, 250);
    print " <a href=\"{$url}\">Read more...</a>";
    print "</p>";
}
?>

<p>
<a href="/news/index.rdf">Site News as RSS</a></p>
Ejemplo n.º 2
0
}
?>
</rdf:Seq>
</items>

</channel>

<?php 
$c = 0;
foreach ($all_news as $id => $news_row) {
    if ($c++ == 10) {
        break;
    }
    list($title, $content, $date) = $news_row;
    $url = "http://www.theyworkforyou.com" . news_individual_link($date, $title);
    $excerpt = trim_characters(news_format_body($content), 0, 250);
    $date = str_replace(" ", "T", $date) . "+00:00";
    ?>
<item rdf:about="<?php 
    echo $url;
    ?>
">
<title><?php 
    echo htmlspecialchars($title);
    ?>
</title>
<link><?php 
    echo $url;
    ?>
</link>
<description><?php 
Ejemplo n.º 3
0
        if (isset($news_row[3])) {
            print " by {$news_row['3']}";
        }
        print " | <a href=\"" . news_individual_link($date, $title) . "\">Link to this</a>";
    }
} else {
    // Front page /news
    $this_page = 'sitenews';
    $PAGE->page_start();
    $PAGE->stripe_start();
    $c = 0;
    foreach ($all_news as $id => $news_row) {
        if ($c++ == 10) {
            break;
        }
        list($title, $content, $date) = $news_row;
        print "<h3>" . format_date(substr($date, 0, 10), LONGDATEFORMAT) . "</h3>";
        print "<h4>" . $title . "</h4>";
        print news_format_body($content);
        print "<p>Posted at " . substr($date, 11);
        if (isset($news_row[3])) {
            print " by {$news_row['3']}";
        }
        print " | <a href=\"" . news_individual_link($date, $title) . "\">Link to this</a>";
    }
}
$PAGE->stripe_end(array(array('type' => 'include', 'content' => 'sitenews')));
$PAGE->page_end();
?>