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