Wapbuilder in johncms

15 bài đăng
08.11.2015 / 11:12
thaian2009
Bài đăng: 709
Member

Hệ thống wapbuilder trong johncms.

Chức năng tạo Index. Chatbox. Chưa có online list và module khác.

Demo: http://www.abroths.tk -> Cài đặt -> Quản lý trang cá nhân

Trang đã tạo: http://www.abroths.tk/pages/pa ... uid=1

Hướng dẫn sử dụng mã Twig: http://www.abroths.tk/pages/pa ... =twig

/incfiles/classes/

Api.php

PHP
  1. <?php
  2. define('ROOTPATH', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
  3. use Symfony\Component\HttpFoundation\Request;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\HttpFoundation\Session\Session;
  6. require_once ROOTPATH .'incfiles/classes/Users.php';
  7. require_once ROOTPATH .'incfiles/classes/Forums.php';
  8. require_once ROOTPATH .'incfiles/Mobile_Detect.php';
  9.  
  10. class api
  11. {
  12. protected $request;
  13. public function __construct()
  14. {
  15. $this->request = Request::createFromGlobals();
  16. }
  17. public function r()
  18. {
  19. return $this->request;
  20. }
  21. public function f()
  22. {
  23. return new forums();
  24. }
  25. public function u()
  26. {
  27. return new users();
  28. }
  29. public function ses()
  30. {
  31. return $this->request->cookies->get("cups");
  32. }
  33. public function user_id()
  34. {
  35. return abs(intval($_SESSION['uid']));
  36. }
  37. public function cookies($name)
  38. {
  39. return $this->request->cookies->get($name);
  40. }
  41. public function redirect($url)
  42. {
  43. header("Location: " . $url);
  44. exit;
  45. return '';
  46. }
  47. public function device()
  48. {
  49. $detect = new Mobile_Detect;
  50. $deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
  51. return $deviceType;
  52. }
  53.  
  54.  
  55. }
  56. ?>

Users.php

PHP
  1. <?php
  2. require_once ROOTPATH .'incfiles/classes/Datax.php';
  3. class users
  4. {
  5. public function __construct()
  6. {
  7. }
  8. public function get($ids)
  9. {
  10. $user_id=abs(intval($_SESSION['uid']));
  11. if(!isset($ids))
  12. {
  13. $ids=$user_id;
  14. }
  15. $req = mysql_query("SELECT * FROM `users` WHERE `id` = '$ids'");
  16. if (mysql_num_rows($req)) {
  17. $user_data = mysql_fetch_assoc($req);
  18. }
  19. return new datax($user_data);
  20. }
  21. }
  22. ?>
Đã chỉnh sửa. MrKen (08.06.2016 / 01:28)
08.11.2015 / 11:51
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H

chúc team thành công :notok:

08.11.2015 / 12:01
thaian2009
Bài đăng: 709
Member
MrKen đã viết

chúc team thành công :notok:

tks Mr Ken. :D

08.11.2015 / 12:06
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H

trước cũng muốn làm wapbuilder nhưng làm 1 mình ko đủ sức :)

08.11.2015 / 12:34
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.

:yao1::ah:

08.11.2015 / 12:48
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H

quản lý phức tạp quá. dự là mod lại builder của ai đó chứ ko phải tự làm :49:

hoặc là team làm việc chưa thống nhất bàn bạc trước khi làm

làm đơn giản như wapego thôi

Đã chỉnh sửa. MrKen (08.11.2015 / 12:51)
08.11.2015 / 13:15
facebook
Bài đăng: 296
Member
Điếc không sợ súng

:like:

08.11.2015 / 13:59
thaian2009
Bài đăng: 709
Member

An thích như wapego vì nó dùng php còn như wapka thì chỉ dùng js.. Dùng Twig có thể tạo hàm mới dễ hơn.. còn cái dùng php hàm eval() thì phải cấm mấy hàm như ego

08.11.2015 / 15:18
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H

làm theo hướng wapego thì rất tốt :D, nhanh open cho ae có đất mới chơi :D

08.11.2015 / 15:25
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.
MrKen đã viết

làm theo hướng wapego thì rất tốt :D, nhanh open cho ae có đất mới chơi :D

:ah: