コード例 #1
0
ファイル: deal.php プロジェクト: jechiy/xiu-cms
function reply_comment()
{
    global $smarty, $lang;
    $com_id = post('com_id');
    $com_reply = post('com_reply');
    $obj = new comment();
    $obj->set_value('com_reply', $com_reply);
    $obj->set_where("com_id = {$com_id}");
    $obj->edit();
    $smarty->assign('info_text', '回复评论成功');
    $smarty->assign('link_text', $lang['return_list']);
    $smarty->assign('link_href', url(array('channel' => 'service', 'mod' => 'comment_sheet')));
}
コード例 #2
0
ファイル: comment.inc.php プロジェクト: hcd2008/destoon
        $condition .= " AND item_mid='{$mid}'";
    }
    if ($ip) {
        $condition .= " AND ip='{$ip}'";
    }
    if ($star) {
        $condition .= " AND star='{$star}'";
    }
}
switch ($action) {
    case 'edit':
        $itemid or msg();
        $do->itemid = $itemid;
        if ($submit) {
            if ($do->pass($post)) {
                $do->edit($post);
                dmsg('修改成功', $forward);
            } else {
                msg($do->errmsg);
            }
        } else {
            extract($do->get_one());
            $addtime = timetodate($addtime);
            $replytime = $replytime ? timetodate($replytime, 6) : '';
            include tpl('comment_edit', $module);
        }
        break;
    case 'ban':
        if ($submit) {
            $do->ban_update($post);
            dmsg('更新成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=ban&page=' . $page);
コード例 #3
0
ファイル: comment.php プロジェクト: logtcn/gelbooru-fork
    $row = $result->fetch_assoc();
    $user_id = $row['id'];
    $anon_id = $row['id'];
}
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $id = $db->real_escape_string($_GET['id']);
    if (isset($_GET['s']) && $_GET['s'] == "edit" && isset($_POST['comment'])) {
        if ($_POST['conf'] != 1) {
            header("Location:index.php?page=post&s=view&id={$id}");
            exit;
        }
        if ($user == "Anonymous") {
            header("Location:index.php?page=post&s=view&id={$id}");
            exit;
        }
        $comment->edit($id, $_POST['comment'], $user);
        $cache = new cache();
        $cache->destroy_page_cache("cache/" . $id);
        $cache->create_page_cache("cache/" . $id);
        header("Location:index.php?page=post&s=view&id={$id}");
    }
    if (isset($_GET['s']) && $_GET['s'] == "save" && isset($_POST['comment'])) {
        if ($_POST['conf'] != 1) {
            header("Location:index.php?page=post&s=view&id={$id}");
            exit;
        }
        if (!$anon_comment && $user_nolog == "Anonymous") {
            header('Location: index.php?page=account&s=home');
            exit;
        }
        if (isset($_POST['post_anonymous']) || $_POST['post_anonymous'] == true) {
コード例 #4
0
ファイル: edit_comment.php プロジェクト: seans888/APC-CPO
    require 'subclasses/comment.php';
    $dbh_comment = new comment();
    $object_name = 'dbh_comment';
    require 'components/create_form_data.php';
    extract($arr_form_data);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button', $_SERVER['PHP_SELF']);
        redirect("listview_comment.php?{$query_string}");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button', $_SERVER['PHP_SELF']);
        $message .= $dbh_comment->sanitize($arr_form_data)->lst_error;
        extract($arr_form_data);
        if ($dbh_comment->check_uniqueness_for_editing($arr_form_data)->is_unique) {
            //Good, no duplicate in database
        } else {
            $message = "Record already exists with the same primary identifiers!";
        }
        if ($message == "") {
            $dbh_comment->edit($arr_form_data);
            redirect("listview_comment.php?{$query_string}");
        }
    }
}
require 'subclasses/comment_html.php';
$html = new comment_html();
$html->draw_header('Edit Comment', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('id');
$html->draw_controls('edit');
$html->draw_footer();