コード例 #1
0
ファイル: index.php プロジェクト: hinablue/TextCube
function DEFENSIO_RevertItems()
{
    global $blogid, $pluginMenuURL, $pluginURL, $pluginSelfParam, $blog, $user, $blogURL, $defaultURL, $hostURL, $service, $skinSetting, $configVal, $suri;
    $id = !empty($_GET['id']) ? $_GET['id'] : '';
    $comment_TYPE = !empty($_GET['t']) ? $_GET['t'] : '';
    if ($comment_TYPE != "T") {
        $comment_TYPE = "C";
    }
    if ($id) {
        $isAjaxRequest = checkAjaxRequest();
        $r = -1;
        if ($comment_TYPE == 'C') {
            if (revertCommentInOwner($blogid, $id) === true) {
                $r = 0;
            }
        } else {
            if (revertTrackback($blogid, $id) !== true) {
                $r = 0;
            }
        }
        defensio_make_to_ham($comment_TYPE, $id);
        defensio_clear_comments($comment_TYPE);
        $isAjaxRequest ? respond::ResultPage($r) : header("Location: " . $_SERVER['HTTP_REFERER']);
    } else {
        $targets = explode('~*_)', $_POST['targets']);
        $id = array();
        foreach ($targets as $t) {
            if ($t == '') {
                continue;
            }
            array_push($id, $t);
            $comment_TYPE == 'C' ? revertCommentInOwner($blogid, $t, false) : revertTrackback($blogid, $t);
        }
        if (count($id) > 0) {
            defensio_make_to_ham($comment_TYPE, implode(',', $id));
        }
        defensio_clear_comments($comment_TYPE);
        respond::ResultPage(0);
    }
    exit;
}
コード例 #2
0
ファイル: index.php プロジェクト: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
requireModel("blog.response.remote");
if (isset($suri['id'])) {
    $isAjaxRequest = checkAjaxRequest();
    if (revertTrackback($blogid, $suri['id']) !== true) {
        $isAjaxRequest ? Respond::ResultPage(0) : header("Location: " . $_SERVER['HTTP_REFERER']);
    } else {
        $isAjaxRequest ? Respond::ResultPage(-1) : header("Location: " . $_SERVER['HTTP_REFERER']);
    }
} else {
    $targets = explode('~*_)', $_POST['targets']);
    foreach ($targets as $target) {
        if ($target == '') {
            continue;
        }
        revertTrackback($blogid, $target);
    }
    Respond::ResultPage(0);
}