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

if (defined('ADMIN_ALLOW')) {
	$block_retention   = CACHE_BL_SCROLLSENTINEL;
	$block_name_cache = "ScrollSentinelAdmin";
	$extension        = "php";
} else {
	$block_retention   = CACHE_BL_SCROLLSENTINEL;
	$block_name_cache = "ScrollSentinel";
	$extension        = "html";
}

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

global $ab_config;
$usemarquee = 1;
$scrolldirection = "Down";
$content = "";
$content .= "<table border='1'><tr><td align=\"center\" valign=\"top\"> This is the list of Sentinel banned IP addresses. </td></tr></table><hr>\n";
$content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\" Height=\"150\" ScrollAmount=\"1\" ScrollDelay=\"75\" onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\"><br />";
$sql = "SELECT `ip_addr`, `reason` FROM `".TABLE_NSNST_BLOCKED_IPS."` ORDER BY `date` DESC LIMIT 30";
if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsnst_blocked_ips', '', __LINE__, __FILE__, $sql);}
while ($row = $GLOBALS['db']->sql_fetchrow($result)) {
$ip_addr   = stripslashes($row['ip_addr']);
$ip_reason = stripslashes($row['reason']);
  if((defined('ADMIN_ALLOW')AND $ab_config['display_link']==1) OR ((defined('USER_ALLOW') OR defined('ADMIN_ALLOW')) AND $ab_config['display_link']==2) OR $ab_config['display_link']==3) {
    $lookupip = str_replace("*", "0", $ip_addr);
    $content .= "<b><big>&middot;</big></b>&nbsp;<a href=\"".$ab_config['lookup_link']."$lookupip\" target=\"_blank\">$ip_addr</a>\n";
  } else {
    $content .= "<b><big>&middot;</big></b>&nbsp;$ip_addr\n";
  }
  if((defined('ADMIN_ALLOW') AND $ab_config['display_reason']==1) OR ((defined('USER_ALLOW') OR defined("ALLOW_ALLOW")) AND $ab_config['display_reason']==2) OR $ab_config['display_reason']==3) {
    $result2 = $GLOBALS['db']->sql_query("SELECT `reason` FROM `".TABLE_NSNST_BLOCKERS."` WHERE `blocker`='$ip_reason'");
    if ( !($result2 = $GLOBALS['db']->sql_query($sql2)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsnst_blockers', '', __LINE__, __FILE__, $sql2);}
    $row2 = $GLOBALS['db']->sql_fetchrow($result2);
    $reason = stripslashes($row2['reason']);
    $reason = str_replace("Abuse-","",$reason);
    $content .= "&nbsp;-&nbsp;$reason\n";
  }
  $content .= "<br />\n";
}
$content .= "</Marquee><br />";
$content .= "<hr><center><a href=\"http://www.nukescripts.net\" target=\"_blank\">"._AB_NUKESENTINEL." ".$ab_config['version_number']."</a></center>\n";

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