Location: PHPKode > projects > ProNuke. Postnuke To Oracle > postnuke/html/includes/blocks/past.php
<?php
// File: $Id: past.php,v 1.26 2001/12/06 17:55:13 scott_kirkwood Exp $ $Name:  $
// ----------------------------------------------------------------------
// POST-NUKE Content Management System
// Copyright (C) 2001 by the Post-Nuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// Based on:
// PHP-NUKE Web Portal System - http://phpnuke.org/
// Thatware - http://thatware.org/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
// Original Author of file: Francisco Burzi
// Purpose of file:
// ----------------------------------------------------------------------

$blocks_modules['past'] = array(
    'func_display' => 'blocks_past_block',
    'text_type' => 'Past',
    'text_type_long' => 'Past Articles',
    'allow_multiple' => false,
    'form_content' => false,
    'form_refresh' => false,
    'show_preview' => true
);

// Security
addinstanceschemainfo('Pastblock::', '::');

// Story functions
pninclude_once('modules/News/funcs.php');

function blocks_past_block($row)
{
    global $locale, $oldnum, $storyhome, $cookie, $categories, $cat, $pntable, $dbconn, $multilingual, $currentlang;
    $storynum = $storyhome;

    $column = &$pntable['stories_column'];
    if ($categories == 1) {
        $articles = getArticles("$column[catid]=$cat", "$column[time] DESC", "$storynum,$oldnum");
    } else {
        $articles = getArticles("1=1", "$column[time] DESC", "$storynum,$oldnum");
    }

    $time2 = "";
    // Scott put @ sign to remove following warning:
    // Warning: Passing locale category name as string is deprecated. Use the LC_* -constants instead. in 
    
    @setlocale ("LC_TIME", "$locale");
    $boxstuff = "<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" class=\"pn-normal\">\n";

    // FTO : Declare vari variable to remove warning
    $vari =0;

    foreach ($articles as $article) {

        $info = genArticleInfo($article);
        $links = genArticleLinks($info);
        $preformat = genArticlePreformat($info, $links);

        // a little bit tricky to remove the bold property from link description
        // (2001-11-15, hdonner)
        // FTO use quote before title index name
        $preformat['title'] = str_replace("pn-title", "pn-normal", $preformat['title']);

        if (!authorised(0, 'Stories::', "$info[aid]:$info[cattitle]:$info[sid]", ACCESS_READ)) {
            continue;
        }
        $see = 1;
        ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $info['time'], $datetime2);
        $datetime2 = ml_ftime(""._DATESTRING2."", mktime($datetime2[4],$datetime2[5],$datetime2[6],$datetime2[2],$datetime2[3],$datetime2[1]));
        $datetime2 = ucfirst($datetime2);
        if($time2==$datetime2) {
            $boxstuff .= "<tr><td valign=\"top\"><big><strong>&middot;</strong></big></td>"
                ."<td valign=\"top\" width=\"100%\"><font class=\"pn-normal\">$preformat[title]&nbsp;($info[comments])</font></td></tr>\n";
        } else {
            $boxstuff .= "<tr><td colspan=\"2\"><b>$datetime2</b></td></tr>\n"
                ."<tr><td valign=\"top\"><big><strong>&middot;</strong></big></td>"
                ."<td valign=\"top\" width=\"100%\"><font class=\"pn-normal\">$preformat[title]&nbsp;($info[comments])</font></td></tr>\n";
            $time2 = $datetime2;
        }
        $vari++;
        if ($vari==$oldnum) {
            if (isset($cookie[3])) {
                $storynum = $cookie[3];
            } else {
                $storynum = $storyhome;
            }
            $min = $oldnum + $storynum;
            $boxstuff .= "<tr><td>&nbsp;</td><td valign=\"top\"><a class=\"pn-normal\" href=\"modules.php?op=modload&amp;name=Search&amp;file=index&amp;action=search&amp;overview=1&amp;active_stories=1&amp;stories_topics[0]=$cat\"><b>"._OLDERARTICLES."</b></a></td></tr>\n";
        }
    }
    $boxstuff .= "</table>";
    if (!empty($see) && $see == 1) {
        $row['title'] = _PASTARTICLES;
        $row['content'] = $boxstuff;
        themesideblock($row);
    }
}
?>
Return current item: ProNuke. Postnuke To Oracle