<?php
defined('MAXIMUS') or die ('Access denied adminblock MAXIMUS directly...');

  global $admin_file;
  if(defined('ADMIN_ALLOW')) {
  $title = ""._ADMINISTRATION."";
  $ret_blockwhoisonline = 300;
  if ( $content = opencacheb ( "AdminContent", "php", "".$ret_blockwhoisonline."" ) ) {
  } else {
if (!defined('ADMIN_MAX')) {
    $content = "<font class='content'><img src='images/blocks/admin.png' alt=\""._ADMINISTRATION."\" title=\""._ADMINISTRATION."\" />&nbsp;<a href=\"".$admin_file.".php\"><b>"._ADMINISTRATION."</b></a><br />";
    $content .= "<font class='content'><img src='images/nukesentinel/delete.png' alt=\""._LOGOUT."\" title=\""._LOGOUT."\" />&nbsp;<a href=\"".$admin_file.".php?op=logout\"><b>"._LOGOUT."</b></font></a><hr />";
}

    $sql = "SELECT `qid` FROM `".TABLE_QUEUE."`";
    if ( !($result = $GLOBALS['db']->sql_query($sql)) )
{ query_die(CORE_ERROR, 'Could not obtain _queue', '', __LINE__, __FILE__, $sql);}
    $num = $GLOBALS['db']->sql_numrows($result);
    $content .= "<hr /><font class='content'><b>"._NEWSREVIEWS."</b><br />";
    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"".$admin_file.".php?op=submissions\">"._SUBMISSIONS."</a>: $num<br />";

if(is_active('Reviews')) {
    $sql1 = "SELECT `id` FROM `".TABLE_REVIEWS."_add`";
    if ( !($result1 = $GLOBALS['db']->sql_query($sql1)) )
{ query_die(CORE_ERROR, 'Could not obtain _reviews_add', '', __LINE__, __FILE__, $sql1);}
    $num = $GLOBALS['db']->sql_numrows($result1);
    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"".$admin_file.".php?op=reviews\">"._WREVIEWS."</a>: $num<br />";
    $GLOBALS['db']->sql_freeresult($result1);
}

if(is_active('Web_Links')) {
    $sql2 = "SELECT `lid` FROM `".TABLE_LINKS_NEWLINK."` ";
    if ( !($result2 = $GLOBALS['db']->sql_query($sql2)) )
{ query_die(CORE_ERROR, 'Could not obtain _links_newlink', '', __LINE__, __FILE__, $sql2);}
    $num = $GLOBALS['db']->sql_numrows($result2);
    $sql3 = "SELECT `requestid` FROM `".TABLE_LINKS_MODREQUEST."` WHERE `brokenlink`='1'";
    if ( !($result3 = $GLOBALS['db']->sql_query($sql3)) )
{ query_die(CORE_ERROR, 'Could not obtain _links_modrequest', '', __LINE__, __FILE__, $sql3);}
    $brokenl = $GLOBALS['db']->sql_numrows($result3);
    $sql4 = "SELECT `requestid` FROM `".TABLE_LINKS_MODREQUEST."` WHERE `brokenlink`='0'";
    if ( !($result4 = $GLOBALS['db']->sql_query($sql4)) )
{ query_die(CORE_ERROR, 'Could not obtain _links_modrequest', '', __LINE__, __FILE__, $sql4);}
    $modreql = $GLOBALS['db']->sql_numrows($result4);
    $content .= "<b>"._WEBLINKS."</b><br /><strong><big>&middot;</big></strong>&nbsp;<a href=\"".$admin_file.".php?op=Links\">"._WLINKS."</a>: $num<br />";
    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"".$admin_file.".php?op=LinksListModRequests\">"._MODREQLINKS."</a>: $modreql<br />";
    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"".$admin_file.".php?op=LinksListBrokenLinks\">"._BROKENLINKS."</a>: $brokenl<br />";
   $GLOBALS['db']->sql_freeresult($result2);
   $GLOBALS['db']->sql_freeresult($result3);
   $GLOBALS['db']->sql_freeresult($result4);
}

if(is_active('Downloads')) {
    $sql5 = "SELECT `lid` FROM `".TABLE_NSNGD_NEW."`";
    if ( !($result5 = $GLOBALS['db']->sql_query($sql5)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsngd_new', '', __LINE__, __FILE__, $sql5);}
    $num  = $GLOBALS['db']->sql_numrows($result5);
    $sql6 = "SELECT `rid` FROM `".TABLE_NSNGD_MODS."` WHERE `brokendownload`='1'";
    if ( !($result6 = $GLOBALS['db']->sql_query($sql6)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsngd_mods', '', __LINE__, __FILE__, $sql6);}
    $brokend = $GLOBALS['db']->sql_numrows($result6);
    $sql7 = "SELECT `rid` FROM `".TABLE_NSNGD_MODS."` WHERE `brokendownload`='0'";
    if ( !($result7 = $GLOBALS['db']->sql_query($sql7)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsngd_mods', '', __LINE__, __FILE__, $sql7);}
    $modreqd  = $GLOBALS['db']->sql_numrows($result7);
    $content .= "<b>"._DOWNLOADS."</b><br /><strong><big>&middot;</big></strong>&nbsp;<a href=\"".$admin_file.".php?op=DownloadNew\">"._UDOWNLOADS."</a>: $num<br />";
    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"".$admin_file.".php?op=DownloadModifyRequests\">"._MODREQDOWN."</a>: $modreqd<br />";
    $content .= "<strong><big>&middot;</big></strong>&nbsp;<a href=\"".$admin_file.".php?op=DownloadBroken\">"._BROKENDOWN."</a>: $brokend<br />";
   $GLOBALS['db']->sql_freeresult($result5);
   $GLOBALS['db']->sql_freeresult($result6);
   $GLOBALS['db']->sql_freeresult($result7);
}

if(is_active('Supporters')) {
    $sql8 = "select `site_id` FROM `".TABLE_NSNSP_SITES."` WHERE `site_status`='1'";
    if ( !($result8 = $GLOBALS['db']->sql_query($sql8)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsnsp_sites', '', __LINE__, __FILE__, $sql8);}
    $supact = $GLOBALS['db']->sql_numrows($result8);
    $sql9 = "select `site_id` FROM `".TABLE_NSNSP_SITES."` WHERE `site_status`='0'";
    if ( !($result9 = $GLOBALS['db']->sql_query($sql9)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsnsp_sites', '', __LINE__, __FILE__, $sql9);}
    $suppen = $GLOBALS['db']->sql_numrows($result9);
    $sql10 = "select `site_id` FROM `".TABLE_NSNSP_SITES."` WHERE `site_status`='-1'";
    if ( !($result10 = $GLOBALS['db']->sql_query($sql10)) )
{ query_die(CORE_ERROR, 'Could not obtain _nsnsp_sites', '', __LINE__, __FILE__, $sql10);}
    $supdea = $GLOBALS['db']->sql_numrows($result10);
    $content .= "<b>"._SUPPORTERS."</b><br /><strong><big>&middot;</big></strong> <a href=\"".$admin_file.".php?op=Supportersactive\">"._ASUPPORT."</a>: $supact<br />";
    $content .= "<strong><big>&middot;</big></strong> <a href=\"".$admin_file.".php?op=Supporterspending\">"._WSUPPORT."</a>: $suppen<br />";
    $content .= "<strong><big>&middot;</big></strong> <a href=\"".$admin_file.".php?op=Supportersinactive\">"._DSUPPORT."</a>: $supdea<br /></font>";
    $GLOBALS['db']->sql_freeresult($result8);
    $GLOBALS['db']->sql_freeresult($result9);
}

$GLOBALS['db']->sql_freeresult($result);
closecacheb ( "$content", "AdminContent", "php", "".$ret_blockwhoisonline."" );
}
    if($side == 'c' OR $side == 'd') {
      themecenterbox($title, $content);
    } elseif($side == 'l') {
      themeleftbox($title, $content);
    } elseif($side == 'r') {
      themerightbox($title, $content);
    } else {
      themesidebox($title, $content);
    }

  }