Tiaxgame.Tk
Trang chủ | Register Wap4.Co Free
Đăng Nhập » Đăng Ký
ForumWap4 Việt NamShare Code
Lượt xem: 265

▼ [Modul]Share code function

* Emperor  (Member) [Off]
44 * 38
*   Cách đây 7 tháng
code có sử dụng nhiều nguồn
[code]
{# hiện bbcode #}
{% macro chat(acc,avt,sex,reg,exp,name,onl,t_now,idbv,cmttime) %}
{% set timenow = now|date('U') %}
{% if timenow-onl<500 %} {% set online %} <span class="text-success">•</span>{% endset%}
{% else %} {% set online %}<span class="text-danger">•</span>{% endset %}
{% endif %}
{% if reg=='9' %}
{% set chucvu='admin' %}
{% set name %} <span class="text-danger">{{name}}</span>{% endset %}
{% elseif reg<='8' and reg>'6' %}
{% set chucvu='smod' %}
{% set name %} <span class="text-primary">{{name}}</span>{% endset %}
{% elseif reg<='6' and reg>'4' %}
{% set chucvu='mod' %}
{% set name %} <span class="text-success">{{name}}</span>{% endset %}
{% elseif reg<='4' and reg>='1' %}
{% set chucvu='member' %}
{% set name %} {{name}}{% endset %}
{% elseif reg=='0' %}
{% set chucvu='band' %}

{% set name %} <span class="text-dark">{{name}}</span>{% endset %}
{% elseif reg=='10' %}
{% set name %} <span class="text-warning">{{name}}</span>{% endset %}
{% set chucvu='vip' %}
{% endif %}
{% if exp<='10' %}
{% set level='01' %}
{% elseif exp<='25' %}
{% set level='02' %}
{% elseif exp<='45' %}
{% set level='03' %}
{% elseif exp<='70' %}
{% set level='04' %}
{% elseif exp<='100' %}
{% set level='05' %}
{% elseif exp<='135' %}
{% set level='06' %}
{% elseif exp<='175' %}
{% set level='07' %}
{% elseif exp<='220' %}
{% set level='08' %}
{% elseif exp<='270' %}
{% set level='09' %}
{% elseif exp<='325' %}
{% set level='10' %}
{% elseif exp<='385' %}
{% set level='11' %}
{% elseif exp<='450' %}
{% set level='12' %}
{% elseif exp<='520' %}
{% set level='13' %}
{% elseif exp<='595' %}
{% set level='14' %}
{% elseif exp<='675' %}
{% set level='15' %}
{% elseif exp<='760' %}
{% set level='16' %}
{% elseif exp<='850' %}
{% set level='17' %}
{% elseif exp<='945' %}
{% set level='18' %}
{% elseif exp<='1045' %}
{% set level='19' %}
{% elseif exp<='1150' %}
{% set level='20' %}
{% elseif exp<='1260' %}
{% set level='21' %}
{% elseif exp<='1375' %}
{% set level='22' %}
{% elseif exp<='1495' %}
{% set level='23' %}
{% elseif exp<='1520' %}
{% set level='24' %}
{% elseif exp>'1520' %}
{% set level='25' %}
{% endif %}
{% if idbv!='' %}
{% set gmb24=get_data(idbv)[0].data|json_decode %}

<div class="list1">
<table cellpadding="0" cellspacing="0" width="100%" class="newsx"><tr><td width="13%"><img src="http://tienich.wap4.co/images/avatar_{{4}}.png" width="38" height="38" /></td><td width="auto" align="right"></td>
<td width="85%"><table cellpadding="0" cellspacing="0" width="100%"><td width="60%"> <img src="http://gocfriend.xtgem.com/images/girl.gif"> {{online}}<span class="#00F7FF"><b>BOT</b></span> <br> <b><img src="http://gocfriend.xtgem.com/images/chucvu/vip.png" width="70" height="26" ></b> </td><td width="40%" align="center"><img src="http://chuyengame.com/images/level/30.png"> <br>(1024 exp)</td></table> <table cellpadding="0" cellspacing="0" width="100%">
<td width="50%"><img src="http://viptruyen.mobie.in/images/icon/clock.png" alt="time"/>{% set date=cmttime+25200 %}{{date|date('H:m:s d/m/Y')}}
</td><td width="50%" align="right">
<div class="status">If you do they,they did you die =))</div></td> </tr></table> </td></tr></table><br> {{name}} đã bình luận tại <a href="/view/{{idbv}}.html">{{gmb24.name}}</a><br>

{% else %}
<div class="list1">
<table cellpadding="0" cellspacing="0" width="100%" class="newsx"><tr><td width="13%"><img src="http://tienich.wap4.co/images/avatar_{{avt}}.png" width="38" height="38" /></td><td width="auto" align="right"></td>
<td width="85%"><table cellpadding="0" cellspacing="0" width="100%"><td width="60%"> <img src="http://gocfriend.xtgem.com/images/{{sex}}.gif"> {{online}}<a href="/info/{{acc}}"><b>{{name}}</b></a> <br> <b><img src="http://gocfriend.xtgem.com/images/chucvu/{{chucvu}}.png" width="70" height="26" ></b> </td><td width="40%" align="center"><img src="http://chuyengame.com/images/level/{{level}}.png"> <br>({{exp}} exp)</td></table> <table cellpadding="0" cellspacing="0" width="100%">
<td width="50%"><img src="http://viptruyen.mobie.in/images/icon/clock.png" alt="time"/>{% set date=cmttime+25200 %}{{date|date('H:m:s d/m/Y')}}
</td><td width="50%" align="right">
<div class="status">{{stt}}</div></td> </tr></table><br>
</td></tr></table><br>
{% endif %}
{% endmacro %}
{% macro cmt(acc,avt,sex,reg,exp,name,onl,t_now,idbv,cmttime,i) %}

{% set timenow = now|date('U') %}
{% if timenow-onl<500 %} {% set online %} <span class="text-success">•</span>{% endset%}
{% else %} {% set online %}<span class="text-danger">•</span>{% endset %}
{% endif %}
{% if reg=='9' %}
{% set chucvu='admin' %}
{% set name %} <span class="text-danger">{{name}}</span>{% endset %}
{% elseif reg<='8' and reg>'6' %}
{% set chucvu='smod' %}
{% set name %} <span class="text-primary">{{name}}</span>{% endset %}
{% elseif reg<='6' and reg>'4' %}
{% set chucvu='mod' %}
{% set name %} <span class="text-success">{{name}}</span>{% endset %}
{% elseif reg<='4' and reg>='1' %}
{% set chucvu='member' %}
{% set name %} {{name}}{% endset %}
{% elseif reg=='0' %}
{% set chucvu='band' %}

{% set name %} <span class="text-dark">{{name}}</span>{% endset %}
{% elseif reg=='10' %}
{% set name %} <span class="text-warning">{{name}}</span>{% endset %}
{% set chucvu='vip' %}
{% endif %}
{% if exp<='10' %}
{% set level='01' %}
{% elseif exp<='25' %}
{% set level='02' %}
{% elseif exp<='45' %}
{% set level='03' %}
{% elseif exp<='70' %}
{% set level='04' %}
{% elseif exp<='100' %}
{% set level='05' %}
{% elseif exp<='135' %}
{% set level='06' %}
{% elseif exp<='175' %}
{% set level='07' %}
{% elseif exp<='220' %}
{% set level='08' %}
{% elseif exp<='270' %}
{% set level='09' %}
{% elseif exp<='325' %}
{% set level='10' %}
{% elseif exp<='385' %}
{% set level='11' %}
{% elseif exp<='450' %}
{% set level='12' %}
{% elseif exp<='520' %}
{% set level='13' %}
{% elseif exp<='595' %}
{% set level='14' %}
{% elseif exp<='675' %}
{% set level='15' %}
{% elseif exp<='760' %}
{% set level='16' %}
{% elseif exp<='850' %}
{% set level='17' %}
{% elseif exp<='945' %}
{% set level='18' %}
{% elseif exp<='1045' %}
{% set level='19' %}
{% elseif exp<='1150' %}
{% set level='20' %}
{% elseif exp<='1260' %}
{% set level='21' %}
{% elseif exp<='1375' %}
{% set level='22' %}
{% elseif exp<='1495' %}
{% set level='23' %}
{% elseif exp<='1520' %}
{% set level='24' %}
{% elseif exp>'1520' %}
{% set level='25' %}
{% endif %}
{% if t_now-onl<'500' %}
{% set online %} <span class="text-success">•</span>{% endset%} {% else %} {% set online %}<span class="text-danger">•</span>{% endset %}{% endif%}
<div class="list1"><div class="tip"><table cellpadding="0" cellspacing="0" width="100%"><tr><td width="75%"><span class="icon_dat"><img src="http://gocfriend.xtgem.com/images/clock.png" alt="time">{% set date=cmttime+25200%}{{date|date('d/m/Y H:m')}}</span></td><td align="right"><a href="#{{i}}" id="{{i}}">#{{i}}</a></td></tr></table></div>
<table cellpadding="0" cellspacing="0" width="100%" class="newsx"><tr><td width="13%"><img src="http://tienich.wap4.co/images/avatar_{{avt}}.png" width="38" height="38" /></td><td width="auto" align="right"></td>
<td width="85%"><table cellpadding="0" cellspacing="0" width="100%"><td width="60%"> <img src="http://gocfriend.xtgem.com/images/{{sex}}.gif"> {{online}}<a href="/info/{{acc}}"><b>{{name}}</b></a> <br> <b><img src="http://gocfriend.xtgem.com/images/chucvu/{{chucvu}}.png" width="70" height="26" ></b> </td><td width="40%" align="center"><img src="http://chuyengame.com/images/level/{{level}}.png"> <br>({{exp}} exp)</td></table> <table cellpadding="0" cellspacing="0" width="100%">
<td width="50%">
</td><td width="50%" align="right">
<div class="status">{{stt}}</div></td> </tr></table><br>
</td></tr></table><br>
{% endmacro %}
{% macro bb_sh(content) %}{# function bbcode bởi Bão #}{% if ' :' in content|lower %}{% set nd=content|split(' :') %}{% set content=nd[0] %}{% for i in 1..nd|length-1 %}{% set bb=nd[i]|split(': ')[0] %}{% if bb>1 %}{% set content=content~'<img src="http://bkit.jw.lt/data/smiles/'~bb~'.gif" title=" :'~bb~': " alt=" :'~bb~': "/>'~nd[i]|slice(bb|length+2,nd[i]|length) %}{% else %}{% set content=content~' :'~bb~''~nd[i]|slice(bb|length,nd[i]|length) %}{% endif %}{% endfor %}{% endif %} {% if '[video]' in content|lower %}{% set nd=content|split('[video]') %}{% set content=nd[0] %}{% for i in 1..nd|length-1 %}{% set bb=nd[i]|split('[/video]')[0] %}{% set content=content~' <div class="list-group-item" align="center"><video width="100%" onplay="cd()" poster=" /img/new-year.png" preload="metadata" controls=""autohide="true" name="media"><source src="'~bb~'" type="video/mp4"></source></video></div> '~nd[i]|slice(bb|length+6,nd[i]|length) %}{% endfor %}{% endif %}
{% if '[img]' in content|lower %}{% set nd=content|split('[img]') %}{% set content=nd[0] %}{% for i in 1..nd|length-1 %}{% set bb=nd[i]|split('[/img]')[0] %}{% set content=content~'<p class="center"><img src="'~bb~'" alt="tải game miễn phí" class="img-thumbnail" width="304" height="236"><br><a href="'~bb~'" title="'~title~' " class="center">Tải Về Máy</a></p>'~nd[i]|slice(bb|length+6,nd[i]|length) %}{% endfor %}{% endif %}{% if '[url=' in content|lower %}{% set nd=content|split('[url=') %}{% set content=nd[0] %}{% for i in 1..nd|length-1 %}{% set bb=nd[i]|split(']')[0] %}{% set content=content~'<a href="'~bb~'">'~nd[i]|slice(bb|length+1,nd[i]|length) %}{% endfor %}{% endif %}{% set content=content|replace({'[p]':"<p>", '[/p]':"</p>", '[p=center]':'<p class="center">','[p=right]':'<p class="right">', '':"<b>", '':"</b>", '':"<i>", '':"</i>", '':"<u>", '':"</u>",'[br]':'<br />','[url=':'<a href="','[/url]':'.</a>', '[hr]':"<hr />",'[span=':'<span style="','[/span]':'</span>','':'<span class="text-danger">','':'<span class="text-primary">','':'<span class="text-success">','':'</span>','':'</span>','':'</span>','[color=':'<span class="','[/color]':'</span>',
'
':'<br>',
'[br]':'<br>','[strong]':'<strong>','[/strong]':'</strong>','[h2]':'<h2>','[/h2]':'</h2>','[h3]':'<h3>','[/h3]':'</h3>','[h4]':'<h4>','[/h4]':'</h4>','
':'<textarea>','
':'</textarea>','[download]':'<div style="text-align: center; margin-bottom: 5px;"><b style="display: inline-block; padding: 10px; background: #33BE7B; color: #fff; font-size: 20px;"><strong>','[/download]':'</strong></b></div>','[quote]':'<div class="quote">','[/quote]':'</div>','[taixuong]':'<div class="file-attach"><div class="attach"><center><b>↓ Link Dự Phòng ↓</b></center></div>','[/taixuong]':'</div>'}) %}{{content|raw}}{% endmacro %}
{# xoá bbcode #}
{% macro bb_hi(content) %}{# function bbcode bởi BKIT #}{% set content=content|replace({'[img]':'<img src="','[url':'<a rel="nofollow" href','[/url]':'</a>','[taive':'<a href','[/taive]':'</a>','[tai]':'<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> ','[/img]':'">','[':"<", ']':'">'})|striptags %}{{content|raw}}{% endmacro %}
{# rewrite url #}
{% macro rwurl(url) %}{# function rewrite url bởi RoSino18k #}{% set url = url|lower|replace({'á':'a','à':'a','ả':'a','ã':'a','ạ':'a','ă':'a','ắ':'a','ằ':'a','ẳ':'a','ẵ':'a','ặ':'a','â':'a','ấ':'a','ầ':'a','ẩ':'a','ẫ':'a','ậ':'a','æ':'a','ä':'a','đ':'d','ð':'d','é':'e','è':'e','ẻ':'e','ẽ':'e','ẹ':'e','ê':'e','ế':'e','ề':'e','ể':'e','ễ':'e','ệ':'e','í':'i','ì':'i','ỉ':'i','ĩ':'i','ị':'i','ï':'i','î':'i','ó':'o','ò':'o','ỏ':'o','õ':'o','ọ':'o','ô':'o','ố':'o','ồ':'o','ổ':'o','ỗ':'o','ộ':'o','ơ':'o','ớ':'o','ờ':'o','ở':'o','ỡ':'o','ợ':'o','ö':'o','ø':'o','ú':'u','ù':'u','ủ':'u','ũ':'u','ụ':'u','ư':'u','ứ':'u','ừ':'u','ử':'u','ữ':'u','ự':'u','ü':'u','û':'u','ý':'y','ỳ':'y','ỷ':'y','ỵ':'y','ỹ':'y'}) %}{% set url = url|url_encode|replace({'%20':'-','%20%20':'-','%20%20%20':'-','%20%20%20%20':'-','%20%20%20%20%20':'-','~':'-','.':'-','..':'-','...':'-','....':'-','.....':'-'}) %}{% if '%' in url %}{% for pt in url|split('%') %}{% if pt matches '/^[A-Z0-9][A-Z0-9]/' %}{% set cut = '%'~pt[:2] %}{% set url = url|replace({(cut):'-'}) %}{% endif %}{% endfor %}{% endif %}{% set url = url|replace({'-----':'-','----':'-','---':'-','--':'-'})|trim('-') %}{{url}}{% endmacro %}
{# phân trang #}
{% macro paging(trang,p,max) %}{# function phân trang bởi Tiaxgame #} <div class="col-xs-12"><ul class="pagination pagination-sm">
{% if max > 1 %}{% set a='<a href="/'~trang~'/' %}{% if p>max %}{% set p=max %}a{% endif %}
{% if p>1 %}<li>{{a|raw}}{{p-1}}" data-ci-pagination-page="{{p-1}}" rel="prev">←</a></li>{% endif %}
{% if p>3 %}<li>{{a|raw}}1" data-ci-pagination-page="1" rel="start">1</a></li>{% endif %}
{% if p>4 %}{% endif %}
{% if p>2 %}<li>{{a|raw}}{{p-2}}" data-ci-pagination-page="{{p-2}}">{{p-2}}</a></li>{% endif %}
{% if p>1 %}<li><li>{{a|raw}}{{p-1}}" data-ci-pagination-page="{{p-1}}">{{p-1}}</a></li>{% endif %}
<li class="active"><span>{{p}}<span class="sr-only">(current)</span></span></li>
{% if p<max-1 %}<li>{{a|raw}}{{p+1}}" data-ci-pagination-page="{{p+1}}">{{p+1}}</a></li>{% endif %}
{% if p<max-2 %}<li>{{a|raw}}{{p+2}}" data-ci-pagination-page="{{p+2}}">{{p+2}}</a></li>{% endif %}
{% if p<max-3 %}{% endif %}
{% if p<max %}<li>{{a|raw}}{{max}}" data-ci-pagination-page="{{max}}">{{max}}</a></li>{% endif %}
{% if p<max %}<li>{{a|raw}}{{p+1}}" data-ci-pagination-page="{{p+1}}" rel="next">→</a></li>{% endif %}
{% endif %}</ul></div>{% endmacro %}[/code]
Edited by: Emperor
[Like=1] Pupy
* LeYTi  (Member) [Off]
10 * 4
*   Cách đây 6 tháng
Gửi từ Emperor:
code có sử dụng nhiều nguồn [code] {# hiện bbcode #} {% macro chat(acc,avt,sex,reg,exp,name,onl,t_now,idbv,cmttime) %} {% set timenow = now|date('U') %} {% if timenow-onl<500 %} {% s ...
Lỗi r bác êi
▼ Tổng số: 2
- Share:
BBCode:

Link: