Bitrix Site Manager

GetVoteList

GetVoteList([
 GROUP_SYMBOLIC_NAME, [
 strSqlOrder]]
);

The function returns a selection of polls from the database.

Parameters

ParameterDescription
GROUP_SYMBOLIC_NAMESymbolic name of the channel. If omitted, the function returns a selection of polls of all channels.
strSqlOrder SQL string containing the sorting parameters. The default value is "ORDER BY C.C_SORT, C.ID, V.DATE_START desc".

Example

The following is the example of the file vote_list.php used in the public section.

<?
// Display a list of polls (archive)
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
if (CModule::IncludeModule("vote"))
    require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/include.php");
if (strlen($APPLICATION->GetTitle()) <= 0)
    $APPLICATION->SetTitle(GetMessage("VOTE_LIST_TITLE"));
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_after.php");
?><?
if (CModule::IncludeModule("vote"))
{ 
    $votes = GetVoteList(); // list of polls
    // a display template
    require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/php_interface/include/vote/list/default.php");
}
require_once ($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog.php");
?>