本文整理汇总了PHP中CVote::UpdateVoteUserID方法的典型用法代码示例。如果您正苦于以下问题:PHP CVote::UpdateVoteUserID方法的具体用法?PHP CVote::UpdateVoteUserID怎么用?PHP CVote::UpdateVoteUserID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVote
的用法示例。
在下文中一共展示了CVote::UpdateVoteUserID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: KeepVoting
//.........这里部分代码省略.........
}
$USER_ALREADY_VOTE = "N";
}
unset($GLOBALS["VOTE_CACHE_VOTING"][$VOTE_ID]);
unset($GLOBALS["VOTE_CACHE"]["VOTE"][$VOTE_ID]);
$EVENT_ID = intval($DB->Insert("b_vote_event", $arFields, $err_mess . __LINE__));
if ($EVENT_ID > 0) {
$arSqlQuestionsID = array();
$arSqlAnswersID = array();
foreach ($arSqlAnswers as $qID => $arSqlAnswer) {
$arFields = array("EVENT_ID" => $EVENT_ID, "QUESTION_ID" => $qID);
$EVENT_QUESTION_ID = intval($DB->Insert("b_vote_event_question", $arFields, $err_mess . __LINE__));
if ($EVENT_QUESTION_ID > 0) {
$arSqlQuestionsID[] = $qID;
$arQuestions[$qID]["COUNTER"] = intval($arQuestions[$qID]["COUNTER"]) + 1;
foreach ($arSqlAnswer as $aID => $res) {
$res["EVENT_QUESTION_ID"] = $EVENT_QUESTION_ID;
if ($DB->Insert("b_vote_event_answer", $res, $err_mess . __LINE__)) {
$arSqlAnswersID[$aID] = $qID;
$arQuestions[$qID]["ANSWERS"][$aID]["COUNTER"] = intval($arQuestions[$qID]["ANSWERS"][$aID]["COUNTER"]) + 1;
}
}
}
}
if (empty($arSqlQuestionsID) || empty($arSqlAnswersID)) {
$DB->Query("DELETE FROM b_vote_event WHERE ID=" . $EVENT_ID, $arFields, $err_mess . __LINE__);
} else {
$arFields = array("COUNTER" => "COUNTER+1");
$DB->Update("b_vote", $arFields, "WHERE ID='" . $VOTE_ID . "'", $err_mess . __LINE__);
$arVote["COUNTER"] = intval($arVote["COUNTER"]) + 1;
$DB->Update("b_vote_question", $arFields, "WHERE ID in (" . implode(", ", $arSqlQuestionsID) . ")", $err_mess . __LINE__);
$DB->Update("b_vote_answer", $arFields, "WHERE ID in (" . implode(", ", array_keys($arSqlAnswersID)) . ")", $err_mess . __LINE__);
// increment user counter
CVote::UpdateVoteUserID($_SESSION["VOTE_USER_ID"]);
$GLOBALS["VOTING_OK"] = "Y";
$_SESSION["VOTE_ARRAY"][] = $VOTE_ID;
if ($UNIQUE_TYPE & 8) {
$_SESSION["VOTE"]["VOTES"][$VOTE_ID] = $EVENT_ID;
}
// statistic module
if (CModule::IncludeModule("statistic")) {
$event3 = $arVote["EVENT3"];
if (!empty($event3)) {
$event3 = "http://" . $_SERVER["HTTP_HOST"] . "/bitrix/admin/vote_user_results.php?EVENT_ID=" . $EVENT_ID . "&lang=" . LANGUAGE_ID;
}
CStatEvent::AddCurrent($arVote["EVENT1"], $arVote["EVENT2"], $event3);
}
// notification
if (!!$arVote["AUTHOR_ID"] && $arVote["AUTHOR_ID"] != $USER->GetID()) {
if (empty($arVote["TITLE"])) {
$arQuestion = reset($arQuestions);
$arVote["TITLE"] = $arQuestion["QUESTION"];
}
if ($arVote["NOTIFY"] == "I" && CModule::IncludeModule("im")) {
$arVote["TOTAL_URL"] = "";
if (!empty($arVote["URL"])) {
if (defined('SITE_SERVER_NAME')) {
$arVote["TOTAL_URL"] = SITE_SERVER_NAME;
}
$arVote["TOTAL_URL"] = !empty($arVote["TOTAL_URL"]) ? $arVote["TOTAL_URL"] : COption::GetOptionString("main", "server_name", $GLOBALS["SERVER_NAME"]);
if (!empty($arVote["TOTAL_URL"])) {
$arVote["TOTAL_URL"] = (CMain::IsHTTPS() ? "https" : "http") . "://" . $arVote["TOTAL_URL"] . $arVote["URL"];
}
}
// send notification
$gender = $USER->getParam("PERSONAL_GENDER") == "F" ? "_F" : "";