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


PHP Poll::totalVotes方法代码示例

本文整理汇总了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;
    }
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:view.php


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