Đây là bộ code smile mà các bạn có thể đặt vào wap mà không cần upload. Ưu điểm là tùy chỉnh cao. Nhược điểm khó nhớ ![]()
Nếu ae có thích bộ smile khác thì nói mình up thêm.
Bước 1: Đầu tiên tạo một trang đặt tên là: Danh sách smile, thay /main.php?f=3386803 thành id trang Thư mục smile ở Bước 2.
[code]<div class="titles">Biểu tượng vui</div>
<div class="ititle" style="background-color: #F1F1F1;"><img src="/files/1049801/zicon.gif" valign="middle"> Danh sách smile</div>
{%macro smile(name,a)%}{%set dir=name|replace({"bb":'baby',"bd":'babysoldier',"bx":'bagiaxanh',"bo":'banhbao',"bg":'big',"bs":'binhsua',"bt":'bobototo',"bp":'bpopo',"ca":'caodo',"cu":'cua',"cb":'cuopbien',"cd":'chanhdau',"ck":'chikas',"ct":'chimcanhcut',"cw":'chowang',"dd":'daidai',"dt":'daotien',"dg":'daugau',"ex":'echxanh',"gn":'giotnuoc',"gc":'girlcatinh',"hs":'hamster',"hh":'hamsterhong',"hk":'hawki',"he":'heo',"hd":'heoden',"ht":'heodethuong',"hg":'heohong',"hn":'heotron',"hv":'heovang',"hy":'heoyoyo',"hc":'hocon',"ho":'hodo',"kv":'kienvang',"kk":'kiki',"kg":'kutegirl',"kt":'kytu',"kq":'khiquay',"ll":'laluot',"mo":'meemo',"me":'meo',"mc":'meocute',"md":'meoden',"ml":'meoluoi',"mt":'meotrang',"mx":'meoxinh',"mp":'mpopo',"nc":'namcom',"nl":'namlun',"nr":'naruto',"oi":'onion',"ot":'onionto',"on":'ongnho',"og":'ongto',"pd":'panda',"pt":'pandadethuong',"pm":'pandamap',"pa":'pandatron',"rb":'robot',"sr":'saurieng',"sp":'spopo',"td":'teddy',"th":'thanden',"to":'tho',"tt":'thodethuong',"tr":'thotrang',"uf":'ufo',"vc":'vitcon',"vx":'vitxanh',"yh":'yahoo',"ye":'yehoo',"yo":'yoyocici',"mm":'meme'})|raw%}<img src="/files/1049801/grays.gif" valign="middle"> <img src="/files/1049801/{{name}}1.gif" width="20px"/> <a href="/main.php?f=3386803&page=1&smile={{name}}&file={{a}}{%if api.r.get("se")=="mo"%}&se=mo&icon={{api.r.get("icon")}}{%endif%}">Smile {{dir|capitalize}}</a>({{name}})-{%if a > 10%}{%for i in 2..(a / 10 + (a % 10 > 0 ? 1 : 0))%} · <a href="/main.php?f=3386803&page={{i}}&smile={{name}}&file={{a}}{%if api.r.get("se")=="mo"%}&se=mo&icon={{api.r.get("icon")}}{%endif%}">[{{i}}]</a>{%endfor%}{%endif%}<br/>{%endmacro%}
{%import _self as thaian%}
<div class="smenu">
<div class="xlogin" style="text-align:left">
<img src="/files/1049801/grays.gif" valign="middle"> <img src="/files/1049801/Wink.png"/> <a href="/chat.php?chan=1777764&id=smiles"> Mặc định</a><br/>
{{thaian.smile("bb",54)}}
{{thaian.smile("bd",122)}}
{{thaian.smile("bx",57)}}
{{thaian.smile("bo",55)}}
{{thaian.smile("bg",26)}}
{{thaian.smile("bs",173)}}
{{thaian.smile("bt",97)}}
{{thaian.smile("bp",87)}}
{{thaian.smile("ca",39)}}
{{thaian.smile("cu",18)}}
{{thaian.smile("cb",42)}}
{{thaian.smile("cd",26)}}
{{thaian.smile("ck",116)}}
{{thaian.smile("ct",97)}}
{{thaian.smile("cw",122)}}
{{thaian.smile("dd",49)}}
{{thaian.smile("dt",10)}}
{{thaian.smile("dg",36)}}
{{thaian.smile("ex",86)}}
{{thaian.smile("gn",13)}}
{{thaian.smile("gc",70)}}
{{thaian.smile("hs",45)}}
{{thaian.smile("hh",27)}}
{{thaian.smile("hk",152)}}
{{thaian.smile("he",35)}}
{{thaian.smile("hd",110)}}
{{thaian.smile("ht",67)}}
{{thaian.smile("hg",35)}}
{{thaian.smile("hn",43)}}
{{thaian.smile("hv",15)}}
{{thaian.smile("hy",14)}}
{{thaian.smile("hc",48)}}
{{thaian.smile("ho",72)}}
{{thaian.smile("kv",25)}}
{{thaian.smile("kk",24)}}
{{thaian.smile("kg",39)}}
{{thaian.smile("kt",102)}}
{{thaian.smile("kq",30)}}
{{thaian.smile("ll",94)}}
{{thaian.smile("mm",49)}}
{{thaian.smile("mo",46)}}
{{thaian.smile("mc",19)}}
{{thaian.smile("md",22)}}
{{thaian.smile("ml",18)}}
{{thaian.smile("mt",28)}}
{{thaian.smile("mx",13)}}
{{thaian.smile("mp",46)}}
{{thaian.smile("nc",44)}}
{{thaian.smile("nl",178)}}
{{thaian.smile("nr",51)}}
{{thaian.smile("oi",139)}}
{{thaian.smile("ot",224)}}
{{thaian.smile("on",53)}}
{{thaian.smile("og",46)}}
{{thaian.smile("pd",192)}}
{{thaian.smile("pt",19)}}
{{thaian.smile("pm",26)}}
{{thaian.smile("pa",22)}}
{{thaian.smile("rb",47)}}
{{thaian.smile("sr",39)}}
{{thaian.smile("sp",54)}}
{{thaian.smile("td",21)}}
{{thaian.smile("th",25)}}
{{thaian.smile("to",54)}}
{{thaian.smile("tt",66)}}
{{thaian.smile("tr",60)}}
{{thaian.smile("uf",53)}}
{{thaian.smile("vc",29)}}
{{thaian.smile("vx",13)}}
{{thaian.smile("yh",115)}}
{{thaian.smile("ye",48)}}
{{thaian.smile("yo",211)}}
{{thaian.smile("mm",58)}}
</div></div>
<br/>
<div align="right" class="btng"><a href="/main.php" class="abtng">Trở ra</a></div>[/code]
Bước 2: Tạo trang tên là Thư mục smile để xem smile chi tiết. /main.php?f=3384985 là id trang Danh sách smile
[code]{%set smile=api.r.get("smile")|default("bb")%}
{%set dir=smile|replace({"bb":'baby',"bd":'babysoldier',"bx":'bagiaxanh',"bo":'banhbao',"bg":'big',"bs":'binhsua',"bt":'bobototo',"bp":'bpopo',"ca":'caodo',"cu":'cua',"cb":'cuopbien',"cd":'chanhdau',"ck":'chikas',"ct":'chimcanhcut',"cw":'chowang',"dd":'daidai',"dt":'daotien',"dg":'daugau',"ex":'echxanh',"gn":'giotnuoc',"gc":'girlcatinh',"hs":'hamster',"hh":'hamsterhong',"hk":'hawki',"he":'heo',"hd":'heoden',"ht":'heodethuong',"hg":'heohong',"hn":'heotron',"hv":'heovang',"hy":'heoyoyo',"hc":'hocon',"ho":'hodo',"kv":'kienvang',"kk":'kiki',"kg":'kutegirl',"kt":'kytu',"kq":'khiquay',"ll":'laluot',"mo":'meemo',"me":'meo',"mc":'meocute',"md":'meoden',"ml":'meoluoi',"mt":'meotrang',"mx":'meoxinh',"mp":'mpopo',"nc":'namcom',"nl":'namlun',"nr":'naruto',"oi":'onion',"ot":'onionto',"on":'ongnho',"og":'ongto',"pd":'panda',"pt":'pandadethuong',"pm":'pandamap',"pa":'pandatron',"rb":'robot',"sr":'saurieng',"sp":'spopo',"td":'teddy',"th":'thanden',"to":'tho',"tt":'thodethuong',"tr":'thotrang',"uf":'ufo',"vc":'vitcon',"vx":'vitxanh',"yh":'yahoo',"ye":'yehoo',"yo":'yoyocici',"mm":'meme'})|raw%}
<div class="titles">Lựa chọn smile sử dụng</div>
<div class="ititle" style="background-color: #F1F1F1;"><img src="/files/1049801/zicon.gif" valign="middle"> Smile {{dir|capitalize}} [<a href="main.php?f=3386803&se=mo&page={{api.r.get("page")}}&smile={{api.r.get("smile")}}&file={{api.r.get("file")}}">{%if api.r.get("se")=="mo"%}<span style="color:red;font-weight:bold">Chọn nhiều</span>{%else%}<span style="color:blue;font-weight:bold">Chọn nhiều</span>{%endif%}</a>]</div>
{%set file=api.r.get("file")|default("54")%}
{%set page=(api.r.get("page")|default("1"))-1%}
{%set end=(file / 10 + (file % 10 > 0 ? 1 : 0))%}
{%for i in (page*10)+1..((page*10)+10)%}
{%if i <= file%}.{{smile}}{{i}}. <a href="main.php?icon={%if api.r.get("se")=="mo"%}{{api.r.get("icon")}}{%endif%}.{{smile}}{{i}}."><img src="/files/1049801/{{smile}}{{i}}.gif" width="30px"/></a>{%if api.r.get("se")=="mo"%}-<a href="/main.php?f=3386803&se=mo&page={{api.r.get("page")|default("1")}}&smile={{smile}}&file={{file}}&icon={{api.r.get("icon")}}.{{smile}}{{i}}.">Chọn</a>{%endif%}<br/>{%endif%}
{%endfor%}
Trang: {%for i in 1..end%}
· {%if i==page%}[{{i}}]{%else%}<a href="/main.php?f=3386803&page={{i}}&smile={{smile}}&file={{file}}{%if api.r.get("se")=="mo"%}&se=mo&icon={{api.r.get("icon")}}{%endif%}">[{{i}}]</a>{%endif%}
{%endfor%}
{%if api.r.get("se")=="mo" and api.r.get("icon")|length >= 2%}<div class="btng"><a href="/main.php?icon={{api.r.get("icon")}}" class="abtng">Chọn smile xong</a></div>{%endif%}
<br/>
<div align="right" class="btng"><a href="/main.php?f=3384985{%if api.r.get("se")=="mo"%}&se=mo&icon={{api.r.get("icon")}}{%endif%}" class="abtng">Trở lại</a></div>[/code]
Bước 3: Ở ô 2 shoutbox history đặt code này
[code]{%macro dtext(s)%}{%set na=s|slice(0,2)%}{%set dir=na|replace({"bb":'baby',"bd":'babysoldier',"bx":'bagiaxanh',"bo":'banhbao',"bg":'big',"bs":'binhsua',"bt":'bobototo',"bp":'bpopo',"ca":'caodo',"cu":'cua',"cb":'cuopbien',"cd":'chanhdau',"ck":'chikas',"ct":'chimcanhcut',"cw":'chowang',"dd":'daidai',"dt":'daotien',"dg":'daugau',"ex":'echxanh',"gn":'giotnuoc',"gc":'girlcatinh',"hs":'hamster',"hh":'hamsterhong',"hk":'hawki',"he":'heo',"hd":'heoden',"ht":'heodethuong',"hg":'heohong',"hn":'heotron',"hv":'heovang',"hy":'heoyoyo',"hc":'hocon',"ho":'hodo',"kv":'kienvang',"kk":'kiki',"kg":'kutegirl',"kt":'kytu',"kq":'khiquay',"ll":'laluot',"mo":'meemo',"me":'meo',"mc":'meocute',"md":'meoden',"ml":'meoluoi',"mt":'meotrang',"mx":'meoxinh',"mp":'mpopo',"nc":'namcom',"nl":'namlun',"nr":'naruto',"oi":'onion',"ot":'onionto',"on":'ongnho',"og":'ongto',"pd":'panda',"pt":'pandadethuong',"pm":'pandamap',"pa":'pandatron',"rb":'robot',"sr":'saurieng',"sp":'spopo',"td":'teddy',"th":'thanden',"to":'tho',"tt":'thodethuong',"tr":'thotrang',"uf":'ufo',"vc":'vitcon',"vx":'vitxanh',"yh":'yahoo',"ye":'yehoo',"yo":'yoyocici',"mm":'meme'})|raw%}{{('<img src="/files/1049801/'~na~s|slice(2)~'.gif" alt=".'~na~'."/>')|raw}}{%endmacro%}{%macro icon(smsg)%}{%import _self as thaian%}{%set msg=smsg|split('.')%}{%set xmsg=''%}{%for i in 0..msg|length-1%}{%if msg[i] matches '/^([a-z][a-z]([0-9]|[0-9][0-9]|[0-9][0-9][0-9]))$/'%}{%set xmsg=xmsg~'[-xoasmile-]'~thaian.dtext(msg[i])|raw%}{%else%}{%set xmsg=xmsg~msg[i]~"."%}{%endif%}{%endfor%}{{lmsg|raw}}{%endmacro%}{%import _self as thaian%}
{{thaian.icon(message)|raw}}
[/code]
thay {{lmsg|raw}} thành {{xmsg|raw}}
Để tránh việc thành viên dùng nhiều smile thì ae có thể qui định số smile cho phép bằng việc thiết lập bộ đếm ![]()
Demo: http://cobethoitiet.wap.mu/mai ... obile
Nguồn: http://cobethoitiet
Edit: Đã loại bỏ đoạn Emoji
![[OFF]](/assets/images/off.gif)
![[ON]](/assets/images/on.gif)