Hãy đăng ký thành viên để có thể dễ dàng trao đổi, giao lưu và chia sẻ về kiến thức đồ họa.
  1. Hãy đăng ký subscribe kênh Youtube mới của Việt Designer tại địa chỉ: Youtube.com/VietDesignerChannel để theo dõi các video về thiết kế đồ họa. Do trước đó kênh cũ bị Youtube quét không rõ lý do, trong thời gian chờ kháng cáo nếu các bạn thấy video trên diễn đàn bị die không xem được thì có thể vào kênh mới để tìm xem video sơ cua nhé.
    Loại bỏ thông báo

Hướng dẫn hiển thị Poll bao nhiêu người đã bình chọn trong Xenforo

Chủ đề thuộc danh mục 'Hướng dẫn - Thủ thuật Xenforo' được đăng bởi PCO, 16/2/16.

Lượt xem: 4,537

  1. PCO Thành viên cấp 2

    Mô tả:
    Hiển thị đã bình chọn, và bao nhiêu người đã bình chọn. Trước khi bỏ phiếu.

    Cài đặt:
    - Vào template poll_block_vote

    Tìm:
    Code:
    <ol class="pollOptions">
         <xen:foreach loop="$poll.responses" key="$pollResponseId" value="$response">
           <li class="pollOption"> <label> <xen:if is="{$poll.multiple}">
             <input type="checkbox" name="response_multiple[]" value="{$pollResponseId}" /> <xen:else />
             <input type="radio" name="response" value="{$pollResponseId}" /> </ xen: if>
             {$Response.response} </ label> </ li>
         </ Xen: foreach>
       </ol>
    Thay thế bằng:
    Code:
    <ol>
            <xen:foreach loop="$poll.responses" key="$pollResponseId" value="$response">
            <li class="pollOption"> 
                <ol class="pollResults">
            <li class="pollResult {xen:if $response.hasVoted, voted}">
                <xen:if is="{$response.hasVoted}">
                    <div class="votedIconCell" title="{xen:phrase your_vote}">*</div>
                <xen:else />
                    <div class="votedIconCell"></div>
                </xen:if>
                <h3 class="optionText" {xen:if $response.hasVoted, 'title="{xen:phrase your_vote}"'}>
                <xen:if is="{$poll.multiple}"><input type="checkbox" name="response_multiple[]" value="{$pollResponseId}" /><xen:else /><input type="radio" name="response" value="{$pollResponseId}" /></xen:if>
                    {$response.response}
                </h3>
                <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>
                <div class="count">
                    <xen:if is="{$poll.public_votes} AND {$response.response_vote_count}">
                        <a href="{xen:link threads/poll/results, $thread, 'poll_response_id={$pollResponseId}'}" class="concealed OverlayTrigger">{xen:phrase x_votes, 'count={xen:number $response.response_vote_count}'}</a>
                    <xen:else />
                        {xen:phrase x_votes, 'count={xen:number $response.response_vote_count}'}
                    </xen:if>
                </div>
                <div class="percentage">
                    <xen:if is="{$poll.voter_count}">
                        {xen:number {xen:calc "100 * {$response.response_vote_count} / {$poll.voter_count}"}, 1}%
                    <xen:else />
                        {xen:number 0, 1}%
                    </xen:if>
                </div>
            </li>
        </ol>
        </li>             
        </xen:foreach>
        </ol>
    Demo:

    sbQvpMa.png
    Tiêu chuẩn​

    KZQLWr8.png
    Phiên bản sửa đổi​
    Chúc các bạn thành công.

    Nguồn: VNXF.VN​

    ...
    Phạm Hữu Dư thích bài viết này
  2. BíĐỏ

    BíĐỏ Thành viên cấp 3

    Lâu quá rồi ko code ! Nhìn hoa cả mắt @@!
    Thanks , You're sharing ! =))z =))z

Ủng hộ diễn đàn