<?php
/* Nulled by Wizzywig */
/***********تعريب***********/
/**          saher        **/
/**  منتديات شباب وصبايا  **/
/**   www.shababtop.com   **/
/**  saher1986@live.com   **/
/***************************/

// ########################## INCLUDE BACK-END ###########################
include ("../config.php");
include ("./functions_send.php");

// ########################### GET POST DATA #############################
$userid 	= $_POST['userid'];
$status 	= $_POST['status'];
$message 	= $_POST['statusmessage'];

// ######################### START POST STATUS ###########################
if (!empty($_POST['status'])) {

	$sql = ("INSERT INTO arrowchat_status (userid,status) 
		VALUES ('".mysql_real_escape_string($userid)."','".mysql_real_escape_string(sanitize($status))."') 
		ON DUPLICATE KEY 
			UPDATE status = '".mysql_real_escape_string(sanitize($status))."'");
	mysql_query($sql);

	if ($status == 'offline') {
		$_SESSION['arrowchat_sessionvars']['buddylist'] = 0;
	}

	echo "1";
	exit(0);
}

// ####################### START POST STATUS MESSAGE #####################
if (!empty($_POST['statusmessage'])) {

	$sql = ("INSERT INTO arrowchat_status (userid,message) 
		VALUES ('".mysql_real_escape_string($userid)."','".mysql_real_escape_string(sanitize($message))."') 
		ON DUPLICATE KEY 
			UPDATE message = '".mysql_real_escape_string(sanitize($message))."'");
	mysql_query($sql);

	echo "1";
	exit(0);
}

?>