Ejemplo n.º 1
0
function module_comment_edit()
{
    global $global, $smarty;
    $obj = new comment();
    $obj->set_where('com_id = ' . $global['id']);
    $one = $obj->get_one();
    $one['channel'] = '';
    $one['title'] = '';
    $obj = new channel();
    $list = $obj->get_list();
    for ($i = 0; $i < count($list); $i++) {
        if ($list[$i]['cha_id'] == $one['com_channel_id']) {
            $one['channel'] = $list[$i]['cha_code'];
            $original = $list[$i]['cha_code'];
            if ($list[$i]['cha_original'] != 0) {
                for ($j = 0; $j < count($list); $j++) {
                    if ($list[$i]['cha_original'] == $list[$j]['cha_id']) {
                        $original = $list[$j]['cha_code'];
                    }
                }
            }
            if ($original == 'goods') {
                $table = 'goods';
            } else {
                $table = 'article';
            }
            $one['title'] = get_data($table, $one['com_page_id'], substr($table, 0, 3) . '_title');
        }
    }
    $smarty->assign('comment', $one);
}
Ejemplo n.º 2
0
        $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);
        } else {
            $condition = 1;
            if ($mid) {
                $condition = "moduleid={$mid}";
            }
            $lists = $do->get_ban_list($condition);