本文整理汇总了PHP中Poll::totalVotes方法的典型用法代码示例。如果您正苦于以下问题:PHP Poll::totalVotes方法的具体用法?PHP Poll::totalVotes怎么用?PHP Poll::totalVotes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poll
的用法示例。
在下文中一共展示了Poll::totalVotes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
echo "\n\t\t<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "';</script>\n\t";
exit;
}
$viewPollResultsCID = $consoleObj->findConsoleIDByName("View Poll Results");
$consoleObj->select($viewPollResultsCID);
$pollInfo = $pollObj->get_info_filtered();
$member->select($_SESSION['btUsername']);
$blnMemberVoted = false;
if ($member->authorizeLogin($_SESSION['btPassword']) && $pollObj->hasVoted($member->get_info("member_id"))) {
$blnMemberVoted = true;
}
if ($member->authorizeLogin($_SESSION['btPassword'])) {
$memberInfo = $member->get_info_filtered();
}
$blnShowResults = false;
if ($pollObj->totalVotes() > 0 && ($member->hasAccess($consoleObj) || $pollInfo['member_id'] == $memberInfo['member_id'] || $pollInfo['resultvisibility'] == "open" || $pollInfo['resultvisibility'] == "votedonly" && $blnMemberVoted || $pollInfo['resultvisibility'] == "pollend" && $pollInfo['pollend'] < time())) {
$blnShowResults = true;
}
if ($blnShowResults) {
$arrResults = array("['Option', 'Votes']");
$arrOptions = array();
$x = 0;
$countTotalVotes = 0;
foreach ($pollObj->getPollResults() as $pollOptionID => $votes) {
$pollObj->objPollOption->select($pollOptionID);
$pollOptionInfo = $pollObj->objPollOption->get_info_filtered();
$arrResults[] = "['" . $pollOptionInfo['optionvalue'] . "', " . $votes . "]";
$arrOptions[] = $x . ": { color: '" . $pollOptionInfo['color'] . "' }";
$x++;
$countTotalVotes += $votes;
}