Thêm Random Quote vào Sidebar 1.2

Tạo Random Quote vào Sidibar

  1. H.B.T_Binh
    Demo : http://vgame.uni.me/

    4

    Công dụng :
    Như tiêu đề thôi :D

    Cách làm ;
    1. Tải file đính kèm về và up lên host theo đường dẫn /data.

    2. Vào AdminCP > Styles > Templates > PAGE_CONTAINER và thêm đoạn code này trước </head> :
    Mã:
    <script type="text/javascript" charset="utf-8">
    jQuery(document).ready(function($) {
        $.get('./data/RandomQuote/quotes.txt', function(data) {
            var quotes = data.split("\@");
            var idx = Math.floor(quotes.length * Math.random());
            $('.quotes').html(quotes[idx]);
        });
    });
    </script>
    3. Vào AdminCP > Styles > Templates > EXTRA.css thêm đoạn này vào :
    Mã:
    .bqstart {
        float: left;
        font-size: 300%;
        margin-right: 5px;
        height: 15px;
    }
     
    .bqend {
        float: right;
        font-size: 300%;
        margin-top: -20px;
        height: 15px;
    }
      .bq {
        font-family: "WCManoNegraBtaRegular", Arial, sans-serif;
        font-size: 180%;
        margin-right: 15px;
    }
    @font-face {
        font-family: 'WCManoNegraBtaRegular';
        src: url('./data/RandomQuote/WCManoNegraBta-webfont.eot');
        src: local('☺'), url('./data/RandomQuote/WCManoNegraBta-webfont.woff') format('woff'), url('./data/RandomQuote/WCManoNegraBta-webfont.ttf') format('truetype'), url('./data/RandomQuote/WCManoNegraBta-webfont.svg#webfonte6F4DwaZ') format('svg');
    }
    4. Vào AdminCP > Styles > Templates > Tạo 1 temp mới với tên random_quote và thêm đoạn code này :
    Mã:
    <div class="secondaryContent">
    <div class="bqstart">&#8220;</div>
    <div class="quotes bq" style="padding-top: 10px; padding-right: 5px;"></div>
    <div class="bqend">&#8221;</div>
    </div>
    Nếu bạn muốn có tiêu đề như demo thì thêm đoạn này :
    Mã:
    <div class="section">
    <div class="secondaryContent">
    <h3>Câu nói ngẫu nhiên</h3>
    <div class="bqstart">&#8220;</div>
    <div class="quotes bq" style="padding-top: 10px; padding-right: 5px;"></div>
    <div class="bqend">&#8221;</div>
    </div>
    </div>
    Thay đổi tiêu đề tùy ý

    5. Vào AdminCP > Styles > Templates > forum_list thêm đoạn này trước </xen:sidebar> hoặc ở bất kỳ đâu bạn muốn
    Mã:
    <xen:include template="random_quote" />
    Hướng dẫn thêm quote mới :
    Nếu như bạn muốn thêm quote mới , bạn vào data/RandomQuote/ , sửa file quotes.txt.
    Tất cả quotes khi viết đều phải có dấu '@' ở cuối trừ quotes cuối cùng
    Hung Vu, BeeSpeed and VXF like this.

Recent Updates

  1. Update
comments powered by Disqus