else if($action == 'modifyanswer') { $answer = $dsql->getone("SELECT answer.id, answer.uid, ask.dateline, ask.solvetime, ask.status, ask.expiredtime FROM `dede_askanswer` answer left join dede_ask ask on ask.id=answer.askid WHERE answer.id='$id'"); if($answer) { if($answer['uid'] != $uid) { showmsgs('unallowed_action', $backurl); }elseif($answer['status'] != 0) { showmsgs('question_solved', $backurl); }elseif($answer['expiredtime'] < $timestamp) { showmsgs('question_expired', $backurl); } } else { showmsgs('question_nonexistence'); } if(trim($content) == '') { showmsgs('post_answer_isnull'); } if(strlen($content) > 10000) { showmsgs('post_answer_toolong'); } if(strlen($brief) > 200) { showmsgs('post_brief_toolong', '-1'); } if($dsql->ExecuteNoneQuery("update dede_askanswer set content='$content', brief='$brief' where id='$id'")) { showmsgs('modifyanswer_success',$backurl); }else { showmsgs('modifyanswer_failed',$backurl); } } |