Example #1
0
    if ($forumpost->islocked()) {
        if ($xoopsUser) {
            if (!$xoopsUser->isAdmin($xoopsModule->mid()) || !is_moderator($forum, $xoopsUser->uid())) {
                $editerror = true;
            }
        } else {
            $editerror = true;
        }
    }
    if ($editerror) {
        redirect_header("viewtopic.php?topic_id={$topic_id}&post_id={$post_id}&order={$order}&viewmode={$viewmode}&pid={$pid}&forum={$forum}", 2, _MD_NORIGHTTOPOST);
        exit;
    }
    $nohtml = $forumpost->nohtml();
    $nosmiley = $forumpost->nosmiley();
    $icon = $forumpost->icon();
    $attachsig = $forumpost->attachsig();
    $topic_id = $forumpost->topic();
    if ($forumpost->istopic()) {
        $istopic = 1;
    } else {
        $istopic = 0;
    }
    $subject = $forumpost->subject("Edit");
    $message = $forumpost->text("Edit");
    $hidden = "";
    $myts =& MyTextSanitizer::getInstance();
    $viewmode = $myts->htmlspecialchars($viewmode);
    include 'include/forumform.inc.php';
    include XOOPS_ROOT_PATH . '/footer.php';
}
Example #2
0
if ($xoopsUser) {
    if (!$xoopsUser->isAdmin($xoopsModule->mid())) {
        if (!is_moderator($forum, $xoopsUser->uid())) {
            redirect_header("viewtopic.php?topic_id={$topic_id}&order={$order}&viewmode={$viewmode}&pid={$pid}&forum={$forum}", 2, _MD_DELNOTALLOWED);
            exit;
        }
    }
} else {
    redirect_header("viewtopic.php?topic_id={$topic_id}&order={$order}&viewmode={$viewmode}&pid={$pid}&forum={$forum}", 2, _MD_DELNOTALLOWED);
    exit;
}
include_once 'class/class.forumposts.php';
if (!empty($_POST['ok'])) {
    if (!empty($post_id)) {
        $post = new ForumPosts($post_id);
        $post->delete();
        sync($post->forum(), "forum");
        sync($post->topic(), "topic");
    }
    if ($post->istopic()) {
        redirect_header("viewforum.php?forum={$forum}", 2, _MD_POSTSDELETED);
        exit;
    } else {
        redirect_header("viewtopic.php?topic_id={$topic_id}&order={$order}&viewmode={$viewmode}&pid={$pid}&forum={$forum}", 2, _MD_POSTSDELETED);
        exit;
    }
} else {
    include XOOPS_ROOT_PATH . "/header.php";
    xoops_confirm(array('post_id' => $post_id, 'viewmode' => $viewmode, 'order' => $order, 'forum' => $forum, 'topic_id' => $topic_id, 'ok' => 1), 'delete.php', _MD_AREUSUREDEL);
}
include XOOPS_ROOT_PATH . '/footer.php';