Exemple #1
0
    }
} elseif (!empty($_POST['getComments'])) {
    $news = new news();
    $newsComments = new newsComments();
    // проверяем наличие новости
    if (!($arrNews = $news->getNews("id=" . secure::escQuoteData($_POST['getComments']) . " AND token='active'"))) {
        $arrErrors[] = ERROR_COMMENT_NEWS_NOT_FOUND;
    } else {
        // Order
        $order = 'DESC';
        if (!empty($_POST['order']) && ('ordDesc' == $_POST['order'] || 'ordAsc' == $_POST['order'])) {
            $order = 'ordDesc' == $_POST['order'] ? 'DESC' : 'ASC';
        }
        // проверяем, кто смотрит новость (у автора есть право удалять комментарии)
        $newsAuthor = !empty($_SESSION['sd_user']['data']['id']) && $_SESSION['sd_user']['data']['id'] == $arrNews['id_user'] ? true : false;
        $arrComments = $newsComments->getRecords("id_news=" . secure::escQuoteData($_POST['getComments']) . " AND token='active' ORDER BY datetime " . $order, false, false, false);
        $smarty->assignByRef('newsAuthor', $newsAuthor);
        $smarty->assignByRef('order', $order);
        $smarty->assignByRef('arrComments', $arrComments);
    }
    $smarty->assignByRef('errors', $arrErrors);
    $smarty->display('news.comments.list.tpl');
} elseif (isset($_POST['complaintComment'])) {
    if (!empty($_POST['complaintComment'])) {
        $news = new news();
        $newsComments = new newsComments();
        if ($arrComment = $newsComments->getRecord("id=" . secure::escQuoteData($_POST['complaintComment'] . " AND token='active'"))) {
            if ($arrNews = $news->getNews("id=" . secure::escQuoteData($arrComment['id_news'] . " AND token='active'"))) {
                if (!empty($arrNews['id_user'])) {
                    $user = new user();
                    $recipient = ($arrUser = $user->getUser("id=" . secure::escQuoteData($arrNews['id_user']) . " AND token='active'")) ? $arrUser['email'] : CONF_MAIL_ADMIN_EMAIL;
Exemple #2
0
    $articles = new articles();
    $arrArticle = $articles->getArticle("id IN (" . secure::escQuoteData($_POST['getArticleDetail']) . ")");
    $aComments = new articlesComments();
    $arrOrder = array('datetime' => 'DESC');
    $arrComments = $aComments->getRecords("id_article=" . secure::escQuoteData($_POST['getArticleDetail']) . " AND token='active'", $arrOrder, false, false);
    // адресная строка
    $smarty->assignByRef('qString', $_POST['strQuery']);
    $smarty->assignByRef('arrArticle', $arrArticle);
    $smarty->assignByRef('arrComments', $arrComments);
    $smarty->display('adm.manager.articles.detail.tpl');
} elseif (!empty($_POST['getNewsDetail']) && !empty($_POST['strQuery'])) {
    $news = new news();
    $arrNews = $news->getNews("id=" . secure::escQuoteData($_POST['getNewsDetail']));
    $newsComments = new newsComments();
    $arrOrder = array('datetime' => 'DESC');
    $arrComments = $newsComments->getRecords("id_news=" . secure::escQuoteData($_POST['getNewsDetail']) . " AND token='active'", $arrOrder, false, false);
    // адресная строка
    $smarty->assignByRef('qString', $_POST['strQuery']);
    $smarty->assignByRef('arrNews', $arrNews);
    $smarty->assignByRef('arrComments', $arrComments);
    $smarty->display('adm.manager.news.detail.tpl');
} elseif (!empty($_POST['getLogPaymentsFileDetail'])) {
    if (file_exists('core/data/log/' . $_POST['getLogPaymentsFileDetail'])) {
        echo ($fData = file_get_contents('core/data/log/' . $_POST['getLogPaymentsFileDetail'])) ? nl2br($fData) : ERROR_FILE_NOT_OPEN;
    } else {
        echo ERROR_FILE_NOT_FOUND;
    }
} elseif (!empty($_POST['getLogPaymentsDetail'])) {
    $payments = new payments();
    $arrData = $payments->dbGetLogPayment("id IN (" . secure::escQuoteData($_POST['getLogPaymentsDetail']) . ")");
    if (!empty($arrData) && is_array($arrData)) {