User_IsAuthorization()) { if ($oTopic=$oEngine->Topic_GetTopicById($idTopic)) { if ($oTopic->getType()=='question') { //голосовал уже или нет $oUserCurrent=$oEngine->User_GetUserCurrent(); if (!($oTopicQuestionVote=$oEngine->Topic_GetTopicQuestionVote($oTopic->getId(),$oUserCurrent->getId()))) { $aAnswer=$oTopic->getQuestionAnswers(); if (isset($aAnswer[$idAnswer]) or $idAnswer==-1) { if ($idAnswer==-1) { $oTopic->setQuestionCountVoteAbstain($oTopic->getQuestionCountVoteAbstain()+1); } else { $oTopic->increaseQuestionAnswerVote($idAnswer); } $oTopic->setQuestionCountVote($oTopic->getQuestionCountVote()+1); $oTopicQuestionVote=new TopicEntity_TopicQuestionVote(); $oTopicQuestionVote->setTopicId($oTopic->getId()); $oTopicQuestionVote->setVoterId($oUserCurrent->getId()); $oTopicQuestionVote->setAnswer($idAnswer); if ($oEngine->Topic_AddTopicQuestionVote($oTopicQuestionVote) and $oEngine->Topic_updateTopic($oTopic)) { $bStateError=false; $sMsgTitle='Поздравляем!'; $sMsg='Ваш голос учтен.'; foreach ($oTopic->getQuestionAnswers() as $key => $aAnswer) { $sTextResult.='
Request method: =$_SERVER['REQUEST_METHOD'] . "\n"?> Loader used: =$JsHttpRequest->LOADER . "\n"?> _REQUEST: =print_r($_REQUEST, 1)?>