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

// ########################## INCLUDE BACK-END ###########################
include_once ("data_core.php");

// ########################### INITILIZATION #############################
$response 	= array();
$messages 	= array();
$time 		= time();

// ########################### GET POST DATA #############################
$fetchid = $_POST['userid'];

// ###################### START USER DATA RECEIVE ########################
$sql = getUserDetails($fetchid);
$result = mysql_query($sql);

$chat = mysql_fetch_array($result);

if ((($time-$chat['lastactivity']) < $online_timeout) && $chat['status'] != 'invisible' && $chat['status'] != 'offline') {
	if ($chat['status'] != 'busy' && $chat['status'] != 'away') {
		$chat['status'] = 'available';
	}
} else {
	$chat['status'] = 'offline';
}

if ($chat['message'] == null) {
	$chat['message'] = $status[$chat['status']];
}

$link = getLink($chat['link'], $fetchid);
$avatar = getAvatar($chat['avatar'], $fetchid);

$response =  array('id' => $chat['userid'], 'n' => $chat['username; charset=utf-8'], 's' => $chat['status'], 'm' => $chat['message'], 'a' => $avatar, 'l' => $link);

header('Content-type: application/json; charset=utf-8');
echo json_encode($response);
exit;

?>