Beispiel #1
0
function set_bind($mediaUID, $uid = '', $uname = '', $uemail = '')
{
    $wptm_basic = get_option("wptm_basic");
    class_exists('Denglu') or (require dirname(__FILE__) . "/class/Denglu.php");
    $api = new Denglu($wptm_basic['appid'], $wptm_basic['appkey'], 'utf-8');
    if ($uid) {
        try {
            $ret = $api->bind($mediaUID, $uid, $uname, $uemail);
        } catch (DengluException $e) {
        }
    } else {
        try {
            $ret = $api->unbind($mediaUID);
        } catch (DengluException $e) {
        }
    }
    return $ret;
}
Beispiel #2
0
    }
}
/*
 *发送绑定请求
 */
try {
    $result = $api->bind($mediaUID, $uid, $uname, $uemail);
    var_dump($result);
} catch (DengluException $e) {
    //处理办法同上
}
/*
 *发送解除绑定请求
 */
try {
    $result = $api->unbind($mediaUID);
    var_dump($result);
} catch (DengluException $e) {
    //处理办法同上
}
/*
 *获取网站可用的媒体信息
 */
try {
    $result = $api->getMedia();
    var_dump($result);
} catch (DengluException $e) {
    //处理办法同上
}
/*
 *推送媒体用户登录新鲜事