XtGem Forum catalog
Share Code Shoutbox Có Uptop | Wapego | Góc wap/webmaster -
Hi, Phòng khách!
Gợi ý : Hãy * Đăng nhập Hoặc Đăng ký tài khoản để sử dụng hết chức năng của diễn đàn !

Share Code Shoutbox Có Uptop Share Code Shoutbox Có Uptop


Đánh giá: 100%
tcm
100/ 100 100 bình chọn
Bài viết 20-09-2015
* KhanhSociu
Cấp bậc: mem
Style Wap
<style type="text/css">
  html{background-color:white;}
  .wcontainer>.center div:not([class]){display:none;}
  body{background-color:#dcdee3;margin:auto;max-width:1000px;  font-size: 16px;}
  body,div{text-align:left}
  a {color: #3b5998; text-decoration: none;}
  .title{text-align: left; background: #f6f7f8; border: none; color: #444; font-size: small; font-weight: bold; padding: 5px 6px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
  .head{background: #3b5998; padding: 0 6px;}
  .clpm{float: right;color: #fff;  display: inline-block; font-size: small;  padding: 2px 4px 2px;}
  .active{background-color: #6d84b4;}
  .clink{color: #fff;display: inline-block;font-size: small; padding: 2px 4px 2px;}
  .kungs{padding-bottom: 3px;}
  .nutbam{background-color: #4e69a2; padding: 0 8px; border: 1px solid #4a5f90; font-weight: normal; color: #fff; display: inline-block; font-size: 12px; height: 28px; line-height: 28px; overflow: hidden; text-align: center; vertical-align: top; white-space: nowrap; border-radius: 2px; cursor: pointer;}
.khungnhap{resize: vertical; width: 70%; border: 1px solid #9197a3;}
.cll{content: ''; line-height: 0; clear: both; display: table;}
.chungs{  padding: 6px;}
  .ongoai{background: #fff; margin:6px 6px 0px 6px; border-color: #ccced3 #c4c6ca #b4b6ba; border-style: solid; border-width: 1px;}
  .message{word-wrap: break-word; overflow: hidden;margin:-1px 6px 0px 6px;border-color: #ccced3 #c4c6ca #b4b6ba; border-style: solid; border-width:0px 1px 0px 1px;}
  .status{  padding: 6px;}
  .lll{  float: left;}
  .comment{padding: 4px 0;clear:both}
  .time{margin-left:10px}
  .nguoidung{  margin-left: 10px;float:left;}
  .binhluan{background: #f6f7f8; padding: 4px 6px; border-top: 1px solid rgba(0, 0, 0, .101);}
  .shadow {height: 1px; width: 100%; background-color: #dedede; border-top: 1px solid #b4b4b4; border-bottom: 1px solid #eeeeee;}
  .p8{ padding: 8px;background: #f6f7f8;margin:-1px 6px 0px 6px;border-width:0px 1px 0px 1px;border-style:solid;border-color: #ccced3 #c4c6ca #b4b6ba;}
  .nhanh{margin:0px 6px 0px 6px;padding: 8px; background: #f6f7f8;border-width:0px 1px 0px 1px;border-style:solid;border-color: #ccced3 #c4c6ca #b4b6ba;}
  .nutnhan{  margin-left: 10px; line-height: normal; height: auto; background-color: #4e69a2; padding: 5px; border: 1px solid #4a5f90; font-weight: normal; color: #fff; display: inline-block;overflow: hidden; text-align: center; vertical-align: top; white-space: nowrap; border-radius: 2px; cursor: pointer;}
  .nhaplieu{  height: 36px;padding: 3px 4px; border: 1px solid #ccc;}
</style>
</div>
<div class="head"><div>
  <a href="/main.php">
    <img src="/files/1050632/shoutboxgenretor.png"></a><a href="/pm.php" class="clpm">PM: 0/0</a>
  </div>
  
<div class="kungs">
<a href="/main.php" class="active">Trang chủ</a>
<a href="/user_info.php?uid=24060200&ref=nav" class="clink">Trang cá nhân</a>
  <a href="/forums.php" class="clink">Diễn đàn</a>
<a href="/main.php?id=online" class="clink">Online (0)</a>
<a href="/main.php?f=3594523" class="clink">Tìm kiếm</a>
</div>
</div>
Copy code

Khung comment (xóa 2 kí tự @ thay form_url)
{%set form_url='main.php?id=ch_topic_h&uid=193727&back_url=%2Fmain.php%3Ff%3D3383658'%}
<script type="text/javascript">
function writef(ff,vl)
{
var md=ff.desc.value;
ff.text.value=vl+"[-xcmt-]"+md;
}
function dang()
{
var ff=document.forms["formx"];
var nd=ff.desc.value;
if(nd==null || nd=="")
{window.location="{{api.r.getRequestUri()}}&error=null";}else{
ff.text.value=nd;
ff.submit();
}

}
</script>

{%if api.r.get("cmt")==true%}<div class="title">Bình luận - Chia sẻ</div>{%else%}
<div class="title">SHOUTBOX HISTORY</div>

<form action="{{form_url}}" method="post" class="chungs" name="formx">
  <@textarea rows="3" cols="20" name="desc" class="khungnhap"><@/textarea><input type="hidden" name="text" value=""/><br>
<input type="button" value="Đăng" class="nutbam" style="margin-left:6px" onclick="dang()">
  <div class="cll"></div>
</form>
{%endif%}
Copy code

Như cái trên nhưng dùng ajax, nếu dùng cái trên thì koo dùng cái này, xóa @ ở <@textarea rows="3" cols="20" name="desc" class="khungnhap"><@/textarea>
<div class="title" style="color:red"><a href="http://shoutboxgenerator.wap.mu/main.php?f=3383718" style="color:red;font-size:25px">Source shoutbox v2</a></div>
{%set form_url='main.php?id=ch_topic_h&uid=193727&back_url=%2Fmain.php%3Ff%3D3383658'%}
<script type="text/javascript">
function layno(xl,theUrl,sclass,repl)
{
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var astr=xmlhttp.responseText;
var re = repl;
var match;var t="";
while ((match = re.exec(astr)) != null){
t=t+match[0];
}
document.getElementById(sclass).innerHTML=t;
if(xl==1){
var el=document.getElementById(sclass);
var scripts = el.getElementsByTagName("script");
var i = 0;
var end = scripts.length;
for (i; i < end; i++) {
eval( scripts[i].innerHTML );
}
scripts = null;
}
}
}
xmlhttp.open("GET", theUrl,true);
xmlhttp.send();  
}
</script>
<script type="text/javascript">
function writef(ff,vl)
{
var md=ff.desc.value;
ff.text.value=vl+"[-xcmt-]"+md;
}
function dang()
{
var ff=document.forms["formx"];
var nd=ff.desc.value;
if(nd==null || nd=="")
{window.location="{{api.r.getRequestUri()}}&error=null";}else{
var xchu =nd; var data=new FormData(); data.append("text",xchu); var xhr = new XMLHttpRequest(); xhr.open("POST","main.php?id=ch_topic_h&uid=193727", true);
xhr.send(data);
layno("1","{{api.r.getRequestUri()}}","khung",/\<span id=\"xkhung\"\>.*?\<\/span\>\<i\>\<\/i\>/mig);var ff=document.forms["formx"]; var nd=ff.desc.value="";
}

}
function tailai(){layno("1","{{api.r.getRequestUri()}}","khung",/\<span id=\"xkhung\"\>.*?\<\/span\>\<i\>\<\/i\>/mig);}
var xchay=setInterval("tailai()",10000);
</script>

{%if api.r.get("cmt")==true%}<div class="title">Bình luận - Chia sẻ</div>{%else%}
<div class="title">SHOUTBOX HISTORY</div>

<form action="{{form_url}}" method="post" class="chungs" name="formx">
  <@textarea rows="3" cols="20" name="desc" class="khungnhap"><@/textarea><input type="hidden" name="text" value=""/><br>
<input type="button" value="Đăng" class="nutbam" style="margin-left:6px" onclick="dang()">
  <div class="cll"></div>
</form>
{%endif%}
Copy code

Shoutbox ô 1
{%set xmsg=message_list|split("[-end-]")%}{%set sid=0%}{%set sdata={}%}{%set sotrang=7%}{%set hiencmt="true"%}{%set hienform="false"%}
{%for i in 0..xmsg|length-1%}
{%if "[-uid-]" in xmsg[i] and "[-xcmt-]" not in xmsg[i]%}
{%set uid=xmsg[i]|split("[-uid-]")[1]|split("[-msg-]")[0]%}
{%set msg=xmsg[i]|split("[-msg-]")[1]|split("[-url-]")[0]%}
{%set date=xmsg[i]|split("[-date-]")[1]|split("[-lin-]")[0]%}
{%set nicks=api.u.get(xmsg[i]|split("[-nick-]")[1]|split("[-date-]")[0])%}
{%set socmt=0%}{%set comment=""%}{%set datecmt="-"%}
{%if "[-hidden-]" in msg and api.u.get(api.user_id).uid!=nicks.uid%}{%set ghidden="true"%}{%else%}{%set ghidden=""%}{%endif%}
{%set fuid%}{%if api.r.get("f")>=5%}main.php?f={{api.r.get("f")}}{%else%}main.php?{%endif%}{%endset%}
{%for i in xmsg|length-1..0%}
{%set amsg=xmsg[i]|split("[-msg-]")[1]|split("[-url-]")[0]%}
{%set adate=xmsg[i]|split("[-date-]")[1]|split("[-lin-]")[0]%}
{%set anicks=api.u.get(xmsg[i]|split("[-nick-]")[1]|split("[-date-]")[0])%}
{%if amsg|split("[-xcmt-]")[0]==uid and "[-xcmt-]" in amsg%}{%set socmt=socmt+1%}
{%set binhluan%}
{%set lmsg=amsg|split("[-xcmt-]")[1]|split("@[")%}{%set sbody=""%}{%for y in 0..lmsg|length%}{%if api.u.get(lmsg[y]|split("]")[0]).uid>5%}{%set sbody=sbody~'<img src="/files/953350/quote1.png"><a href="user_info.php?uid='~api.u.get(lmsg[y]|slice(0,8)).uid~'" class="'~api.u.get(lmsg[y]|slice(0,8)).levelCSS~'">'~api.u.get(lmsg[y]|slice(0,8)).nick~'</a><img src="/files/953350/quote2.png">'~lmsg[y]|split("]")[1]%}{%else%}{%endif%} {%endfor%} {%if sbody|length < 3%}{%set sbody=message%}{%endif%} {%set sbody=sbody|default(amsg|split("[-xcmt-]")[1])%}
<div class="message"><div class="binhluan"><table class="vtable" width="100%" cellpadding="0" cellspacing="1"> <tbody> <tr valign="top"> <td colspan="2" rowspan="2" scope="col" width="5%"><img src="{{anicks.profilephotourl(2,true)}}" class="xbogoc"/></td> <td width="94%" scope="col" align="left"><div class="ctime"><a href="user_info.php?uid={{anicks.uid}}">{{anicks.nick}}</a> {{sbody|raw}}</div></td> </tr> <tr> <td align="left"> <a href="/{{fuid}}&cmt=true&suid={{uid}}&ten={{anicks.uid}}"> Trả lời</a> · (<small>{%set ngay=adate|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 {{c.s}} giây trước.{%elseif c.h>=1%}{{c.h}} giờ {{c.i}} phút trước.{%elseif c.d>=1%}{{c.d}} ngày trước.{%endif%}</small>)</td> </tr> </tbody> </table></div></div>[-yota-]
{%endset%}
{%set comment=comment~binhluan%}
{%set datecmt=xmsg[i]|split("[-uid-]")[1]|split("[-msg-]")[0]%}
{%endif%}
{%endfor%}

{%if datecmt=="-"%}{%set datecmt=uid%}{%endif%}

{%set status%}
[-xtcmt-]{{datecmt}}[-page-]<div class="ongoai"><div class="status" {%if "[-hidden-]" in msg%}style="border: 1px solid #38F7C4;"{%endif%}><i class="arrowr"></i><table class="htable" width="100%" cellpadding="0" cellspacing="1"> <tbody> <tr valign="top"> <td colspan="2" rowspan="2" scope="col" width="5%"><img src="{{nicks.profilephotourl(2,true)}}" class="xbogoc"/></td> <td width="90%" scope="col" align="left"><a href="user_info.php?uid={{nicks.uid}}">{{nicks.nick}}</a></td> </tr> <tr> <td align="left"><span style="font-size: smaller;text-align:right;color: rgb(203, 202, 200);">
{%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 {{c.s}} giây trước.{%elseif c.h>=1 and c.d==0%} {{c.h}} giờ {{c.i}} phút trước.{%elseif c.d>=1%}{{c.d}} ngày trước.{%endif%}
</span></td> </tr> </tbody> </table>
<div class="xlogin zlogin">{{msg|replace({"[-hidden-]":''})|raw}}<div><img src="/files/1049801/slike.png"> 0 · <a href="">Thích</a> · <a href="/{{fuid}}&cmt=true&suid={{uid}}">{%if socmt>0%}{{socmt}}{%endif%} Bình luận</a></div></div></div></div>{%if socmt>5 and api.r.get("cmt")!="true"%}<div class="p8"><img src="/files/1020011/icons-new%20copy.png"><a href="/{{fuid}}&cmt=true&suid={{uid}}">Xem thêm {{socmt-5}} bình luận</a></div>{%endif%}
{%endset%}

{%set form%}<form action="{{form_url}}" method="post" class="nhanh" onsubmit="writef(this,'{{uid}}')"><input class="nhaplieu" name="desc" type="text" value="{%if api.r.get("ten")>4%}@[{{api.r.get("ten")}}] {%endif%}"><input type="hidden" name="text" value=""><input type="hidden" name="suid" value="{{uid}}"/><input type="submit" value="Bình luận" class="nutnhan"></form>{%endset%}

{%set zcmt=comment|split("[-yota-]")%}
{%if api.r.get("cmt")=="true"%}
{%if api.r.get("suid")==uid%}
{%set messages=status~'<div class="vdata">'~comment|split("[-yota-]")|join("")~form~'</div>'%}
{%else%}{%set messages=""%}{%endif%}
{%else%}
{%set messages=hiencmt=="true"?status~'<div class="vdata">'~zcmt[socmt-5]~zcmt[socmt-4]~zcmt[socmt-3]~zcmt[socmt-2]~zcmt[socmt-1]~(hienform=="true"?form:"")~'</div>':status%}
{%endif%}

{%if ghidden=="true"%}{%set messages=""%}{%endif%}
{% set sdata = sdata|merge({ ("thaian"~sid): messages}) %}
{% set sid=sid+1%}
{%endif%}
{%endfor%}





{%for i in 0..sid%}
{%for j in (i+1)..sid%}
{%if (sdata["thaian"~i]|split("[-xtcmt-]")[1]|slice(0,14))*1 < (sdata["thaian"~j]|split("[-xtcmt-]")[1]|slice(0,14))*1 %}
{%set temp=sdata["thaian"~j]%}
{%set sdata=sdata|merge({("thaian"~j):sdata["thaian"~i]})%}
{%set sdata=sdata|merge({("thaian"~i):temp})%}
{%endif%}
{%endfor%}
{%endfor%}

{%set spage=api.r.get("pusl")|default(0)%}
{%if spage>0%}{%set dau=spage*sotrang%}{%set cuoi=((spage+1)*sotrang)-1%}{%else%}{%set dau=spage*sotrang%}{%set cuoi=((spage+1)*sotrang)-1%}{%endif%}

<div style="background-color:#e9eaed;padding-bottom:5px">{%for i in dau..cuoi%}{{sdata["thaian"~i]|split("[-page-]")[1]|raw}}{%endfor%}</div>
<center>{%if spage>0%}<a href="main.php?{%if api.r.get('f')>=5%}f={{api.r.get('f')}}{%endif%}&pusl={%if spage==null%}1{%else%}{{spage-1}}{%endif%}#chatne"><<Trang trước</a> | {%endif%}<a href="main.php?{%if api.r.get('f')>=5%}f={{api.r.get('f')}}{%endif%}&pusl={%if spage==null%}1{%else%}{{spage+1}}{%endif%}#chatne">Trang sau>></a></center>
Copy code
Shoutbox ô 2 (số tin nhắn để 100)
{%set dates=message_date%}
{%if "[-xcmt-]" in message|slice(0,14)%}[-cmt-]{{message|split("[-xcmt-]")[0]}}{%endif%}[-uid-]{{dates|date("YmdHis")}}[-msg-]{{message}}[-url-]{{file_url}}[-nick-]{{nick|slice(27,8)}}[-date-]{{dates|date("d-m-Y H:i:s")}}[-lin-][-end-]
Copy code

Footer Wap
<div style="background-color: #4e5665;border-top: 1px solid #373e4d;color: #bdc1c9;font-size: small;padding: 7px 8px 8px;"><a href="#head" style="color: #bdc1c9;border: 1px solid #bdc1c9;display: block;padding: 2px;text-align: center; margin-top: 8px;">Lên đầu trang</a></div><div style="display:none">
Copy code

Demo : http://upso1.ga
Nguồn : cobethoitiet
Bài viết 20-09-2015
* KhanhSociu
Cấp bậc: mem
{%set sotrang=7%} thay thành số bài viết hiển thị


{%set hiencmt="true"%} Nếu ko muốn hiện comment ngoài trang chủ thì cho thành false

{%set hienform="false"%} Nếu muốn hiện form comment ngoài trang chủ thì cho thành true
Share Code Shoutbox Có Uptop Tổng số: 2
Chia sẻ:Google Plus Twitter Facebook
BBCode:

Link:
Từ khóa: Uptop , Code , Shoutbox , , Share , Uptop
Trực tuyến
- BOT , 1 khách ghé thăm