Wapego[Events] Share vài code ego 20/08

181 bài đăng
Tags:
22.08.2016 / 12:35
thanhtung698
Bài đăng: 687
Member
http://taolap.net

Cái số like ấy nha

22.08.2016 / 13:13
thaian2009
Bài đăng: 709
Member
thanhtung698 đã viết

Nó đó :12:

Bố trí ảnh mới thêm cái này vào

TWIG
  1. <span class="vote" msS="{{nick_uid}}">0</span>

Bố trí Thông tin người dùng trong thư viện thêm

TWIG
  1. <span id="vote" msS="{{api.r.get('uid')}}">{{votes}}</span>

Footer thư viện ảnh

TWIG
  1. {%if api.r.get('id')=='new'%}<script src="/files/1020011/jquery.min.js"></script>
  2. <script type="text/javascript">
  3. var t=$('.vote');
  4. for(var i=0;i<t.length-1;i++){
  5. $.get('/galery.php?id=view_foto&uid='+$(t[i]).attr('msS'),function(data){
  6. var x= $(data).find('#vote').text();
  7. var uid=$(data).find('#vote').attr('msS');
  8. x=x?x:'0';
  9. $('.vote[msS="'+uid+'"]').text(x);
  10. });
  11. }
  12. </script>{%endif%}
22.08.2016 / 13:26
thanhtung698
Bài đăng: 687
Member
http://taolap.net

Tuyệt :kul:

22.08.2016 / 14:28
thanhtung698
Bài đăng: 687
Member
http://taolap.net

Vậy comments thi s an :12:, ma an lm dx cái đóng logo vào ảnh khi up len ko

22.08.2016 / 14:32
thaian2009
Bài đăng: 709
Member
thanhtung698 đã viết

Vậy comments thi s an :12:, ma an lm dx cái đóng logo vào ảnh khi up len ko

Đóng logo thì làm cái tool trên host. Up ảnh ở wap đưa data qua tool xử lý rồi up lên wap

22.08.2016 / 14:49
thanhtung698
Bài đăng: 687
Member
http://taolap.net

Đưa sô bình luận thi sao an {{commemts}}

22.08.2016 / 15:12
thaian2009
Bài đăng: 709
Member
thanhtung698 đã viết

Đưa sô bình luận thi sao an {{commemts}}

Bố cục ảnh mới

TWIG
  1. Vote: <span class="vote" msS="{{nick_uid}}">0</span><br/>
  2. Cmt: <span class="cmt" msS="{{nick_uid}}">0</span>

Thông tin người dùng trong thư viện

TWIG
  1. <span id="vote" cmt="{{comments}}" vote="{{votes}}"></span>

Footer thư viện ảnh

TWIG
  1. {%if api.r.get('id')=='new'%}<script src="/files/1020011/jquery.min.js"></script>
  2. <script type="text/javascript">
  3. var t=$('.vote');
  4. var s=$('.cmt');
  5. function get(t,s,i)
  6. {
  7. $.get('/galery.php?id=view_foto&uid='+$(t[i]).attr('msS'),function(data){
  8. var x= $(data).find('#vote').attr('vote');
  9. x=x?x:'0';
  10. var y= $(data).find('#vote').attr('cmt');
  11. y=y?y:'0';
  12. $($(t[i])).text(x);
  13. $($(s[i])).text(y);
  14. });
  15. }
  16. for(var i=0;i<t.length-1;i++){
  17. get(t,s,i);
  18. }
  19. </script>{%endif%}
22.08.2016 / 16:09
thaian2009
Bài đăng: 709
Member
vipnamdan đã viết

Fix gíup cái đoạn rung an ơi :)

TWIG
  1. {%set msg=message_list|split('[-msS-]')%}
  2. <div class="list_msg" id="list_msg">{%for i in msg|length..0%}{{msg[i]|raw}}{%endfor%}</div>
  3.  
  4. <div class="center"> {{reply_form}} {{paging_next}} {{paging_back}} {{delete}} <br/> {{back}} <br/> {{back_to_main}} </div>
  5. <script src="/files/1005357/jquery.js"></script>
  6. <script type="text/javascript">
  7. var login=0,browser='{{api.r.createFromGlobals().cookies.get('v')=='3'?'web':'wap'}}',head='';new_msg='';
  8. {%set u=api.u.get(api.user_id)%}
  9. user={sex:'{{u.sex}}',id:'{{u.uid}}',nick:'{{u.nick}}',plus:'{{u.plus}}',msg:'0',all_msg:'3',sms:'0'};
  10. var lk = location.href;
  11. if(browser=='web'){audio = new Audio('files/1067753/odIeERVR1c5.mp3');
  12. }else{navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;};
  13.  
  14. $('#post_msg').submit(function(){
  15. var that=$(this);
  16. var action=that.attr('action');
  17. var text=that.find('textarea').val();
  18. var img=$('#post_msg #add_img_url').val();
  19. if(img.length>10){var text=text+' '+img;};
  20. var len=text.length;
  21. if(!user.id){
  22. $('#post_msg #notif').html('<div class="rmenu">Bạn chưa đăng nhập</div>').fadeIn(200).delay(2000).fadeOut(1);
  23. }else if(len==0){
  24. $('#post_msg #notif').html('<div class="rmenu">Vui lòng nhập văn bản</div>').fadeIn(200).delay(2000).fadeOut(1);
  25. }else if(len<2){
  26. $('#post_msg #notif').html('<div class="rmenu">Văn bản phải từ 2 kí tự trở lên</div>').fadeIn(200).delay(2000).fadeOut(1);
  27. }else if(len>5000){
  28. $('#post_msg #notif').html('<div class="rmenu">Văn bản không vượt quá 5000 kí tự</div>').fadeIn(200).delay(2000).fadeOut(1);
  29. }else{
  30. $('#post_msg #submit_msg').val('Đang gửi...');
  31. $.post(action,{msg: text},function(){
  32. $('#post_msg #chat_txt').val('');
  33. $('#post_msg #add_img_url').val('');
  34. $('#post_msg #submit_msg').val('Gửi');
  35. message();
  36. });
  37. };
  38. return false;
  39. });
  40. function message(){
  41. $.get(lk,function(res){
  42. html=$(res).find('.list_msg').html();
  43. $('.list_msg').html(html);
  44. if(browser=='web'){if(new_msg=='new'){audio.play();
  45. new_msg='';} }else{if(new_msg=='new'){navigator.vibrate(500);
  46. new_msg='';}};
  47. });
  48. setTimeout(function(){message()},1000);
  49. };
  50. </script>
  51. <style type="text/css">
  52. .portlet:after, .portlet .section:after, .portlet-header:after {
  53. clear: both;
  54. }
  55. .portlet:before, .portlet .section:before, .portlet-header:before, .portlet:after, .portlet .section:after, .portlet-header:after {
  56. content: " ";
  57. display: table;
  58. }
  59. .portlet:after, .portlet .section:after, .portlet-header:after {
  60. clear: both;
  61. }
  62. .portlet:before, .portlet .section:before, .portlet-header:before, .portlet:after, .portlet .section:after, .portlet-header:after {
  63. content: " ";
  64. display: table;
  65. }
  66. *, *:before, *:after {
  67. -webkit-box-sizing: border-box;
  68. -moz-box-sizing: border-box;
  69. box-sizing: border-box;
  70. }
  71. :after, :before {
  72. -webkit-box-sizing: border-box;
  73. -moz-box-sizing: border-box;
  74. box-sizing: border-box;
  75. }
  76.  
  77. .center {
  78. background-color: #FFF;
  79. border: 0px solid #E0E3E9;
  80. border-top: none;
  81. margin: 0;
  82. padding: 0;
  83. }
  84. .end, .center {
  85. text-align: center;
  86. }
  87. input[type="submit"].button-inverted-fill {
  88. border: 1px solid #2E9FFF;
  89. color: #FFF;
  90. background-color: #2E9FFF;
  91. }
  92. button, html input[type="button"], input[type="reset"], input[type="submit"] {
  93. -webkit-appearance: button;
  94. cursor: pointer;
  95. }
  96. #reg_form input[type="button"], #reg_form input[type="reset"], input[type="submit"] {
  97. -webkit-appearance: button;
  98. }
  99. input[type="submit"], button {
  100. border: 1px solid #CCE9FF;
  101. color: #2E9FFF;
  102. background-color: #FFF;
  103. padding: 6px 10px 6px;
  104. border-radius: 3px;
  105. line-height: 1.1em;
  106. text-align: center;
  107. font-weight: 600;
  108. display: inline-block;
  109. font-size: 13px;
  110. }
  111. button, html input[type=button], input[type=reset], input[type=submit] {
  112. -webkit-appearance: button;
  113. cursor: pointer;
  114. }
  115. input, button, select, textarea {
  116. font-family: inherit;
  117. font-size: inherit;
  118. line-height: inherit;
  119. }
  120. button, input {
  121. line-height: normal;
  122. }
  123. button, input, select, textarea {
  124. font-family: inherit;
  125. font-size: 100%;
  126. margin: 0;
  127. }
  128.  
  129. .list1, .list2 {
  130. background-color: #FFF;
  131. border: 1px solid #E0E3E9;
  132. border-top: none;
  133. margin: 0;
  134. padding: 4px;
  135. }
  136.  
  137. textarea {
  138. font-family: inherit;
  139. font-size: inherit;
  140. line-height: inherit;
  141. }
  142. textarea {
  143. overflow: auto;
  144. vertical-align: top;
  145. }
  146. button, input, select, textarea {
  147. font-family: inherit;
  148. font-size: 100%;
  149. margin: 0;
  150. }
  151. textarea {
  152. padding: 8px;
  153. margin: 0px;
  154. word-wrap: break-word;
  155. display: inline-block;
  156. width: 100%;
  157. box-sizing: border-box;
  158. cursor: auto;
  159. max-width: 840px;
  160. border: 1px solid #ccc;
  161. }
  162. .redactor_box {
  163. border: 1px solid #D7EDFC;
  164. position: relative;
  165. overflow: hidden;
  166. }
  167. .dright .message-text {
  168. margin-right: 0px;
  169. background-color: #36a9fc;
  170. color: #fff;
  171. float: right;
  172. border-radius: 20px 0 0 20px;
  173. }
  174. .message-text {
  175. padding: 7px 15px;
  176. float: right;
  177. clear: both;
  178. position: relative;
  179. margin-bottom: 1px;
  180. font-size: 12px;
  181. }
  182. .dleft .message-text {
  183. margin-left: 0px;
  184. background-color: #e5e5ea;
  185. float: left;
  186. border-radius: 0 20px 20px 0;
  187. }
  188. </style>
22.08.2016 / 16:11
tnit2510
Bài đăng: 970
Member

code ảnh bìa wap lovemoon :3

22.08.2016 / 17:00
thanhtung698
Bài đăng: 687
Member
http://taolap.net

An share giup code thong báo tin nhắn mới chỉ 1 lần xem lần sau không thấy nữa, chỉ tới khi có tin nhan mới thì hiện