friend.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /*
  3. [UCenter] (C)2001-2099 Comsenz Inc.
  4. This is NOT a freeware, use is subject to license terms
  5. $Id: friend.php 1059 2011-03-01 07:25:09Z monkey $
  6. */
  7. !defined('IN_UC') && exit('Access Denied');
  8. class friendcontrol extends base {
  9. function __construct() {
  10. $this->friendcontrol();
  11. }
  12. function friendcontrol() {
  13. parent::__construct();
  14. $this->init_input();
  15. $this->load('friend');
  16. }
  17. function ondelete() {
  18. $uid = intval($this->input('uid'));
  19. $friendids = $this->input('friendids');
  20. $id = $_ENV['friend']->delete($uid, $friendids);
  21. return $id;
  22. }
  23. function onadd() {
  24. $uid = intval($this->input('uid'));
  25. $friendid = $this->input('friendid');
  26. $comment = $this->input('comment');
  27. $id = $_ENV['friend']->add($uid, $friendid, $comment);
  28. return $id;
  29. }
  30. function ontotalnum() {
  31. $uid = intval($this->input('uid'));
  32. $direction = intval($this->input('direction'));
  33. $totalnum = $_ENV['friend']->get_totalnum_by_uid($uid, $direction);
  34. return $totalnum;
  35. }
  36. function onls() {
  37. $uid = intval($this->input('uid'));
  38. $page = intval($this->input('page'));
  39. $pagesize = intval($this->input('pagesize'));
  40. $totalnum = intval($this->input('totalnum'));
  41. $direction = intval($this->input('direction'));
  42. $pagesize = $pagesize ? $pagesize : UC_PPP;
  43. $totalnum = $totalnum ? $totalnum : $_ENV['friend']->get_totalnum_by_uid($uid);
  44. $data = $_ENV['friend']->get_list($uid, $page, $pagesize, $totalnum, $direction);
  45. return $data;
  46. }
  47. }
  48. ?>