模块内容投票 3.5

功能介绍

适用于内容模块的投票

支持投票统计

添加票数排行

添加模块内容投票设置

可以开启或关闭

支持游客/登录投票

支持设置开始投票时间和结束时间

添加投票统计导出excel

在模板中添加

{if dr_is_app('vote')}

<a href="javascript:dr_module_vote('{MOD_DIR}', '{$id}');" class="icon-btn">

  <i class="fa fa-bar-chart-o"></i>

  <div id="v_{$id}"> 投票 </div>

  <span class="badge badge-danger" id="dr_show_votes_{$id}"> {intval($votes)} </span>

</a>

<script>

// 投票

function dr_module_vote(dir, id) {

    $.get("/index.php?is_ajax=1&s=vote&c=home&dir=" + dir + "&id=" + id, function(data) {

        dr_cmf_tips(data.code, data.msg);

        if (data.code) {

            $('#v_' + id).html('已投票');

            $('#dr_show_votes_' + id).text(parseInt($('#dr_show_votes_' + id).text()) + 1);

        }

    }, 'json');

}

</script>

{/if}

投票排行调用:新闻模块

{table table=news num=10}

标题:{$t.title}

总票数:{$t.votes}

本日投票数:{$t.day_votes}

本周投票数:{$t.week_votes}

本月投票数:{$t.month_votes}

年投票数:{$t.year_votes}

{/table}

12{xunruicms_img_title}{xunruicms_img_title}