Hiển thị lượt vote công khai cho từng thanh kết quả của thăm dò ý kiến

PVS

Super Moderator
Thành viên BQT
Tham gia
28/02/2015
Bài viết
16,830
Được Like
12,692
Hiển thị lượt vote công khai cho từng thanh kết quả của thăm dò ý kiến

Bài viết này sẽ hướng dẫn các bạn cách hiển thị lượt vote công khai cho từng thanh kết quả của thăm dò ý kiến. Để áp dụng nhấp chuột vào phần bóng mờ của mỗi kết quả lựa chọn, chỉnh sửa template poll_block_result:
Tìm:
Mã:
<div class="barCell">
    <span class="barContainer">
        <xen:if is="{$response.response_vote_count}"><span class="bar" style="width: {xen:calc "100 * {$response.response_vote_count} / {$poll.voter_count}"}%"></span></xen:if>
    </span>
</div>

Thay bằng:
Mã:
<div class="barCell">
    <span class="barContainer">
        <xen:if is="{$poll.public_votes}">
            <a href="{xen:link threads/poll/results, $thread, 'poll_response_id={$pollResponseId}'}" class="concealed OverlayTrigger" title="{xen:phrase cta_click_to_view_who_voted_for_this_option}">
                <xen:if is="{$response.response_vote_count}"><span class="bar" style="width: {xen:calc "100 * {$response.response_vote_count} / {$poll.voter_count}"}%"></span></xen:if>
            </a>
        <xen:else />
            <xen:if is="{$response.response_vote_count}"><span class="bar" style="width: {xen:calc "100 * {$response.response_vote_count} / {$poll.voter_count}"}%"></span></xen:if>
        </xen:if>
    </span>
</div>

Thêm vào phần sau đây trong EXTRA.css:
Mã:
.pollResult .bar:hover {
background: @secondaryLight;
}

Và tạo 1 phrase mới có tên là: cta_click_to_view_who_voted_for_this_option - Phrase Text: Click to view who voted for this option

Kết quả:

poll-results.png

Chúc các bạn thành công.


Nguồn: xenforo.com​
 

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mobile: 0906081284

Zalo: 0988488096

Telegram: anhanhxf

Chỉ nhận web nội dung lành mạnh

Nhà Tài Trợ

Mút Xốp Không Gian
Mút Sofa Không Gian
Top Bottom