Demo : http://vgame.uni.me/
Công dụng :
Như tiêu đề thôi
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> :
3. Vào AdminCP > Styles > Templates > EXTRA.css thêm đoạn này vào :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>
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ã:.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'); }
Nếu bạn muốn có tiêu đề như demo thì thêm đoạn này :Mã:<div class="secondaryContent"> <div class="bqstart">“</div> <div class="quotes bq" style="padding-top: 10px; padding-right: 5px;"></div> <div class="bqend">”</div> </div>
Thay đổi tiêu đề tùy ýMã:<div class="section"> <div class="secondaryContent"> <h3>Câu nói ngẫu nhiên</h3> <div class="bqstart">“</div> <div class="quotes bq" style="padding-top: 10px; padding-right: 5px;"></div> <div class="bqend">”</div> </div> </div>
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
Hướng dẫn thêm quote mới :Mã:<xen:include template="random_quote" />
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
Thêm Random Quote vào Sidebar 1.2
Tạo Random Quote vào Sidibar
Recent Updates
- Update 3/7/13
comments powered by Disqus