<?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 up MAXIMUS directly...');

if (defined('ADMIN_ALLOW')) {
	$block_retention   = CACHE_BL_SUPPORTERSUP;
	$block_name_cache = "SupportersUpAdmin";
	$extension        = "php";
} else {
	$block_retention   = CACHE_BL_SUPPORTERSUP;
	$block_name_cache = "SupportersUp";
	$extension        = "html";
}

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

get_lang('Supporters');
$sql = "SELECT * from `".TABLE_NSNSP_CONFIG."`";
if ( !($res = $GLOBALS['db']->sql_query($sql)) )
{ query_die(BLOCK_ERROR, 'Could not obtain _nsnsp_config Blocks', '', __LINE__, __FILE__, $sql);}
$supporterup = $GLOBALS['db']->sql_fetchrow($res);
$content = "<center>"._SUPPORTEDBY."<br /><br />";
$content .= "<marquee behavior='scroll' direction='up' height='150' scrollamount='3' scrolldelay='90' width='100' onmouseover='this.stop()' onmouseout='this.start()'><center>\n";
$sql1 = "SELECT `site_id`, `site_name`, `site_image` FROM `".TABLE_NSNSP_SITES."` WHERE `site_status`>'0' ORDER BY `site_name` DESC";
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 .= "<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><br /><br />\n";
}
$content .="</center></marquee></center>\n";
if ($supporterup['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";
$GLOBALS['db']->sql_freeresult($res);
$GLOBALS['db']->sql_freeresult($result);

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