Share shoutbox ego nhóm nội dung

6 bài đăng
Tags:
12.09.2015 / 21:34
thaian2009
Bài đăng: 709
Member

Shoutbox này nó gom comment của 1 người thành 1 và hiện time ở comment cuối. Có phân chia nam nữ.

Demo: http://shoutboxgenerator.wap.m ... 10080

Ô 1 shoutbox

[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%}{%macro noidungx(user,msg,next,date,dk)%}{%import _self as thaian2009%}

<div style="clear:both;margin-top:3px"></div><div class="gt{{user.sex}}">{%if dk==1%}

<table width="100%%" cellpadding="0" cellspacing="1" {%if user.sex==2%}style="float:right"{%endif%}><tbody>

<tr valign="top">{%if user.sex==1%}<td width="35px"><img src="{{user.profilephotourl(5,true)}}" class="xhinh"/></td><td>{%if api.user_id!=user.uid%}<script type="text/javascript">

frend=online_users.search(escape('{{user.uid}}'));if(frend < 0){document.write('<img src="/files/1049801/schop.gif"/>')}else{document.write('<img src="/files/1049801/xchop.gif"/>')};</script>{%endif%}<a href="user_info.php?uid={{user.uid}}" class="level{{user.level}}">{{user.nick}}</a><br/>{{thaian2009.mauchu("Xu: "~user.plus,0)}}{%if api.user_id!=user.uid%}<br/><a href="pm.php?id=new&to={{user.uid}}">[PM]</a>{%endif%}</td>{%else%}<td><a href="user_info.php?uid={{user.uid}}" class="level{{user.level}}">{{user.nick}}</a>{%if api.user_id!=user.uid%}<script type="text/javascript">

frend=online_users.search(escape('{{user.uid}}'));if(frend < 0){document.write('<img src="/files/1049801/schop.gif"/>')}else{document.write('<img src="/files/1049801/xchop.gif"/>')};</script>{%endif%}<br/>{{thaian2009.mauchu("Xu: "~user.plus,0)}}{%if api.user_id!=user.uid%}<br/><a href="pm.php?id=new&to={{user.uid}}">[PM]</a>{%endif%}</td><td width="35px"><img src="{{user.profilephotourl(5,true)}}" class="xhinh"/></td>{%endif%}</tr></tbody></table>

{%endif%}

<div class="nhom"><span class="noidungz nd{{user.sex}}"><i class="arrow ar{{user.sex}}"></i><div class="xkhunga"></div><div class="xkhungb"></div><div class="xkhungc"></div><div class="xkhungchus">{{msg|replace({"[imgs]":'<center><img class="swat" style="border:1px solid#ddd;padding:1px" src="',"[/imgs]":'"/></center>',"[center]":'<center>',"[/center]":'</center>',"[tim]":'<b style="background-image:url(/files/1049801/saoroi.gif);color:#F0F; font-size:22px;font-style: italic;">',"[/tim]":'</b>',"wapego":'',"waplux":''})|raw}}{%if user.uid!=next%}<br/><span style="color:gray">({%set ngay=date|date("d-m-Y H:i:s")%}{%set b="now"|date("d-m-Y H:i:s")%}{% set c = date( b ).diff(date( ngay ))%}{%if c.h==0 and c.i==0 and c.s<=3%}Vừa xong.{%elseif c.h==0 and c.i==0%}{{c.s}} giây trước.{%elseif c.h==0 and c.i>=0%}{{c.i}} phút trước.{%else%}{{c.h}} giờ trước.{%endif%})</span>{%endif%}</div><div class="xkhungc"></div><div class="xkhungb"></div><div class="xkhunga"></div></span></div><div style="clear:both"></div></div>

{%endmacro%}{%import _self as thaian2009%}

<div class="center"><font color="#0044aa"> <a href="/main.php?f=3384985"><font color="#0099FF">Smiles</font></a> | <a href="main.php?f=3325896"><font color="#FF0099">BB Codes</font></a> | <a href="main.php?[ses]&a=[time]#chatne"><font color="#ff0000">Làm Mới</font></a> | <a href="/main.php?f=3379196&style=Mobile"><font color="#ff0000">ADM</font></a></font></div>

<div class="center" style="text-align:center!important"><center>

<div class="shoutbox"><font color="#0044aa"><font color="#0044aa">

<form action="{{form_url}}" method="post"> <textarea rows="2" cols="35" name="text" style="width:auto" class="nhapchu">{%if api.r.get("ten")>4%}@[{{api.r.get("ten")|raw}}] {%endif%}{{api.r.get("icon")}}</textarea><br/>

<input type="submit" value="Đăng" class="nutbam"/></form>

</font></font></div></center>

{%set msg=message_list|split("[-msSthaian2009-]")%}{%if msg[0]|length < 1%}<center><b style="color:gray">Chưa có dữ liệu, xin post vài comment ^^</b></center>{%else%}

{%set thutu=msg[0]|split("[-zdata-]")[1]|split("[-zdate-]")[0]%}{%set dk=1%}

<div class="cachx">{%for i in 0..msg|length-2%}{%set user=api.u.get(msg[i]|split("[-zdata-]")[1]|split("[-zdate-]")[0])%}

{%if user.uid==thutu%}{%set date=msg[i]|split("[-zdate-]")[1]%}

{{thaian2009.noidungx(user,msg[i]|split("[-zdata-]")[0],msg[i+1]|split("[-zdata-]")[1],date,dk)}}

{%else%}

{%set thutu=msg[i+1]|split("[-zdata-]")[1]%}{%set dk=0%}

{%endif%}

{%set dk=dk+1%}{%if dk==1%}

{{thaian2009.noidungx(user,msg[i]|split("[-zdata-]")[0],msg[i+1]|split("[-zdata-]")[1],date,dk)}}

{%endif%}

{%endfor%}</div>{%endif%}

</div>

<center>{{paging_def}}</center>[/code]

Ô 2 shoutbox

[code]{{message}}[-zdata-]{{nick|slice(27,8)}}[-zdate-]{{message_date}}[-msSthaian2009-][/code]

- Để số tin nhắn là 10

Nguồn: http://cobethoitiet.wap.mu

12.09.2015 / 23:14
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H

chưa đăng nhập mà truy cập vào nó ko hiện gì :yao:

13.09.2015 / 09:54
b0ysh0ckhn
Bài đăng: 1146
Member
Nguyễn Minh Phương

code viết ra với mục đích gì cho wap....

13.09.2015 / 10:09
thaian2009
Bài đăng: 709
Member

Chưa đăng nhập sao thấy được chứ =))

13.09.2015 / 10:10
thaian2009
Bài đăng: 709
Member

Style[code]<style type="text/css">

body {background-color: #FFFFFF; color: #04F; font-family: Tahoma; margin: auto; max-width: 600px; word-wrap: break-word; border: 2px solid #C4BDBD; border-radius: 4px; box-shadow: 0px 0px 9px #7A7070; margin-bottom: 4px; margin-top: 2px; font-size: 10px;}

.title{border: 1px solid #CCC; background-color: #D3D3D3; color: #6F726E; font-weight: bold; margin: 1px;}

.nutbam{border: 1px solid #70F364; background-color: #07AE18; border-radius: 3px; padding: 3px 20px; margin-top: 1px; color: #eee; font-weight: bold;}

.nhapchu{overflow: hidden; border: 1px solid #EFEF71; background-color: #FFFFF5;max-width:80%;border-radius:5px}

img,select,textarea,input{max-width:100%}

.chaychu{overflow: hidden;background: #0C7405 repeat bottom;padding-left:2px;border-left: 1px solid #04931D;padding-right:3px;border-right: 1px solid #139D04;font-size: 10px;}

.khunga{border-bottom: 1px solid #C8C6C6; margin-left: 4px; margin-right: 4px;}

.khungb{background-color: #EFEFEF; border-left: 2px solid #D1CFCF; border-right: 2px solid #BEBDBD; padding-top: 1px; margin-left: 2px; margin-right: 2px;}

.khungc{background-color: #F3F3F3; border-left: 1px solid #C2BEBE; border-right: 1px solid #C8C8C8; padding-top: 2px; margin-left: 1px; margin-right: 1px;}

.khungchu{overflow: hidden; background: #Ffffff repeat bottom; padding-left: 2px; border-left-width: 1px; border-left-style: solid; border-left-color: #BAB9B9; padding-right: 3px; border-right-width: 1px; border-right-style: solid; border-right-color: #B8B5B5;height: 15px;}

.sheader{background-color:#ffffff;border-style: solid;border-width:1px;border-color:#88beff;margin:1px;border-bottom: 1px solid #7A0303;}

.hinhnen{background-image:url(/files/1049801/nenco.gif);background-repeat:repeat-x;background-position:top;background-color:#00AA00;padding:2px;}

.chux{font-size: 10px;font-family:'comic sans ms', cursive;color:#FF0033;}

.menu1{background-color:#ffffff;border-style:double;border-width:1px;border-color:#88beff;}

.sfooter{padding: 5px; background-color: #efefef; color: #0EBDD5; text-align: center; border-bottom: 1px solid #D5D5D5; border-top: 1px solid #EDEDED;}

.cachx{text-align: left; margin: 1px; border: 1px solid #efefef;}

.noidungz{margin-left: 25px;clear: none;max-width: 80%;color: #07B018;margin-top: 6px;position: relative;}

.nd1{float:left}.nd2{float:right;margin-right: 20px;}

.nhom{margin-bottom: 8px; padding-bottom: 1px;}

.gt2{text-align: right;}

.xkhunga{border-bottom: 1px solid #D3D1D1; margin-left: 4px; margin-right: 4px;}

.xkhungb{background-color: #FFFCFC; border-left: 2px solid #C6C4C4; border-right: 2px solid #C6C3C3; padding-top: 1px; margin-left: 2px; margin-right: 2px;}

.xkhungc{background-color: #FFFBFB; border-left: 1px solid #CECCCC; border-right: 1px solid #BEBDBD; padding-top: 2px; margin-left: 1px; margin-right: 1px;}

.xkhungchus{overflow: hidden; background: #Ffffff repeat bottom; padding-left: 2px; border-left-width: 1px; border-left-style: solid; border-left-color: #C6C3C3; padding-right: 3px; border-right-width: 1px; border-right-style: solid; border-right-color: #C6C4C4;}

.xkhungchus:hover{box-shadow: 1px 3px 5px #6DFFF6;background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0.25, rgb(244, 252, 254)),color-stop(1, rgb(255, 255, 255)));}

.xhinh{width: 30px; border-radius: 50%; border: 1px solid #C8C8C8; padding: 1px; box-shadow: 0px 0px 1px #00E9E4;height:30px}

.arrow{background: transparent url(/files/116849/artop.png) no-repeat 10% 100%; height: 6px; width: 11px; background-size: auto; position: absolute; top: -5px; z-index: 1; margin-left: -3px; display: block;}

.ar1{left:14%;}

.ar2{right:14%}

</style>[/code]

13.09.2015 / 10:33
thaian2009
Bài đăng: 709
Member
MrKen đã viết

chưa đăng nhập mà truy cập vào nó ko hiện gì :yao:

Nhấn refresh lại 1 lần nữa.. do macro nó xử lí chậm hay sao đấy =))