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


PHP CVote::GetActiveVoteId方法代码示例

本文整理汇总了PHP中CVote::GetActiveVoteId方法的典型用法代码示例。如果您正苦于以下问题:PHP CVote::GetActiveVoteId方法的具体用法?PHP CVote::GetActiveVoteId怎么用?PHP CVote::GetActiveVoteId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CVote的用法示例。


在下文中一共展示了CVote::GetActiveVoteId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetAdminListViewHTML

 function GetAdminListViewHTML($arUserField, $arHtmlControl)
 {
     $return = ' ';
     $return_url = $GLOBALS["APPLICATION"]->GetCurPageParam("", array("admin_history", "mode", "table_id"));
     if ($arHtmlControl["VALUE"] > 0) {
         $db_res = CVote::GetByIDEx($arHtmlControl["VALUE"]);
         if ($db_res && ($arVote = $db_res->GetNext())) {
             if ($arVote["LAMP"] == "yellow") {
                 $arVote["LAMP"] = $arVote["ID"] == CVote::GetActiveVoteId($arVote["CHANNEL_ID"]) ? "green" : "red";
             }
             $return = "<div class=\"lamp-red\" title=\"" . ($arVote["ACTIVE"] != 'Y' ? GetMessage("VOTE_NOT_ACTIVE") : GetMessage("VOTE_ACTIVE_RED_LAMP")) . "\"  style=\"display:inline-block;\"></div>";
             if ($arVote["LAMP"] == "green") {
                 $return = "<div class=\"lamp-green\" title=\"" . GetMessage("VOTE_LAMP_ACTIVE") . "\" style=\"display:inline-block;\"></div>";
             }
             $return .= " [<a href='vote_edit.php?lang=" . LANGUAGE_ID . "&ID=" . $arVote["ID"] . "&return_url=" . urlencode($return_url) . "' title='" . GetMessage("VOTE_EDIT_TITLE") . "'>" . $arVote["ID"] . "</a>] ";
             $return .= $arVote["TITLE"] . (!empty($arVote["DESCRIPTION"]) ? " <i>(" . $arVote["DESCRIPTION"] . ")</i>" : "");
             if ($arVote["COUNTER"] > 0) {
                 $return .= GetMessage("VOTE_VOTES") . " <a href=\"vote_user_votes.php?lang=" . LANGUAGE_ID . "&find_vote_id=" . $arVote["ID"] . "&find_valid=Y&set_filter=Y\">" . $arVote["COUNTER"] . "</a>";
             }
         }
     }
     return $return;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:23,代码来源:usertypevote.php

示例2: Fetch

 public static function Fetch()
 {
     if ($res = parent::Fetch()) {
         if ($res["LAMP"] == "yellow" && !empty($res["CHANNEL_ID"])) {
             $res["LAMP"] = $res["ID"] == CVote::GetActiveVoteId($res["CHANNEL_ID"]) ? "green" : "red";
         }
     }
     return $res;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:9,代码来源:vote.php

示例3: CAdminResult

/********************************************************************
				/ACTIONS
********************************************************************/
/********************************************************************
				Data
********************************************************************/
$rsData = CVote::GetList($by, $order, $arFilter, $is_filtered);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("VOTE_PAGES")));
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "s_id", "default" => true), array("id" => "LAMP", "content" => GetMessage("VOTE_LAMP"), "sort" => "s_lamp", "default" => true), array("id" => "DATE_START", "content" => GetMessage("VOTE_DATE_START"), "sort" => "s_date_start", "default" => true), array("id" => "DATE_END", "content" => GetMessage("VOTE_DATE_END"), "sort" => "s_date_end", "default" => true), array("id" => "CHANNEL_ID", "content" => GetMessage("VOTE_CHANNEL"), "sort" => "s_channel", "default" => true), array("id" => "ACTIVE", "content" => GetMessage("VOTE_ACTIVE"), "sort" => "s_active", "default" => true), array("id" => "C_SORT", "content" => GetMessage("VOTE_C_SORT"), "sort" => "s_c_sort", "default" => true), array("id" => "TITLE", "content" => GetMessage("VOTE_TITLE"), "sort" => "s_title", "default" => true), array("id" => "QUESTIONS", "content" => GetMessage("VOTE_QUESTIONS"), "default" => true), array("id" => "COUNTER", "content" => GetMessage("VOTE_COUNTER"), "sort" => "s_counter", "default" => true)));
while ($arRes = $rsData->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_ID, $arRes);
    $row->AddViewField("ID", "<a href='vote_edit.php?lang=" . LANGUAGE_ID . "&ID={$f_ID}' title='" . GetMessage("VOTE_EDIT_TITLE") . "'>{$f_ID}</a>");
    if ($f_LAMP == "yellow") {
        $arRes["LAMP"] = $f_LAMP = $f_ID == CVote::GetActiveVoteId($arRes["CHANNEL_ID"]) ? "green" : "red";
    }
    $lamp = $f_LAMP;
    if ($f_LAMP == "green") {
        $lamp = "<div class=\"lamp-green\" title=\"" . GetMessage("VOTE_LAMP_ACTIVE") . "\"></div>";
    } elseif ($f_LAMP == "red") {
        $lamp = "<div class=\"lamp-red\" title=\"" . ($f_ACTIVE != 'Y' ? GetMessage("VOTE_NOT_ACTIVE") : GetMessage("VOTE_ACTIVE_RED_LAMP")) . "\"></div>";
    }
    $row->AddViewField("LAMP", $lamp);
    $row->AddSelectField("CHANNEL_ID", $arChannelsTitle);
    $row->AddCheckField("ACTIVE");
    $row->AddInputField("C_SORT");
    $row->AddInputField("TITLE", array());
    $row->AddViewField("QUESTIONS", "<a title=\"" . GetMessage("VOTE_QUESTIONS_TITLE") . "\" href=\"vote_question_list.php?lang=" . LANGUAGE_ID . "&VOTE_ID={$f_ID}\">{$f_QUESTIONS}</a>&nbsp;[<a title=\"" . GetMessage("VOTE_QUESTIONS_ADD") . "\" href=\"vote_question_edit.php?lang=" . LANGUAGE_ID . "&VOTE_ID={$f_ID}\">+</a>]");
    $row->AddViewField("COUNTER", "<a href=\"vote_user_votes.php?lang=" . LANGUAGE_ID . "&find_vote_id={$f_ID}&find_valid=Y&set_filter=Y\" title=\"" . GetMessage("VOTE_VOTES_TITLE") . "\">{$f_COUNTER}</a>");
    $arActions = array();
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:vote_list.php


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