[code]{%macro mauchu(stext,start)%}{%if start==0%}{%set start="now"|date("s")%}{%endif%}{%set stext=stext|replace({"ờ":'ờ',"ừ":'ừ',"ò":'ò',"ề":'ề',"è":'è',"à":'à',"ù":'ù',"ầ":'ầ',"ì":'ì',"ạ":'ạ',"ị":'ị',"ệ":'ệ',"ọ":'ọ',"ế":'ế',"í":'í',"á":'á',"ấ":'ấ',"ố":'ố',"ẳ":'ẳ',"ủ":'ủ'})%}{%set mau=["f00","f30","f60","f90","fc0","ff0","cf0","9f0","6f0","3f0","0f0","0f3","0f6","0f9","0fc","0ff","0cf","09f","06f","03f","00f","30f","60f","90f","c0f","f0f","f0c","f09","f06","f03"]%} {%set l=stext|length%} {%set giatri=""%} {%for i in 0..l%} {%set giatri=giatri~'<font style="color:#'~mau[(i+start)%(mau|length)]~'">'~stext|slice(i,1)~'</font>'%} {%endfor%}{{giatri|raw}}{%endmacro%}{%import _self as thaian2009%}{{thaian2009.mauchu("now"|date("H:i:s d-m-Y"),0)}}[/code]
{{thaian2009.mauchu("Xin chào",0)}} là màu randdom
{{thaian2009.mauchu("Xin chào",9)}} thay 9 thành số bạn muốn
Nguồn: http://cobethoitiet.wap.mu
![[OFF]](/assets/images/off.gif)
![[ON]](/assets/images/on.gif)