/*
  * ----------------------
  *   Instance Class
  * ----------------------
  */
 $obj = new AjaxRequest();
 $_POST['name'] = _Function::spaces(trim($_POST['name']));
 $_POST['location'] = _Function::spaces(trim(strip_tags($_POST['location'])));
 $_POST['website'] = _Function::spaces(trim($_POST['website']));
 $url = $_POST['website'];
 $_POST['website'] = trim($_POST['website'], '/');
 $_POST['bio'] = _Function::checkTextDb2(trim($_POST['bio']));
 $admin = $obj->getSettings();
 //<-------- * Cutting chain if greater than post_length  * --------->
 if (strlen(utf8_decode($_POST['bio'])) > $admin->post_length) {
     $_POST['bio'] = _Function::cropStringLimit($_POST['bio'], $admin->post_length);
 }
 if ($_POST['name'] == '' || strlen(utf8_decode($_POST['name'])) < 2 || strlen(utf8_decode($_POST['name'])) > 20) {
     echo json_encode(array('response' => $_SESSION['LANG']['full_name_error']));
 } else {
     if (!filter_var($url, FILTER_VALIDATE_URL) && $url != '') {
         echo json_encode(array('response' => $_SESSION['LANG']['url_not_valid']));
     } else {
         $_POST['name'] = htmlspecialchars($_POST['name']);
         $res = $obj->updateProfile();
         if ($res == 1) {
             echo json_encode(array('response' => 'true', 'save_success' => $_SESSION['LANG']['saved_successfully']));
         } else {
             echo json_encode(array('response' => $_SESSION['LANG']['error']));
         }
     }
 include_once '../../application/functions.php';
 include_once '../../application/DataConfig.php';
 /*
  * ----------------------
  *   Instance Class
  * ----------------------
  */
 $obj = new AjaxRequest();
 $_POST['id_reply'] = is_numeric($_POST['id_reply']) ? $_POST['id_reply'] : die;
 $_POST['token_reply'] = trim($_POST['token_reply']);
 $_POST['reply_post'] = trim(_Function::checkTextDb($_POST['reply_post']));
 $infoUser = $obj->infoUserLive($_SESSION['authenticated']);
 $admin = $obj->getSettings();
 //<-------- *  * --------->
 if (strlen(utf8_decode($_POST['reply_post'])) > $admin->post_length) {
     $_POST['reply_post'] = _Function::cropStringLimit($_POST['reply_post'], $admin->post_length);
 }
 if (strlen(utf8_decode($_POST['reply_post'])) == 0) {
     return false;
 }
 if ($infoUser->type_account == 1) {
     $verified = ' <i class="fa fa-check-circle verified verified-min showTooltip" title="' . $_SESSION["LANG"]["verified"] . '" data-toggle="tooltip" data-placement="right"></i>';
 } else {
     $verified = null;
 }
 /*
  * ----------------------
  *   Send Reply
  * ----------------------
  */
 $query = $obj->sendReply();