<?php
/*if($_SERVER['PHP_AUTH_USER'] != "snake86" || $_SERVER['PHP_AUTH_PW'] != "wiejj35")
{
header("WWW-Authenticate: Basic realm="De Snake86 SignChat is momenteel offline, we proberen zo snel mogelijk bij je terug te zijn..."");
die("<h1>401 Authentication Required</h1>");
exit;
}*/
$parsetime = array_sum(explode(" ", microtime()));
if(ereg("^www.", $_SERVER['HTTP_HOST']))
header("Location: http://".substr($_SERVER['HTTP_HOST'], 4).$_SERVER['REQUEST_URI']);
ob_start();
error_reporting(E_ALL);
function venster($titel = "", $tekst = "")
{
echo "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!---
COPYRIGHT © 2006 SNAKE86
ALLE RECHTEN VOORBEHOUDEN
ALL RIGHTS RESERVED
GEBRUIK DEZE SOURCE NIET VOOR ANDERE WEBSITES
DON'T USE THIS SOURCE FOR OTHER WEBSITES
-->
<html>
<head>
<title>JVM</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body >
<br />
<br />
".boven($titel, "left")."
".$tekst."
".onder()."
</body>
</html>";
}
function boven($titel = null, $align = "center", $width = 700)
{
$return = ' <table cellpadding="0" cellspacing="0" width="'.$width.'" align="center">
<tr>
<td height="5" width="6"><img class="content_up_left" src="img/space.gif" width="6" height="5" alt="" /></td>
<td height="5" class="content_up"></td>
<td height="5" width="6"><img class="content_up_right" src="img/space.gif" width="6" height="5" alt="" /></td>
</tr>
<tr>
<td class="content_left"></td>
<td class="content_bg">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>';
if(!empty($titel))
{
$return.=' <table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="5" height="18"><img class="titlebar_left" src="img/space.gif" width="5" height="18" alt="" /></td>
<td height="18" class="titlebar">
<b>'.$titel.'</b>
</td>
<td width="5" height="18"><img class="titlebar_right" src="img/space.gif" width="5" height="18" alt="" /></td>
</tr>
</table>';
}
$return .=' </td>
</tr>
<tr>
<td class="content" style="text-align: '.$align.'">';
return $return;
}
function onder()
{
return '
</td>
</tr>
</table>
</td>
<td class="content_right"></td>
</tr>
<tr>
<td height="4" width="6"><img class="content_under_left" src="img/space.gif" width="6" height="4" alt="" /></td>
<td height="4" class="content_under"></td>
<td height="4" width="6"><img class="content_under_right" src="img/space.gif" width="6" height="4" alt="" /></td>
</tr>
</table>
';
}
@mysql_connect("localhost", "nikd", "lol") or die(venster("Fout!", "Er is een fout opgetreden bij het verbinden naar de server!<Br /><Br />".mysql_error()));
@mysql_select_db("nikd") or die(venster("Fout!", "Er is een fout opgetreden bij het verbinden naar de database!"));
$lays = array("blauw", "groen");
$sql = sql_query("SELECT reden AS lay FROM status WHERE id='6' LIMIT 1");
$lay = mysql_result($sql, 0, "lay");
$lay = (in_array(strtolower($lay), $lays)) ? strtolower($lay) : $lays[0];
$querys = 0;
function sql_query($query)
{
global $querys;
$result = @mysql_query($query) or die(venster("Fout!", "Er is een fout opgetreden! Probeer het later nog eens!<br /><br /><i>".mysql_error()."</i>"));
$querys++;
return $result;
}
function error($error)
{
return '<span style="color: #DD0000; font-weight: bold;"><ul><li>'.$error.'</li></ul></span>';
}
function ok($ok)
{
return '<span style="font-weight: bold;"><ul><li>'.$ok.'</li></ul></span>';
}
$wm = false;
$user = false;
$vip = false;
$naam = null;
$gebrnaam = null;
if(isset($_COOKIE['id']) && isset($_COOKIE['wachtwoord']) )
{
$sql = sql_query("SELECT gebruikersnaam, status FROM gebruikers WHERE id='".addslashes($_COOKIE['id'])."' AND wachtwoord='".addslashes($_COOKIE['wachtwoord'])."'");
$num = mysql_num_rows($sql);
if($num > 0)
{
$rij = mysql_fetch_assoc($sql);
if($rij['status'] == 3)
$wm = true;
if($rij['status'] >= 2)
$user = true;
if($rij['status'] >= 1)
$vip = true;
$gebrnaam = $rij['gebruikersnaam'];
}
}
function check_user($wat = null)
{
global $gebrnaam, $vip, $wm, $user;
if((!$user && !$vip && !$wm) || !$gebrnaam || !$wat)
return false;
else if($wat == "gebruikersnaam")
return $gebrnaam;
else if($wat == "status" && $wm)
return "webmaster";
else if($wat == null && $user)
return true;
else if($wat == "id")
return $_COOKIE['id'];
return false;
}
function status($status)
{
if($status == 1)
return "VIP";
else if($status == 2)
return "Admin";
else if($status == 3)
return "Webmaster";
else
return "Normaal";
}
function check_vip()
{
global $vip;
if($vip)
return true;
return false;
}
$pagina = addslashes($_SERVER['REQUEST_URI']);
$ip = addslashes($_SERVER['REMOTE_ADDR']);
$sql = sql_query("SELECT id, reden, ban_tot FROM `waarschuwingen` WHERE `ip`='".addslashes($_SERVER['REMOTE_ADDR'])."' LIMIT 1");
$num = mysql_num_rows($sql);
if($num > 0)
{
$rij = mysql_fetch_assoc($sql);
if(($rij['ban_tot'] == 0 || $rij['ban_tot'] > time()) && !$wm)
{
$reden = (!empty($rij['reden'])) ? "Met de volgende reden:<br />".error($rij['reden']) : null;
$tot = ($rij['ban_tot'] > 0 && $rij['ban_tot'] > time()) ? " tot ".date("d/m/Y H:i", $rij['ban_tot']) : null;
die(venster("Verbannen".$tot."!", error("Je bent verbannen van de SignChat".$tot."!").$reden));
}
else
{
sql_query("DELETE FROM waarschuwingen WHERE id='".addslashes($rij['id'])."' ");
}
}
function kleur($gebr, $status = null, $verbannen = 0)
{
$return = null;
if(!empty($verbannen) && $verbannen >= 1)
{
$return = '<span style="color: #DD0000;"><s>'.htmlentities(ucfirst(strtolower($gebr))).'</s></span>';
}
else if(!empty($status) && $status >= 1)
{
if($status == 3)
$return = '<span style="color: #E9F0FF;">'.htmlentities(ucfirst(strtolower($gebr))).'</span>';
else if($status == 2)
$return = '<span style="color: #FFD800;">'.htmlentities(ucfirst(strtolower($gebr))).'</span>';
else if($status == 1)
$return = '<span style="color: #2337EE;">'.htmlentities(ucfirst(strtolower($gebr))).'</span>';
}
else
{
$return = htmlentities(ucfirst(strtolower($gebr)));
}
return '<a href="http://mastaline.com/?pagina=club/profiel&member='.htmlentities(ucfirst(strtolower($gebr))).'">'.$return.'</a>';
}
$online = sql_query("SELECT * FROM `status` WHERE `id`='1'");
$online = mysql_fetch_assoc($online);
if(!$user && $online['status'] == 0)
die(venster("SignChat gesloten!", nl2br(error(emoticons(stripslashes($online['reden']))))));
function verkort($tekst, $tot)
{
if(strlen($tekst) > $tot)
return substr($tekst, 0, $tot)."...";
else
return $tekst;
}
function js($tekst)
{
$tekst = str_replace("", "", $tekst);
$tekst = str_replace("'", "\'", $tekst);
$tekst = str_replace("\r\n", "\\n", $tekst);
return $tekst;
}
function addsslashes($string)
{
$string = str_replace("_",'\_', $string);
$string = str_replace("%",'\%', $string);
return $string;
}
function is_ip($ip)
{
if(!eregi("[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}", $ip))
return false;
else
return true;
}
function datum($format, $timestamp)
{
if($timestamp == 0)
return "n.v.t";
else
return date($format, $timestamp);
}
function relink($pagina = "./")
{
echo "<br />";
echo 'Je wordt over drie seconden <a href="'.htmlentities($pagina).'" accesskey="c"><b>doorgestuurd</b></a>!';
echo '<meta http-equiv="refresh" content="3; URL='.$pagina.'" />';
}
if(!isset($_COOKIE['gebruikersnaam']))
setcookie("gebruikersnaam", "Gast", time() + 365 * 86400);
$naam = (isset($_COOKIE['gebruikersnaam'])) ? $_COOKIE['gebruikersnaam'] : "Gast";
$naam = ($user || $vip) ? check_user('gebruikersnaam') : $naam;
$aantal = sql_query("SELECT `naam` FROM `online` WHERE `ip`='".$ip."'");
$aantal = mysql_num_rows($aantal);
if($_SERVER['REMOTE_ADDR'] == "62.131.159.145")
$aantal = -1;
if($user)
sql_query("UPDATE gebruikers SET laatst=UNIX_TIMESTAMP() WHERE gebruikersnaam='".addslashes($naam)."'");
if($aantal > 0)
sql_query("UPDATE `online` SET `naam`='".addslashes($naam)."', `time`='".time()."', `ip`='".$ip."', `pagina`='".$pagina."' WHERE `ip`='".$ip."'");
else if($aantal == 0)
sql_query("INSERT `online` SET `naam`='".addslashes($naam)."', `time`='".time()."', `ip`='".$ip."', `pagina`='".$pagina."'");
$interval = time()-(60*5);
sql_query("DELETE FROM `online` WHERE `time` < '".$interval."'");
?>