<?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 block supporters lt MAXIMUS directly...');

if (defined('ADMIN_ALLOW')) {
	$block_retention   = CACHE_BL_SUPPORTERSLT;
	$block_name_cache = "SupportersLTAdmin";
	$extension        = "php";
} else {
	$block_retention   = CACHE_BL_SUPPORTERSLT;
	$block_name_cache = "SupportersLT";
	$extension        = "html";
}

if ( $content = opencacheb ( "".$block_name_cache."", "".$extension."" , "".$block_retention."", '2' ) ) {
} else {

get_lang("Supporters");
$sql = "SELECT * from `".TABLE_NSNSP_CONFIG."`";
if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(BLOCK_ERROR, 'Could not obtain _nsnsp_config Blocks', '', __LINE__, __FILE__, $sql);}
$supporterlt = $GLOBALS['db']->sql_fetchrow($result);
$content = "<center>"._SUPPORTEDBY."<br /><br />";
$content .= "<marquee behavior='scroll' direction='left' height='31' width='160' scrollamount='3' scrolldelay='90' width='100' onmouseover='this.stop()' onmouseout='this.start()'>\n";
$sql1 = "SELECT `site_id`, `site_name`, `site_image` FROM `".TABLE_NSNSP_SITES."` WHERE `site_status`>'0' ORDER BY `site_name`";
if ( !($result1 = $GLOBALS['db']->sql_query($sql1)) )
{ query_die(BLOCK_ERROR, 'Could not obtain _nsnsp_sites Blocks', '', __LINE__, __FILE__, $sql);}
while ($raw = $GLOBALS['db']->sql_fetchrow($result1)) {
$site_id    = $GLOBALS['db']->XMFnum($raw['site_id']);
$site_name  = stripslashes($raw['site_name']);
$site_image = stripslashes($raw['site_image']);
    $content .= "&nbsp;<a href='modules.php?name=Supporters&amp;op=go&amp;site_id=$site_id' target='_blank'><img src='$site_image' height='31' width='88' title='$site_name' alt='$site_name' border='0' /></a>&nbsp;\n";
}
$content .="</marquee><br /><br />\n";
if ($supporterlt['require_user'] == 0 || defined('USER_ALLOW')) { $content .= "[ <a href='modules.php?name=Supporters&amp;file=submit'>"._BESUPPORTER."</a> ]<br />\n"; }
if (defined('ADMIN_ALLOW')) { $content .= "[ <a href='modules.php?name=Supporters&amp;file=admin'>"._GOTOADMIN."</a> ]<br />\n"; }
$content .= "[ <a href='modules.php?name=Supporters'>"._SUPPORTERS."</a> ]</center>\n";

closecacheb ( "".$content."", "".$block_name_cache."", "".$extension."" , "".$block_retention."", '2' );
}