load->model('sns_model');$this->sns_model->following(TA的uid, 我的uid);二、參數值參數介紹$ta關注Ta的uid$uid我的Uid三、返回值 0 關注失敗 1 關注成功 2 相互關注-1 ... PHP開源內容管理系統(PhpOpenSourceCMS簡稱POSCMS)是Php+Mysql開發的一款開源的跨平臺網站內容管理系統,程序無加密代碼,非常適合二次開發的CMS系統" />

ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

一、調用方式

$this->load->model('sns_model'); //引用時需要加載sns模型類,只加載一次即可
$this->sns_model->following($ta_uid, $my_uid);


二、參數值

參數
介紹
$ta_uid關注Ta的uid
$my_uid我的Uid


三、返回值

 0    關注失敗

 1    關注成功

 2    相互關注

-1    取消關注


四、開發示例

1、通過類方法的方式來關注

// 
....
public function guanzhu($ta_uid, $my_uid) {
    $this->load->model('sns_model');
    $rt = $this->sns_model->following($ta_uid, $my_uid);
    if ($rt == 1) {
        return '關注成功';
    } elseif ($rt == 2) {
        return '相互關注';
    } elseif ($rt == -1) {
        return '取消關注';
    } else {
        return '關注失敗';
    }
}
......

2、通過url方式來關注

創建文件/member/controllers/guanzhu.php

 
class Guanzhu extends M_Controller {
    
    public function __construct() {
        parent::__construct();
    }
    
    public function index() {
        $ta_uid = $this->input->get('uid');
        if (!$this->uid) {
            $this->member_msg('您尚未登錄,無法關注對方');
        }
        $this->load->model('sns_model');
        $rt = $this->sns_model->following($ta_uid, $this->uid);
        if ($rt == 1) {
            $this->member_msg('關注成功', '', 1);
        } elseif ($rt == 2) {
            $this->member_msg('相互關注', '', 1);
        } elseif ($rt == -1) {
            $this->member_msg('取消關注', '', 1);
        } else {
            $this->member_msg('關注失敗');
        }
    }
}

關注鏈接為:{MEMBER_URL}index.php?c=guanzhu&uid={關注對象的uid}

文檔最后更新時間:2014-12-28 15:13:12