Code shoutbox gần giống gek không load

34 bài đăng
03.12.2016 / 23:33
minhduc
Bài đăng: 292
Member
zKaiSoul
04.12.2016 / 10:59
dat2013
Bài đăng: 376
Member
Tổn thương :(
Windyluck đã viết

:apl:

:21:

04.12.2016 / 19:25
NamDen
Bài đăng: 46
Member
beatbox đã viết

Code này sẻ không có chức năng up top nhé ^^ thêm html

HTML5
  1. <link rel="stylesheet" href="http://gek.wap.mu/files/979047/index.v1.css" type="text/css">

ô 1 chat bot thêm

TWIG
  1. </div>{%if 'a'=='a'%}<style>
  2. .sc_a1, .boxmain, .statsd, form .center, .left {
  3. border-radius: 5px;
  4. overflow: hidden;
  5. }
  6. .sc_a1, .box, .left, form[action*='id=ch_topic&f='], .divider, form .center {
  7. background: #fff;
  8. margin: 0 6px 6px;
  9. border-color: #ccced3 #c4c6ca #b4b6ba;
  10. border-style: solid;
  11. border-width: 1px;
  12. }
  13. .message, .list li {
  14. word-wrap: break-word;
  15. overflow: hidden;
  16. }
  17. .sc_a1 .status {
  18. padding: 6px;
  19. }
  20. img.ava30 {
  21. width: 30px;
  22. }
  23. img.ava2 {
  24. -webkit-border-radius: 50%;
  25. -moz-border-radius: 50%;
  26. border-radius: 50%;
  27. }
  28. img.ava {
  29. padding: 4px;
  30. background-color: #fff;
  31. border: 1px solid #ccc;
  32. border: 1px solid rgba(0,0,0,0.2);
  33. -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  34. -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  35. box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  36. }
  37. .fl {
  38. float: left;
  39. }
  40. .ml {
  41. margin-left: 5px;
  42. }
  43. .fl {
  44. float: left;
  45. }
  46. .b {
  47. font-weight: bold;
  48. }
  49. a {
  50. color: #3b5998;
  51. text-decoration: none;
  52. }
  53. .cl:before, .wf:after, #wrapper:after, #wrapper:before, .bottom-head:after {
  54. content: '';
  55. line-height: 0;
  56. clear: both;
  57. display: table;
  58. }
  59. .user_message {
  60. padding: 4px 0;
  61. }
  62. .composter, .p8 {
  63. padding: 8px;
  64. background: #f6f7f8;
  65. }
  66. .bt, .composter {
  67. border-top: 1px solid rgba(0, 0, 0, .101);
  68. }
  69. .composter a {
  70. padding: 8px;
  71. position: relative;
  72. cursor:pointer;
  73. }
  74. .composter .cmt:hover{
  75. border-bottom: 4px solid rgba(15,120,250,1);
  76. }
  77. span[class*="l-"] {
  78. height: 4px; width: 4px;
  79. background: #000;
  80. display: inline-block;
  81. margin: 12px 2px;
  82.  
  83. border-radius: 100%;
  84. -webkit-border-radius: 100%;
  85. -moz-border-radius: 100%;
  86.  
  87. -webkit-animation: loader 4s infinite;
  88. -webkit-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415);
  89. -webkit-animation-fill-mode: both;
  90. -moz-animation: loader 4s infinite;
  91. -moz-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415);
  92. -moz-animation-fill-mode: both;
  93. -ms-animation: loader 4s infinite;
  94. -ms-animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415);
  95. -ms-animation-fill-mode: both;
  96. animation: loader 4s infinite;
  97. animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415);
  98. animation-fill-mode: both;
  99. }
  100.  
  101. span.l-1 {-webkit-animation-delay: 1s;animation-delay: 1s;-ms-animation-delay: 1s;-moz-animation-delay: 1s;}
  102. span.l-2 {-webkit-animation-delay: 0.8s;animation-delay: 0.8s;-ms-animation-delay: 0.8s;-moz-animation-delay: 0.8s;}
  103. span.l-3 {-webkit-animation-delay: 0.6s;animation-delay: 0.6s;-ms-animation-delay: 0.6s;-moz-animation-delay: 0.6s;}
  104. span.l-4 {-webkit-animation-delay: 0.4s;animation-delay: 0.4s;-ms-animation-delay: 0.4s;-moz-animation-delay: 0.4s;}
  105. span.l-5 {-webkit-animation-delay: 0.2s;animation-delay: 0.2s;-ms-animation-delay: 0.2s;-moz-animation-delay: 0.2s;}
  106. span.l-6 {-webkit-animation-delay: 0;animation-delay: 0;-ms-animation-delay: 0;-moz-animation-delay: 0;}
  107.  
  108. @-webkit-keyframes loader {
  109. 0% {-webkit-transform: translateX(-30px); opacity: 0;}
  110. 25% {opacity: 1;}
  111. 50% {-webkit-transform: translateX(30px); opacity: 0;}
  112. 100% {opacity: 0;}
  113. }
  114.  
  115. @-moz-keyframes loader {
  116. 0% {-moz-transform: translateX(-30px); opacity: 0;}
  117. 25% {opacity: 1;}
  118. 50% {-moz-transform: translateX(30px); opacity: 0;}
  119. 100% {opacity: 0;}
  120. }
  121.  
  122. @-keyframes loader {
  123. 0% {-transform: translateX(-30px); opacity: 0;}
  124. 25% {opacity: 1;}
  125. 50% {-transform: translateX(30px); opacity: 0;}
  126. 100% {opacity: 0;}
  127. }
  128.  
  129. @-ms-keyframes loader {
  130. 0% {-ms-transform: translateX(-30px); opacity: 0;}
  131. 25% {opacity: 1;}
  132. 50% {-ms-transform: translateX(30px); opacity: 0;}
  133. 100% {opacity: 0;}
  134. }
  135. .i-post-status{background:transparent url(/files/116849/post-status.png) no-repeat;width:16px;height:16px;position:absolute;top:-1px;left:0; margin-left: 5px;}
  136. .i-upload-photo{background:transparent url(/files/116849/upload-photo.png) no-repeat;width:16px;height:16px;position:absolute;top:-1px;left:0; margin-left: 5px;}
  137. .sc_a1,.boxmain,.statsd,form .center,.left{border-radius:5px;overflow:hidden}
  138. .title{margin-bottom:5px}
  139. .statsd{margin:5px;background:#F6F7F8}
  140. .boxmain{border:1px solid #d3d6db;background:#fff;margin:5px;padding-bottom:5px}
  141. .boxmain .titlea,.statsd .titlea{background:#F6F7F8;padding:10px 5px 10px 5px;color:#6A7480;font-weight:bold;border-bottom:1px solid #e1e1e1;height:14px;text-align:left}
  142. .sform{padding:0;}
  143. .sform #post-area{padding:5px;}
  144. .sform textarea{resize:none;border:0px;outline:0px;}
  145. .sform .titlea span[id]{position:relative;padding-left:22px;display:inline-block}
  146. .sform .titlea span.active{color:#333}
  147. .sform .titlea span.active .artop{background:transparent url(/files/116849/artop.png) no-repeat 10% 100%;height:6px;width:11px;background-size:auto;position:absolute;left:50%;top:19px;z-index:1;margin-left:-3px;display:block}
  148. #post-options{padding:0px 10px;vertical-align:middle;background:#F6F7F8;border-top:1px solid #e9eaed}
  149. </style>
  150. <script>
  151. $(function(){
  152. var ref='main.php?id=ch_topic_h&uid=217217';
  153. function shoutbox(){
  154. $('.cmt').click(function(){
  155. data=$(this).attr('data-cmt-id');
  156. $('#comments_'+data).html('<div class="composter s" style="display: none;" id="stats_'+data+'"><div class="mad" id="content" ><div class="sc_a1" style="text-align:center"><img src="files/979047/loading_sms.gif"></div></div></div><div class="composter s"><form action="" method="post" id="comment" data-id="'+data+'"><input type="text" style="width:50%" name="text" class="cmt_text_'+data+'" placeholder="Viết bình luận..." autocomplete="off" value=""><input type="submit" class="btn-small ml" value="Bình luận"></form></div>');
  157. chapnhan();
  158. return false;
  159. });
  160. }
  161. $('#post_status').submit(function(){
  162. $.post(ref,{text:$('#chat_txt').val()},function(){
  163. load();
  164. $('#chat_txt').val('');
  165. });
  166. return false;
  167. });
  168. function load(){
  169. $('.message_list').load(location.href+' .sc_a1',function(){
  170. shoutbox();
  171. });
  172. }
  173. shoutbox();
  174. function chapnhan(){
  175. $('#comment').submit(function(){
  176. var data=$(this).attr('data-id');
  177. $('#stats_'+data).show();
  178. $.post(ref,{text:data+' '+$('.cmt_text_'+data).val()},function(){
  179. $('#stats_'+data).hide();
  180. if($('#cmt_list_'+data).find('.composter').length>=5){
  181. $('#cmt_list_'+data).find('.composter:first-child').remove();
  182. }
  183. $('#cmt_list_'+data).append('<div class="composter s"><a href="main.php?f=1" class="b">[nick]:</a>'+$('.cmt_text_'+data).val()+'<br><br><span class="ml">(Vừa xong)</span></div>');
  184. $('.cmt_text_'+data).val('');
  185. });
  186. return false;
  187. });
  188. }
  189.  
  190. })
  191. </script>
  192.  
  193.  
  194.  
  195.  
  196. <div id="haha"></div> <div class="boxmain s sform"><div class="titlea"><a href="#" title="Trạng thái"><span id="update-status" class="active"><i class="i-post-status"></i> Trạng thái <i class="artop active"></i> </span></a><a href="?fnc=up" title="Thêm ảnh" class="fancybox"><span id="upload-photo"><i class="i-upload-photo"></i> Thêm ảnh <i class="artop"></i> </span></a><a href="?id=online" title="Online 1"><span id="online"><i class="i-upload-photo"></i>Online [online]<i class="artop"></i></span></a></div><form id="post_status" action="main.php?id=ch_topic_h&uid=217217&back_url=%2Fmain.php{%if api.r.get('f')%}%3Ff%3D{{api.r.get('f')}}{%endif%}" method="post" data-time="20160126092029">
  197. <div id="post-area" class><textarea style="width:98%" name="text" placeholder="Nhập trạng thái" id="chat_txt"></textarea></div>
  198. <div id="post-options" class="wf" align="right"><input type="submit" value="Đăng"></div>
  199. </form></div>
  200.  
  201.  
  202.  
  203. <div class="message_list">
  204. {%set m=message_list|split('</CODE_by_hUy/>')%}
  205. {%set uid,msg,msd,sc='','','',0%}
  206. {%for i in 1..m|length-1%}
  207. {%set uid=m[i-1]|split('#uid#')[1]|split('#/uid#')[0]%}
  208. {%set msg=m[i-1]|split('#msg#')[1]|split('#/msg#')[0]%}
  209. {%set msd=m[i-1]|split('#msd#')[1]|split('#/msd#')[0]%}
  210. {%if msg matches '{^([0-9]{12} )}' %}
  211. {% else %}
  212. {%set sc=sc+1%}
  213. {%if api.r.get('page')==null%}
  214. {%set min=1%}
  215. {%set max=10%}
  216. {%else%}
  217. {%set min=api.r.get('page')*10-10%}
  218. {%set max=api.r.get('page')*10%}
  219. {%endif%}
  220. {%if min<=sc and max>sc%}
  221. <div class="sc_a1" stt="0" page="2">
  222. <div class="message">
  223. <div class="status">
  224. <div class="wf">
  225. <img src="{{api.u.get(uid).profilephotourl}}" class="ava ava2 ava30 fl">
  226. <div class="fl ml">
  227. <div class="poster b" data-uid="23993904">
  228. <a href="user_info.php?uid={{uid}}" title="[nick]">{{api.u.get(uid).nick}}</a>
  229. <span class="s"> - {%if api.u.get(uid).level==127%}<font color="#ff0000">Frounder</font>{%else%}Member{%endif%}</span></div>
  230. <div class="time s">
  231. {{msd}}</div></div><div class="cl"></div>
  232. <div class="user_message s">
  233. <div class="message_topic">
  234. {{msg|raw}}
  235. </div>
  236. </div>
  237. </div>
  238.  
  239. </div><div class="composter s b"><!--a href="#head" --><a class="cmt" data-cmt-id="{{msd|date('ymdHis')}}" href="main.php?{%if api.r.get('f')%}f={{api.r.get('f')}}&{%endif%}comment={{msd|date('ymdHis')}}" _onclick="document.forms[0].text.value='{{msd|date('ymdHis')}}'">Bình luận</a><!--/a--></div><div id="comments_{{msd|date('ymdHis')}}"></div></div>
  240.  
  241. <div id="cmt_list_{{msd|date('ymdHis')}}">
  242. {%set juid,jmsg,jmsd,john='','','',0%}
  243. {%for j in m|length-1..1%}
  244. {%set juid=m[j-1]|split('#uid#')[1]|split('#/uid#')[0]%}
  245. {%set jmsg=m[j-1]|split('#msg#')[1]|split('#/msg#')[0]%}
  246. {%set jmsd=m[j-1]|split('#msd#')[1]|split('#/msd#')[0]%}
  247. {%if jmsg matches '{^([0-9]{12} )}' %}
  248. {%if jmsg|slice(0,12)==msd|date('ymdHis') %}
  249. {%set john=john+1%}
  250. {%if john<=5%}
  251. <div class="composter s">
  252. <a href="user_info.php?uid={{juid}}" class="b">{{api.u.get(juid).nick}}</a>
  253. {{jmsg|slice(13,jmsg|length-13)|raw}}
  254. <br><br>
  255. <span class="ml">{{jmsd|date('H:i, d/m/y')}}</span></div>
  256. {%endif%}
  257. {%endif%}
  258. {%endif%}
  259. {%endfor%}
  260. </div>
  261. <div id="comments_{{msd|date('ymdHis')}}"></div>
  262. </div></div>
  263.  
  264. {%endif%}
  265. {%endif%}
  266. {%endfor%}
  267. </div>
  268. {%endif%}{{paging_def}}

Ô 2:

TWIG
  1. #uid#{{nick|slice(27,8)}}#/uid##msg#{{message}}#/msg##msd# {{message_date}} #/msd#</CODE_by_hUypyy/>

nhớ thay uid shoutbox ở phần js nhé thân!!thấy hay cho like ^^

code buy: huypy

Code này fix chỉ chat đc 1 cái chưa

04.12.2016 / 19:29
minhduc
Bài đăng: 292
Member
zKaiSoul
NamDen đã viết

Code này fix chỉ chat đc 1 cái chưa

Mướn tôi làm cho đã rồi không trả tiền sông chui sống nhũi ak