<?php

/* DCMS Special
 * Дата последнего редактирования 23.01.2016
 * Модифицировал densnet
 */

foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'user') as $inc) {
    require_once "../../sys/inc/$inc.php";
}

if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' && !empty($_POST['row']) && !empty($_POST['publ']) && isset($user)) {

    $id = intval($_POST['row']);
    $pub = intval($_POST['publ']);
    $db->query("DELETE FROM `public_wall` WHERE `id` = '" . $id . "'");
    $db->query("DELETE FROM `public_like` WHERE `public` = '" . $id . "'");
    $db->query("DELETE FROM `public_wall_komm` WHERE `id_public` = '" . $pub . "'");
    echo json_encode(array('result' => 'del'));
} else {
    header("location:/");
}
