当前位置: 首页>>代码示例>>PHP>>正文


PHP CVote::UpdateVoteUserID方法代码示例

本文整理汇总了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" : "";
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:67,代码来源:vote.php


注:本文中的CVote::UpdateVoteUserID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。