<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
defined('MAXIMUS') or die ('Access denied nsngd new MAXIMUS directly...');

if ( $content = opencacheb ( 'NSNGDNEW', 'html' , "".CACHE_BL_NSNGDNEW."", '1' ) ) {
} else {

$blkh  = 20; // Number of lines high
$blkw  = 20; // Number of characters wide 0 = unused
$scron = 0; // Turn scrolling on by setting to 1
$scrdr = up; // Scroll direction (up, down, left, or right)
$scrhg = 400; // Scroller height in pixels
$scrwd = 200; // Scroller width in pixels
$a = 1;
if ($scron == 1) {
    $content .= "<marquee behavior='scroll' direction='$scrdr' height='$scrhg' width='$scrwd' scrollamount='2' scrolldelay='100' onMouseOver='this.stop()' onMouseOut='this.start()'><br />";
}
$sql = "select `lid`, `title` from `".TABLE_NSNGD_DOWNLOADS."` order by date DESC limit 0,$blkh";
if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsngd_downloads', '', __LINE__, __FILE__, $sql);}
while($raw = $GLOBALS['db']->sql_fetchrow($result)) {
$lid   = $GLOBALS['db']->XMFnum($raw['lid']);
$title = stripslashes($raw['title']);
    $title2 = ereg_replace("_", " ", $title);
    $title = strtr($title, " ()", "_[]");
    if ($blkw > 0) { if (strlen($title2) > $blkw) { $title2 = substr($title2, 0, $blkw); } }
    if ($a < 10) { $content .= "0$a: "; } else { $content .= "$a: "; }
    $content .= "<a href=\"modules.php?name=Downloads&amp;op=getit&amp;lid=$lid\">$title2</a><br />";
    $a++;
}
if ($scron == 1) {
	$content .= "</marquee>";
}
$GLOBALS['db']->sql_freeresult($result);

closecacheb ( "".$content."", 'NSNGDNEW', 'html' , "".CACHE_BL_NSNGDNEW."", '1' );
}