Bitrix Site Manager

GetCurrentVote

GetCurrentVote(
 GROUP_SYMBOLIC_NAME, [
 lid, [
 access]]
)

The function returns the ID of the current vote in the channel.

Parameters

ParameterDescription
GROUP_SYMBOLIC_NAMESymbolic name of the channel.
lid Site ID. By default, the current site ID is used.
access Minimum allowed permission of the current user to access a vote. The following values allowed:
  • 0 - access denied;
  • 1 - view results;
  • 2 - vote.
The default value is 1. This means that the function GetCurrentVote returns the ID of the current vote if only the current user is allowed to view the poll results.
  • Example

    The following example displays a form with the current vote of the specified channel.

    <?
    function ShowCurrentVote($GROUP_SYMBOLIC_NAME, $lid=LANG)
    {
        $CURRENT_VOTE_ID = GetCurrentVote($GROUP_SYMBOLIC_NAME, $lid, 2);
        if (intval($CURRENT_VOTE_ID)>0)
            ShowVote($CURRENT_VOTE_ID);
    }
    ?>