<?PHP
/* JAG Online -------------------------- 06/03/2004 ------------------ v1.31 [6.5~7.1] */
/*                                                                                     */
/*      ////////// //\\ \\\\\\\\\\       Created by Dashe at http://nsd.jagamarog.com  */
/*             // //  \\ \\                                                            */
/*            // //    \\ \\             Email Address:           dashe@jagamarog.com  */
/*           // /////\\\\\ \\   \\\\\                                                  */
/*          // //        \\ \\      \\                                                 */
/*         // //          \\ \\\\\\\\\\                                                */
/* /////////  a g a m a r o g . c o m   N u k e   S c r i p t   D e v e l o p m e n t  */
/*                                                                                     */     
/* Created By Dashe -> http://nsd.jagamarog.com                                        */ 
/*                                                                                     */
/* ----------------------------------------------------------------------------------- */

/* DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING ------------------------------ */

/* Check for Hack Attack ------------------------------------------------------------- */
if (eregi("block-JAG_Online.php", $_SERVER['PHP_SELF'])) 
	{
    header("Location: index.php");
    die();
	}

/* Set Global Variables & General Variables ------------------------------------------ */
global $user, $prefix, $user_prefix, $db, $currentlang, $admin, $sitekey, $gfx_chk, $ThemeSel, $dbname;

$userinfo = getusrinfo($user);

/* Set The Apropriate Language File -------------------------------------------------- */
if (file_exists( "language/JAG_Online/lang-$currentlang.php")) 
	include_once("language/JAG_Online/lang-$currentlang.php");
else
	include_once("language/JAG_Online/lang-arabic.php");
	
/* Get Config Settings For The Block ------------------------------------------------- */
$Q00 = "SELECT *
		FROM ".$prefix."_jag_online_config";
$R00 =  $db -> sql_query($Q00) or die("Bad Q00:".mysql_error());
$OnlineCfg = sql_fetch_array($R00);

/* Start The Script For The Block ---------------------------------------------------- */
        $content  = "";
	$content  = "<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0'>\n";

if ($OnlineCfg[Block1] != "None" OR $OnlineCfg[Block1] == "")
	{
	if ($OnlineCfg[Block1Show] == "All" OR is_user($user) AND $OnlineCfg[Block1Show] == "Mem" OR is_admin($admin) AND $OnlineCfg[Block1Show] == "Adm")
		{
		$content .= "	<TR>\n";
		$content .= "		<TD ALIGN='right' VALIGN='MIDDLE'>\n";
			include ("includes/JAG_Online_".$OnlineCfg[Block1].".php");
		$content .= "		</TD>\n";
		$content .= "	</TR>\n";
		}
	}
	
if ($OnlineCfg[Block2] != "None" OR $OnlineCfg[Block2] == "")
	{
	if ($OnlineCfg[Block2Show] == "All" OR is_user($user) AND $OnlineCfg[Block2Show] == "Mem" OR is_admin($admin) AND $OnlineCfg[Block2Show] == "Adm")
		{
		$content .= "	<TR>\n";
		$content .= "		<TD ALIGN='right' VALIGN='MIDDLE'>\n";
			include ("includes/JAG_Online_".$OnlineCfg[Block2].".php");
		$content .= "		</TD>\n";
		$content .= "	</TR>\n";
		}
	}

if ($OnlineCfg[Block3] != "None" OR $OnlineCfg[Block3] == "")
	{
	if ($OnlineCfg[Block3Show] == "All" OR is_user($user) AND $OnlineCfg[Block3Show] == "Mem" OR is_admin($admin) AND $OnlineCfg[Block3Show] == "Adm")
		{
		$content .= "	<TR>\n";
		$content .= "		<TD ALIGN='right' VALIGN='MIDDLE'>\n";
			include ("includes/JAG_Online_".$OnlineCfg[Block3].".php");
		$content .= "		</TD>\n";
		$content .= "	</TR>\n";
		}
	}
	
if ($OnlineCfg[Block4] != "None" OR $OnlineCfg[Block4] == "")
	{
	if ($OnlineCfg[Block4Show] == "All" OR is_user($user) AND $OnlineCfg[Block4Show] == "Mem" OR is_admin($admin) AND $OnlineCfg[Block4Show] == "Adm")
		{
		$content .= "	<TR>\n";
		$content .= "		<TD ALIGN='right' VALIGN='MIDDLE'>\n";
			include ("includes/JAG_Online_".$OnlineCfg[Block4].".php");
		$content .= "		</TD>\n";
		$content .= "	</TR>\n";
		}
	}
		
	$content .= "	<TR>\n";
	$content .= "		<TD ALIGN='right' VALIGN='TOP' COLSPAN='1'>\n";
	$content .= "			<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0'>\n";		
	$content .= "				<TR>\n";
	
	if ($OnlineCfg[show_login_admin] == 1)
		{
		$content .= "					<TD ALIGN='right' 	VALIGN='BOTTOM'>\n";
		$content .= "						<A HREF='admin.php'>\n";
		$content .= "							<IMG SRC='images/blocks/JAG_Online_Admin.gif' BORDER='0' ALT='"._ADMIN_LOGIN."' WIDTH='9' HEIGHT='11'></A></TD>\n";
		}

	if (is_user($user) AND $OnlineCfg[show_login_logout] == 1)
		{
		$content .= "					<TD ALIGN='right' 	VALIGN='BOTTOM'>\n";
		$content .= "						<A HREF='modules.php?name=Your_Account&op=logout'>\n";
		$content .= "							<NOBR>("._LOGOUT.")</NOBR></A></TD>\n";
		}
		
	//$content .= "					<FORM NAME='CopyWrite' ACTION='http://nsd.jagamarog.com' METHOD='POST'>\n";
	//$content .= "					<INPUT TYPE='HIDDEN' NAME='ref_from_block' VALUE='JAG_Online_v1.31'>\n";
	//$content .= "					<TD ALIGN='RIGHT' 	VALIGN='BOTTOM'>\n";
	//$content .= "						<A STYLE='TEXT-DECORATION:NONE;' HREF='#' onClick='document.CopyWrite.submit()'>\n";
	//$content .= "							<NOBR><SPAN CLASS='gensmall'>&copy; JAG</SPAN></NOBR></A></TD>\n";
	//$content .= "					</FORM>\n";
	$content .= "				</TR>\n";
	$content .= "			</TABLE>\n";		
	$content .= "	</TR>\n";
	$content .= "</TABLE>\n";
?>
