Example #1
0
function news_individual_link($date, $title)
{
    return WEBPATH . "news/archives/" . str_replace("-", "/", substr($date, 0, 10)) . "/" . news_format_ref($title);
}
Example #2
0
<?php

include_once '../../includes/easyparliament/init.php';
// News content is in here
require_once "editme.php";
$uri = $_SERVER['REQUEST_URI'];
if (preg_match("#/(\\d\\d\\d\\d)/(\\d\\d)/(\\d\\d)/([a-z0-9_]+)(\\.php)?\$#", $uri, $matches)) {
    // Individual item
    list($all, $year, $month, $day, $ref) = $matches;
    if ($ref == "please_build_on_") {
        $ref = "new_full_source_";
    }
    foreach ($all_news as $id => $news_row) {
        list($title, $content, $date) = $news_row;
        if (news_format_ref($title) != $ref) {
            continue;
        }
        $this_page = 'sitenews_individual';
        $DATA->set_page_metadata($this_page, 'title', $title);
        $PAGE->page_start();
        $PAGE->stripe_start();
        print news_format_body($content);
        print "<p>Posted on " . format_date(substr($date, 0, 10), LONGDATEFORMAT) . " 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>";
        break;
    }
} elseif (preg_match("#/(\\d\\d\\d\\d)/(\\d\\d)/?(index.php)?\$#", $uri, $matches)) {
    // Month index