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

181 bài đăng
Tags:
22.08.2016 / 17:02
thaian2009
Bài đăng: 709
Member
chuotiube đã viết

code ảnh bìa wap lovemoon :3

Bước 1: Tạo trang upload ảnh ghi nhớ uid 6 số trang

Thêm shoutbox lịch sử ô 1:

TWIG
  1. <div class="phdr">Upload ảnh</div>
  2. <div class="menu">
  3. <button onclick="document.querySelector('#input_frm').click();return false;" id="up_info"><b>Upload ảnh bìa lên wap</b></button><input style="visibility: collapse; width: 0px;display:none" type="file" onchange="upload(this.files[0])" id="input_frm">
  4.  
  5.  
  6. </div>
  7. <script type="text/javascript">
  8. function upload(file) {
  9. if (!file || !file.type.match(/image.*/)) return;
  10. document.querySelector("#up_info").innerHTML='Đang upload ảnh..';
  11.  
  12. var fd = new FormData();
  13. fd.append("image", file);
  14. var xhr = new XMLHttpRequest()||new ActiveXObject("Microsoft.XMLHTTP")||new ActiveXObject("Msxml2.XMLHTTP");
  15. xhr.open("POST", "http://uploads.im/api?upload");
  16. xhr.onload = function() {
  17. document.querySelector("#up_info").innerHTML='Đã upload thành công^^';
  18. var link = JSON.parse(xhr.responseText);
  19. var slink=((link.data.thumb_url).replace('/t/','/d/'));
  20. var http = new XMLHttpRequest()||new ActiveXObject("Microsoft.XMLHTTP")||new ActiveXObject("Msxml2.XMLHTTP");
  21. var url = "main.php?[ses]&id=ch_topic_h&uid={{form_url|split('&uid=')[1][0:6]}}";
  22. var params = "text="+slink;
  23. http.open("POST", url, true);
  24. http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  25.  
  26. http.onreadystatechange = function() {
  27. if(http.readyState == 4 && http.status == 200) {
  28. window.location.href=window.location.href;
  29. }
  30. }
  31. http.send(params);
  32.  
  33. }
  34. xhr.send(fd);
  35. }
  36. </script>
  37. {{message_list}}

Ô 2:

TWIG
  1. <div class="list1">
  2. <img class="ava" src="{{message}}" style="max-height:360px">
  3. <form method="post" action="main.php?id=ch_topic_h&uid=230444&uuid=[user_id]&amp;back_url=%2Fuser_info.php%3Fuid%3D[user_id]"><input name="text" value="{{message}}" type="hidden"><input type="submit" class="topic cat_blue" style="margin-top:4px;padding:5px;" value="Chọn"></form>
  4. </div>

230444 là uid shoutbox trong thông tin người dùng

Bước 2:

Trong thông tin người dùng thêm shoutbox history để số tin nhắn là 1

Ô 1:

TWIG
  1. {%set u=api.u.get(api.r.get('uid'))%}
  2. <div class="phdr"><span class="{{u.levelCss}}">{{u.nick}}</span> - <a style="color:#fff" href="http://lovemoon.wap.mu/main.php?f=3527907"><i class="fa fa-arrow-circle-o-up"></i> Tải ảnh bìa</a> <span style="float:right"></span></div>
  3.  
  4. <div class="timeline-header-wrapper"> <div class="cover-container">
  5. <div class="cover-wrapper">
  6.  
  7.  
  8. <img src="{{message_list|default('http://vietkey.wap.mu/files/1049880/coveredit.png')}}" alt="cover" style="width:100%;max-height:360px">
  9.  
  10.  
  11.  
  12.  
  13. <div class="cover-progress"></div> </div>
  14.  
  15. <div class="avatar-wrapper">
  16. <img src="{{u.profilephotourl|replace({"ic=3":'ic=3&w=500&h=500',"preset_size=5":'preset_size=0',"m=3":'m=7',"m=5":'m=7',"ic=4":'ic=3&w=500&h=500'})}}" id="edit-avatar" data-id="24995457" alt="">
  17.  
  18. <div class="avatar-progress-wrapper"></div>
  19. </div> <div class="timeline-name-wrapper"> <div id="ava_abc"><span class="{{u.levelCss}}">{{u.nick|raw}}</span> </div>{%if "now"|date('U')-u.loged>=300%}<font color="red">OFF</font>{%else%}<font color="green"><img src="http://vietkey.wap.mu/files/1049880/online.png">Đang hoạt động</font>{%endif%}<div class="status_p"> {{u.name|default(u.nick|raw)|raw}}</div> </div>
  20. </div>
  21.  
  22. <div class="timeline-statistics-wrapper">
  23. <table border="0" width="100%" cellpadding="0" cellspacing="0">
  24. <tbody><tr>
  25. <td class="statistic" align="center" valign="middle">
  26. <a href="user_info.php?uid={{u.uid}}">Tường</a>
  27. </td>
  28. <td class="statistic" align="center" valign="middle">
  29. <a href="/user_info.php?uid={{u.uid}}&ref=info">Giới thiệu</a>
  30. </td>
  31.  
  32. <td class="statistic" align="center" valign="middle">
  33. <a href="/friends.php?id=user_friends&uid={{u.uid}}">Bạn bè</a>
  34. </td>
  35.  
  36. <td class="statistic" align="center" valign="middle">
  37. <a href="/user_info.php?uid={{u.uid}}&ref=album">Album ảnh</a>
  38. </td>
  39.  
  40. <td class="statistic" align="center" valign="middle">
  41. <a href="/user_info.php?uid={{u.uid}}&ref=character">Nhân vật</a>
  42. </td>
  43.  
  44. </tr>
  45. </tbody></table>
  46. </div>
  47. </div>

3527907 là uid trang up ảnh

Ô 2:

TWIG
  1. {{message}}

Style chung

TWIG
  1. <!--Album Ảnh-->
  2. <style type="text/css">
  3. img.ava {
  4. padding: 4px;
  5. background-color: #fff;
  6. border: 1px solid rgba(0,0,0,0.2);
  7. -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  8. -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  9. box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  10. -webkit-border-radius: 4px;
  11. -moz-border-radius: 4px;
  12. border-radius: 4px;
  13. }
  14.  
  15. .topic.cat_blue {
  16. background-color: #03A9F4;
  17. border: 1px solid #0288D1;
  18. color: #FFF;
  19. line-height: 14px;
  20. vertical-align: baseline;
  21. white-space: nowrap;
  22. padding: 1px 4px 2px;
  23. }
  24. .list1 {
  25. background-color: #fff;
  26. border: 1px solid #EFEFF0;
  27. margin: 0;
  28. padding: 3px 4px 4px;
  29. }
  30. .fa {
  31. display: inline-block;
  32. font: normal normal normal 14px/1 FontAwesome;
  33. font-size: inherit;
  34. text-rendering: auto;
  35. -webkit-font-smoothing: antialiased;
  36. -moz-osx-font-smoothing: grayscale;
  37. transform: translate(0, 0);
  38. }
  39. .fa-arrow-circle-o-up:before {
  40. content: "\f01b";
  41. }
  42. .cover-container, .cover-wrapper {
  43. position: relative;
  44. }
  45. .timeline-header-wrapper {
  46. background: #fff;
  47. margin: 0;
  48. padding: 0;
  49. }
  50.  
  51. .timeline-header-wrapper .timeline-name-wrapper {
  52. position: absolute;
  53. left: 190px;
  54. bottom: 7px;
  55. display: inline-block;
  56. color: rgba(255, 255, 255, .5);
  57. text-shadow: 0 0 3px rgba(0, 0, 0, .9);
  58. font-size: 19px;
  59. font-weight: 500;
  60. }
  61.  
  62.  
  63. #ava_abc {
  64. font-size: 16pt;
  65. font-weight: 600;
  66. color: white;
  67. margin-top: 6px;
  68. }
  69.  
  70.  
  71. .status_p {
  72. border: 2px #fff solid;
  73. position: relative;
  74. word-wrap: break-word;
  75. color: #FFF;
  76. font-weight: bold;
  77. padding: 1px;
  78. margin: 7px 3px 0 4px;
  79. font-size: small;
  80. opacity: 2;
  81. padding: 3px;
  82. background-color: rgba(255, 255, 255, 0.4);
  83. }
  84.  
  85. .status_p:after {
  86. content: '';
  87. display: block;
  88. position: absolute;
  89. top: -9px;
  90. left: 6px;
  91. width: 0;
  92. height: 0;
  93. border-color: transparent transparent #fff #FFFFFF;
  94. border-style: solid;
  95. border-width: 4px;
  96. }
  97.  
  98. .timeline-statistics-wrapper .statistic {
  99. background: #fff;
  100. font-weight: 500;
  101. padding: 10px 15px;
  102. border-right: 1px solid #e5e6e7;
  103. border-bottom: 2px solid #ffffff;
  104. height: 10px;
  105. }
  106. .timeline-statistics-wrapper .statistic:hover {
  107. border-bottom-color: #009688;
  108. }
  109. .timeline-header-wrapper .avatar-wrapper img {
  110. width: 155px;
  111. height: 155px;
  112. background: #fff;
  113. padding: 4px;
  114. border-radius: 100%;
  115. }
  116. .timeline-header-wrapper .avatar-wrapper {
  117. position: absolute;
  118. left: 15px;
  119. bottom: -27px;
  120. display: inline;
  121. border-radius: 100%;
  122. }
  123. .cover-wrapper {
  124. width: 100%;
  125. }
  126. .cover-container, .cover-wrapper {
  127. position: relative;
  128. }
  129.  
  130. .timeline-statistics-wrapper {
  131. padding-left: 182px;
  132. border-width: 0 1px 1px;
  133. border-style: solid;
  134. border-color: #d4d5d4;
  135. }
  136. .album_img{
  137. border: 1px solid #dcdcdc;
  138. border-radius: 2px;
  139. padding: 1px;
  140. box-shadow: 1px 1px 3px 1px #928686;
  141. background-color: #fff;
  142. }
  143. .phdr {
  144. background-color: #009688;
  145. border: 1px solid;
  146. border-color: #009688;
  147. padding: 5px;
  148. color: #fff;
  149. margin-top: 4px;
  150. }
  151. a:link, a:visited {
  152. color: #00796B;
  153. text-decoration: none;
  154. }
  155. .showlike {
  156. background-color: #fff;
  157. border: 1px solid;
  158. border-color: #E2E0E0;
  159. padding: 5px;
  160. margin-top: 5px;
  161. line-height: 1.5;
  162. }
  163. textarea {
  164. width: 99%;
  165. max-width: 640px;
  166. }
  167. .text_cmt {
  168. border-top: 1px solid #D7EDFC;
  169. color: #000;
  170. padding: 5px;
  171. background-color: #fff;
  172. }
  173. .avatar {
  174. margin: 2px;
  175. background: #fff;
  176. padding: 2px;
  177. border: 1px solid #EFEFEF;
  178. border-radius: 2px;
  179. }
  180. img {
  181. max-width: 100%;
  182. max-height: auto;
  183. }
  184. .box_info_cmt {
  185. background-color: #fff;
  186. border: 1px solid #D2D1D1;
  187. color: #34617e;
  188. margin-top: 4px;
  189. padding: 3px 4px;
  190. }
  191. .prefix.prefixRed {
  192. color: #fff;
  193. background-color: #FE4646;
  194. border-color: #F88;
  195. }
  196. .prefix {
  197. background: transparent url(http://nhanhnao.xy/images/form-button-white-25px.png) repeat-x top;
  198. padding: 0 4px;
  199. margin: 2px 0;
  200. border: 1px solid transparent;
  201. }
  202. .textarea {
  203. padding: 8px;
  204. margin: 0;
  205. word-wrap: break-word;
  206. display: inline-block;
  207. width: 100%;
  208. box-sizing: border-box;
  209. cursor: auto;
  210. border: 0 none;
  211. max-width: 896px;
  212. }
  213. @font-face {
  214. font-family: 'FontAwesome';
  215. src: url('http://fontawesome.io/assets/font-awesome/fonts/fontawesome-webfont.eot?v=4.6.3');
  216. src: url('http://fontawesome.io/assets/font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('http://fontawesome.io/assets/font-awesome/fonts/fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('http://fontawesome.io/assets/font-awesome/fonts/fontawesome-webfont.woff?v=4.6.3') format('woff'), url('http://fontawesome.io/assets/font-awesome/fonts/fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('http://fontawesome.io/assets/font-awesome/fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
  217. font-weight: normal;
  218. font-style: normal;
  219. }
  220. .wcontainer>.center div:not([class]), .hide, a[href='pm.php'], a[href='pm.php']+br, a[href$='id=menu'], a[href$='id=menu']+br, a[href$='id=forum_sets'], a[href$='id=forum_sets']+br, img[src$='bullet_blue.png'], .center a[href*='read='], .center a[href*='read=']+br, .center a[href*='id=add_post'], .center a[href*='id=add_post']+br, a[href*='id=t_online'], a[href*='id=t_online']+br, a[href*='id=t_online']+br+br, form[action='forums.php'], form[action='forums.php']+.left+.center, a[href='forums.php'], a[href='forums.php']+br, a[href="/main.php?"], a[href="main.php"]+br, a[href='main.php'], a[href*="id=forgot"]+br, a[href*='forums.php?id=online'], a[href*='forums.php?id=online']+br, a[href*='pm.php']+br, a[href*='pm.php']+br+br, .left:empty, form[action$="id=upload"]+br {
  221. display: none;
  222. }
  223. body, td, input, textarea {
  224. font-family: Arial,Tahoma,sans-serif;
  225. font-size: small;
  226. }
  227. body {
  228. background: #fff url(images/bckg_page.png) repeat 0 0;
  229. color: #000;
  230. margin: 0 auto;
  231. padding: 0;
  232. max-width: 800px;
  233. }
  234. * {
  235. box-sizing: border-box;
  236. }
  237. * {
  238. word-wrap: break-word;
  239. }
  240. .redactor_box {
  241. border: 1px solid #D7EDFC;
  242. border-bottom: none;
  243. position: relative;
  244. overflow: hidden;
  245. }
  246. .redactor_toolbar {
  247. background: url(/images/form-button-white-25px.png) repeat-x scroll center top #F0F7FC;
  248. padding: 0 0 0 2px;
  249. margin: 0;
  250. border-bottom: 1px solid #D7EDFC;
  251. position: relative;
  252. left: 0;
  253. top: 0;
  254. line-height: 0;
  255. list-style: outside none none;
  256. overflow: hidden;
  257. }
  258.  
  259. .redactor_btn_group {
  260. background: url(/images/form-button-white-25px.png) repeat-x scroll center top #F0F7FC;
  261. padding: 1px;
  262. margin: 0;
  263. border: 1px solid #D7EDFC;
  264. border-radius: 3px;
  265. overflow: hidden;
  266. box-shadow: 1px 1px 1px rgba(255,255,255,0.5);
  267. outline: medium none;
  268. list-style: none outside none;
  269. margin: 2px 2px 2px 2px;
  270. float: left;
  271. }
  272.  
  273.  
  274. ul {
  275. margin: 0;
  276. padding-left: 20px;
  277. }
  278. .body {
  279. background-color: #EBEBEC;
  280. padding: 4px;
  281. border: 1px solid #DEDEE0;
  282. box-shadow: 0 0 10px #343434;
  283. }
  284. nav.header {
  285. position: relative;
  286. top: 0;
  287. padding: 10px 15px;
  288. margin-bottom: 6px;
  289. background-color: #009688;
  290. border-color: #009688;
  291. box-shadow: -1px 0 13px 0 rgba(50,50,50,0.45);
  292. color: #fff;
  293. text-align: center;
  294. font-size: 20px;
  295. }
  296. .menu, .topmenu, .noti {
  297. background: #fff;
  298. -moz-border: 1px solid;
  299. border: 1px solid;
  300. -moz-border-color: #DCDBDB #CACACA;
  301. border-color: #DCDBDB #CACACA;
  302. border-top: none;
  303. padding: 6px;
  304. color: #00796B;
  305. margin-top: 0;
  306. }
  307. .title {
  308. background-color: #009688;
  309. border: 1px solid;
  310. border-color: #009688;
  311. padding: 5px;
  312. color: #fff;
  313. margin-top: 4px;
  314. text-align: left;
  315. }
  316. .footer-nhanhnao {
  317. background: #607D8B;
  318. border: 1px solid #46627F;
  319. color: #fff;
  320. margin-top: 4px;
  321. padding: 3px 0 4px 4px;
  322. text-align: center;
  323. }
  324. .button-up {
  325. background: #607D8B;
  326. border: 1px solid #fff;
  327. padding: 5px;
  328. margin: 3px;
  329. color: #fff;
  330. text-align: center;
  331. }
  332. .post:hover {
  333. background: #fe2f22;
  334. }
  335. .button:hover {
  336. background: #0079a5;
  337. }
  338. .post {
  339. background: #FE5F55;
  340. }
  341. .button {
  342. min-width: 15em;
  343. }
  344. .button {
  345. display: inline-block;
  346. font-family: "Montserrat","Trebuchet MS",Helvetica,sans-serif;
  347. -webkit-font-smoothing: antialiased;
  348. position: relative;
  349. padding: 6px;
  350. padding-right: 2em;
  351. background: #009ed8;
  352. border: none;
  353. color: #fff;
  354. transition: .2s;
  355. }
  356. .button:before {
  357. background: rgba(0,0,0,0.1);
  358. }
  359. .button:before, .button:after {
  360. position: absolute;
  361. top: 0;
  362. bottom: 0;
  363. right: 0;
  364. padding-top: inherit;
  365. padding-bottom: inherit;
  366. width: 2.5em;
  367. content: "^";
  368. font-family: 'FontAwesome',sans-serif;
  369. font-size: 1em;
  370. text-align: center;
  371. transition: .2s;
  372. }
  373.  
  374. .post:hover:after {
  375. -webkit-animation: bounceright .3s alternate ease infinite;
  376. animation: bounceright .3s alternate ease infinite;
  377. }
  378. .post:after {
  379. content: "^;
  380. }
  381. .button:before, .button:after {
  382. position: absolute;
  383. top: 0;
  384. bottom: 0;
  385. right: 0;
  386. padding-top: inherit;
  387. padding-bottom: inherit;
  388. width: 2.5em;
  389. content: "^";
  390. font-family: 'FontAwesome',sans-serif;
  391. font-size: 1em;
  392. text-align: center;
  393. transition: .2s;
  394. }
  395. @-webkit-keyframes bounceright{from{-webkit-transform:translateX(0)}to{-webkit-transform:translateX(3px)}}@-webkit-keyframes wiggle{from{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(30deg)}}@keyframes bounceright{from{transform:translateX(0)}to{transform:translateX(3px)}}@keyframes wiggle{from{transform:rotate(0deg)}to{transform:rotate(30deg)}}
  396.  
  397. </style>
Đã chỉnh sửa. thaian2009 (22.08.2016 / 17:03)
22.08.2016 / 17:12
thaian2009
Bài đăng: 709
Member
thanhtung698 đã viết

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

Mỗi người 1 code thôi =))

22.08.2016 / 17:25
thanhtung698
Bài đăng: 687
Member
http://taolap.net
thaian2009 đã viết

Mỗi người 1 code thôi =))

Hk có khuyến mãi ak :12:

22.08.2016 / 20:07
tnit2510
Bài đăng: 970
Member

k có code b1 à a. cái sb ở b1 là s -_-

22.08.2016 / 20:10
thaian2009
Bài đăng: 709
Member
chuotiube đã viết

k có code b1 à a. cái sb ở b1 là s -_-

Bước 1 có cái shoutbox thôi em

22.08.2016 / 20:30
tnit2510
Bài đăng: 970
Member
thaian2009 đã viết

Bước 1 có cái shoutbox thôi em

lỗi r a

22.08.2016 / 20:31
thaian2009
Bài đăng: 709
Member
chuotiube đã viết

lỗi r a

Nó báo lỗi hay dùng không được?

22.08.2016 / 20:38
tnit2510
Bài đăng: 970
Member
thaian2009 đã viết

Nó báo lỗi hay dùng không được?

k đổi đk ab vs cái style bị j r ă :))

22.08.2016 / 21:01
thaian2009
Bài đăng: 709
Member
chuotiube đã viết

k đổi đk ab vs cái style bị j r ă :))

Xóa cái này..http://lovemoon.wap.mu

style bình thường mà em

23.08.2016 / 15:35
saoko
Bài đăng: 1449
Member
MXH Vườn Cảm Xúc

Trong trường hợp thành viên đặt tên nick có ký tự uid= hay gì gì đó trùng với ký tự split thì code sẽ sai. Vậy có cách nào thật sự hoàn hảo khắc phục được trường hợp này ko?

Đã chỉnh sửa. saoko (23.08.2016 / 15:36)