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

▼ Bản tin nhắn code rút gọn data

* Ivoryss  (Member) [ON]
27 * 32
*   Cách đây 1 tháng
{%import "function.twig" as k%}
{%use "_blocks"%}

{%set uri=get_uri_segments()%}
{%set log=k.login()|trim%}
{%set nick=get_data("user_"~uri[2])[0].data|json_decode%}

{{block("beta")}}
{%if log%}
{%if get_data_count("list_reply")==0%}
{%set save=save_data("list_reply",[]|json_encode)%}
{%endif%}

{#%if get_data_count("mail")==0%}
{%set save=save_data("mail",[]|json_encode)%}
{%endif%#}



{#%if uri.1=="delete" and uri[2] and nick.nick and get_get("del-mess") and get_data("list_reply")[0].data|json_decode["data_"~get_get("del-mess")].dem%}

<script>document.location=""</script>

{{k.delarray("list_reply","data_"~get_get("del-mess"))}}
{{k.add("user_"~log,"nd_"~uri.2,null)}}

{{k.add("user_"~log,"data_"~log~"_"~uri.2,get_get("del-mess")|replace({(get_get("del-mess")):""}))}}

{%endif%#}

{#{k.add("user_"~log,"data_"~log~"_"~uri.2,"v")}#}

{%if uri.1=="new-message" and nick.nickk and log!=nick.nickk%}

{%set dem=k.get("list_reply","dem")|trim+1%}
{%set txtndung=get_post("reply")%}
{{k.add("user_"~log,"vnn",nick.nickk~" @")}}
{{k.add("user_"~log,"vnns",nick.nickk)}}
<ol
class="breadcrumb"><li><a
href="/beta">GROUP BETA</a></li><li><a
href="/message">Hộp thư</a></li><li
class="active">{{nick.nick}}</li></ol><div
style="display:none"><ul
class="pagination"></ul></div>

<form method="post">

{%if txtndung!="" and get_post("sendmessage")!=""%}
<script>document.location="?post"</script>
{{k.add("list_reply","dem",k.get("list_reply","dem")|trim+1)}}
{{k.add("user_"~uri.2,"open_mail_"~log,"yes")}}

{{k.add("user_"~log,"action_ib","yes")}}
{{k.add("user_"~uri.2,"list_message",k.get("user_"~uri.2,"list_message")|replace({(get_data("user_"~uri.2)[0].data|json_decode.vnn):""})~ log ~" @")}}

{{k.add("user_"~log,"list_message",k.get("user_"~log,"list_message")|replace({(get_data("user_"~log)[0].data|json_decode.vnn):""})~ uri.2 ~" @")}}

{{k.add("user_"~log,"times_"~uri.2,"now"|date("U"))}}
{{k.add("user_"~uri.2,"times_"~log,"now"|date("U"))}}

{{k.add("user_"~uri.2,"nd_"~log,txtndung)}}
{{k.add("user_"~log,"nd_"~uri.2,txtndung)}}

{{k.add("user_"~log,"data_"~log~"_"~uri.2,dem~" @" ~k.get("user_"~log,"data_"~log~"_"~uri.2))}}

{{k.add("user_"~uri.2,"data_"~uri.2~"_"~log,dem~" @" ~k.get("user_"~uri.2,"data_"~uri.2~"_"~log))}}
{{k.add("list_reply","data_"~dem,{"nick":log,"id":nickk.id,"nd":get_post("reply"),"time":"now"|date("U"),"act":"yes","show":"yes","login":log,"url":uri|join("/"),"dem":dem})}}
{%endif%}


{%if k.get("user_"~log,"cmt")>="100000000000000" or k.get("user_"~log,"level")=="admin" or k.get("user_"~log,"open_mail_"~uri.2)=="yes"%}
<div
class="input-group"><textarea name="reply" class="form-control" id="contentArea"></textarea>
<span
class="input-group-addon" id="showsmile" data-toggle="collapse" data-target="#emoticons">
<span
class="fa fa-smile-o"></span>
</span>
</div></p><p
style="text-align:center;"><button
name="sendmessage" type="submit" value="submit" class="btn btn-success" style="width:100%;"><span
class="glyphicon glyphicon-send"></span></button></p><p
style="color:red;text-align:center;"><b> </b></p></form></div>
{%else%}
Bạn phải đủ 10 bài viết mới có thể. Nhắn tin
{%endif%}

{% set data=k.get("user_"~log,"data_"~log~"_"~uri.2)|split("@")%}
{% set total=data|length-1 %}
{% set page_max=total//10 %}
{% if total//10 != total/10 %}
{% set page_max=total//10+1 %}
{% endif %}
{% set p=url[2]|default(1) %}

{% if p matches '/[a-zA-z]|%/' or p<1 %}
{% set p=1 %}
{% endif %}
{% if p>page_max %}
{% set p=page_max %}
{% endif %}

<ul
class="list-group" id="listgroup">

{%for ii in data|slice(st,10)|slice(0,total)%}

{%set txt=get_data("list_reply")[0].data|json_decode["data_"~ii|trim]%}{%set txt1=get_data("user_"~txt.nick)[0].data|json_decode%}
<li
class="list-group-item" id="{{txt.id}}">
<span
class="pull-left" style="padding:5px">
<a
href="/beta/user/{{txt1.nickk}}">
<img
class="thumbnail" height="30px" src="{{txt1.icon}}" />
</a></span><h5 class="list-group-item-heading box_oxx_{{txt1.level}}">
<img
style="vertical-align:middle;" src="http://my.teamobi.com/beta/app/images/img/online.png" border="0" />
<a
href="/beta/user/{{txt1.nick}}">{{txt1.nick}}</a>
<small><i><span
class="timeago"> {{k.ago(txt.time)}}</span>
<a
href="/message/delete/{{txt1.nickk}}?del-mess={{txt.dem}}" onclick="return confirm('Chấp nhận xóa ?')">
<span
class="glyphicon glyphicon-remove">X</span></a>
</i></small></h5><p
class="list-group-item-text">{{txt.nd}}</p></li>

{%endfor%}
</ul>



{%else%}


<ol
class="breadcrumb"><li><a
href="/beta">GROUP BETA</a></li><li
class="active">Hộp tin</li></ol><small><ul
class="nav nav-tabs" style="margin-top:0;"><li
class="active"><a
href="/message">Hộp thư</a></li><li><a
href="/group">Phòng chat</a></li></ul></small><div><ul
class="pagination"></ul></div><div
class="list-group">
{% set data=k.get("user_"~log~get_get("s"),"list_message")|split("@") %}
{% set total=data|length-1 %}
{% set page_max=total//10 %}
{% if total//10 != total/10 %}
{% set page_max=total//10+1 %}
{% endif %}
{% set p=url[2]|default(1) %}

{% if p matches '/[a-zA-z]|%/' or p<1 %}
{% set p=1 %}
{% endif %}
{% if p>page_max %}
{% set p=page_max %}
{% endif %}


{%for i in data|slice(st,10)|slice(0,total)%}
{%set text=get_data("user_"~i|trim)[0].data|json_decode%}{%set nicked=get_data("user_"~i|trim)[0].data|json_decode%}
<a
href="/message/new-message/{{nicked.nickk}}" class="list-group-item ">
<span
class="pull-right">
<img
class="thumbnail" height="30px" src="{{nicked.icon}}"/>
</span><h4 class="list-group-item-heading box_oxx_{{nicked.level}}">
<img
style="vertical-align:middle;" src="http://my.teamobi.com/beta/app/images/img/{%if nicked.on< ("now"|date("U")<600)%}offline{%else%}online{%endif%}.png" border="0" />
{{nicked.nick}}</h4><p
class="list-group-item-text"><img
src="http://my.teamobi.com/beta/app/images/reply.png" /> {{nicked["nd_"~log]}}</p>
<small><i><span
class="timeago">{{k.ago(nicked["times_"~log])}}</span></i></small>
</a>

{%endfor%}
{%endif%}

{%endif%}

{{block("foot")}}
▼ Tổng số: 1
- Share:
BBCode:

Link: