code bố trí danh sách tin nhắn
TWIG
{% set a,u=api.u.get(api.user_id),api.u.get(api.r.get('p')) %} <div class="wf mb mt"> <table class="{% if a.uid!=nick_uid %}not-{% endif %}VD" cellpadding="0" cellspacing="0"> <tbody> <tr valign="top"> {% if a.uid!=nick_uid %}<td width="10px"><a href="user_info.php?uid={{nick_uid}}"><img src="{{api.u.get(nick_uid).profilephotourl(2,true)}}" class="ava ava2 ml"></a></td><td width="10px"><div class="by-VD"></div></td>{% endif %} <td width="761"><div class="pm_message">{{message|replace({'<br/>':'<br/>'})|raw}} <br><i>{{message_date|date("H:i, d/m/Y")|replace({(now|date("d/m/Y")):'Hôm nay'})}}</i> </div></td> {% if a.uid==nick_uid %} <td width="10px"><div class="by-VD"></div></td>{% endif %} </tr> </tbody> </table></div>
CSS
CSS
.not-VD .pm_message { background-image:-webkit-linear-gradient(bottom, #f2f2f2, #fff); background-color:#eff2f5; padding:4px; border-radius:10px; border:1px solid rgba(0, 0, 0, .18); border-bottom-color:rgba(0, 0, 0, .29); -webkit-border-radius:10px; text-align:left; float:left; } .VD .pm_message { background-image:-webkit-linear-gradient(bottom, #c7defe, #e7f1fe); background-color:#C7DEFE; padding:4px; border-radius:10px; border:1px solid rgba(0, 0, 0, .18); border-bottom-color:rgba(0, 0, 0, .29); -webkit-border-radius:10px; text-align:left; float:right; } .VD .by-VD { border:8px solid transparent; border-left-color:#c7defe; height:0; margin-top:7px; } .not-VD .by-VD { border:8px solid transparent; border-right-color:rgba(204, 204, 204, 1); height:0; margin-top:7px; } .ml { margin-left:5px; } .mr { margin-right:5px; } .mt { margin-top:5px; } .mb { margin-bottom:5px; } .cl:before,.wf:after,#wrapper:after,#wrapper:before,.bottom-head:after { content:''; line-height:0; clear:both; display:table; } img.ava { padding:4px; background-color:#fff; border:1px solid #ccc; border:1px solid rgba(0,0,0,0.2); -webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1); -moz-box-shadow:0 1px 3px rgba(0,0,0,0.1); box-shadow:0 1px 3px rgba(0,0,0,0.1); -webkit-border-radius:4px; -moz-border-radius:4px; border-radius:4px; } img.ava2 { -webkit-border-radius:50%; -moz-border-radius:50%; border-radius:50%; }
Nguồn b0ysh0ck_hn