dalert($do->errmsg, '', ($need_captcha ? reload_captcha() : '') . ($need_question ? reload_question() : '')); } } else { $_tid = $tid; foreach ($do->fields as $v) { ${$v} = ''; } $tid = $_tid; $content = ''; $item = array(); } break; case 'edit': $itemid or message(); $do->itemid = $itemid; $item = $do->get_one(); if (!$item || $item['username'] != $_username) { message(); } $tid = $item['tid']; $T = $db->get_one("SELECT * FROM {$table} WHERE itemid={$tid}"); if ($MG['edit_limit'] < 0) { message($L['edit_refuse']); } if ($MG['edit_limit'] && $DT_TIME - $item['addtime'] > $MG['edit_limit'] * 86400) { message(lang($L['edit_limit'], array($MG['edit_limit']))); } if ($submit) { if ($do->pass($post)) { $need_check = $MOD['check_add'] == 2 ? $MG['check'] : $MOD['check_add']; $post['status'] = get_status($item['status'], $need_check);
$condition .= " AND addtime<={$totime}"; } } 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); include tpl('reply_edit', $module); } break; case 'delete': $itemid or msg('请选择回复'); isset($recycle) ? $do->recycle($itemid) : $do->delete($itemid); dmsg('删除成功', $forward); break; case 'recycle': $lists = $do->get_list('status=0' . $condition, $dorder[$order]); $menuid = 3; include tpl('reply', $module); break; case 'reject':
extract($R); } break; case 'reply_delete': $itemid && is_array($itemid) or message($L['my_choose_reply']); $content = ''; if ($reason == $L['my_manage_reason']) { $reason = ''; } $reason = dhtmlspecialchars($reason); $message = isset($message) ? 1 : 0; require MD_ROOT . '/reply.class.php'; $do = new reply(); foreach ($itemid as $rid) { $do->itemid = $rid; $R = $do->get_one(); if (!$R || $R['status'] != 3 || $R['gid'] != $gid) { continue; } $do->recycle($rid); if ($message) { send_message($R['username'], lang($L['manage_msg_title'], array($L['my_manage_type_reply'], get_intro($R['content'], 20), $L['my_manage_type_del'])), lang($L['manage_msg_content'], array($MOD['linkurl'] . 'goto.php?itemid=' . $R['itemid'], nl2br($reason), $_username))); } $title = addslashes(get_intro($R['content'], 50)); $db->query("INSERT INTO {$table}_manage (gid,rid,username,addtime,typeid,title,content,reason,message) VALUES ('{$gid}','{$rid}','{$_username}','{$DT_TIME}','1','{$title}','{$content}','{$reason}','{$message}')"); } dmsg($L['reply_success_del'], $forward); break; default: require MD_ROOT . '/manage.class.php'; $do = new manage();