📄 client.php
字号:
if($limit) {
$limit -= strlen($data);
$stop = $limit <= 0;
}
}
}
@fclose($fp);
return $return;
}
}
function uc_app_ls() {
$return = call_user_func(UC_API_FUNC, 'app', 'ls', array());
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_feed_add($icon, $uid, $username, $title_template='', $title_data='', $body_template='', $body_data='', $body_general='', $target_ids='', $images = array()) {
call_user_func(UC_API_FUNC, 'feed', 'add',
array( 'icon'=>$icon,
'appid'=>UC_APPID,
'uid'=>$uid,
'username'=>$username,
'title_template'=>$title_template,
'title_data'=>$title_data,
'body_template'=>$body_template,
'body_data'=>$body_data,
'body_general'=>$body_general,
'target_ids'=>$target_ids,
'image_1'=>$images[0]['url'],
'image_1_link'=>$images[0]['link'],
'image_2'=>$images[1]['url'],
'image_2_link'=>$images[1]['link'],
'image_3'=>$images[2]['url'],
'image_3_link'=>$images[2]['link'],
'image_4'=>$images[3]['url'],
'image_4_link'=>$images[3]['link']
)
);
}
function uc_feed_get($limit = 100) {
$return = call_user_func(UC_API_FUNC, 'feed', 'get', array('limit'=>$limit));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_friend_add($uid, $friendid, $comment='') {
return call_user_func(UC_API_FUNC, 'friend', 'add', array('uid'=>$uid, 'friendid'=>$friendid, 'comment'=>$comment));
}
function uc_friend_delete($uid, $friendids) {
return call_user_func(UC_API_FUNC, 'friend', 'delete', array('uid'=>$uid, 'friendids'=>$friendids));
}
function uc_friend_totalnum($uid, $direction = 0) {
return call_user_func(UC_API_FUNC, 'friend', 'totalnum', array('uid'=>$uid, 'direction'=>$direction));
}
function uc_friend_ls($uid, $page = 1, $pagesize = 10, $totalnum = 10, $direction = 0) {
$return = call_user_func(UC_API_FUNC, 'friend', 'ls', array('uid'=>$uid, 'page'=>$page, 'pagesize'=>$pagesize, 'totalnum'=>$totalnum, 'direction'=>$direction));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_user_register($username, $password, $email) {
return call_user_func(UC_API_FUNC, 'user', 'register', array('username'=>$username, 'password'=>$password, 'email'=>$email));
}
function uc_user_login($username, $password, $isuid=0) {
$isuid = intval($isuid);
$return = call_user_func(UC_API_FUNC, 'user', 'login', array('username'=>$username, 'password'=>$password, 'isuid'=>$isuid));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_user_synlogin($uid) {
return uc_api_post('user', 'synlogin', array('uid'=>$uid));
}
function uc_user_synlogout() {
return uc_api_post('user', 'synlogout', array('uid'=>$uid));
}
function uc_user_edit($username, $oldpw, $newpw, $email, $ignoreoldpw = 0) {
return call_user_func(UC_API_FUNC, 'user', 'edit', array('username'=>$username, 'oldpw'=>$oldpw, 'newpw'=>$newpw, 'email'=>$email, 'ignoreoldpw'=>$ignoreoldpw));
}
function uc_user_delete($uid) {
return call_user_func(UC_API_FUNC, 'user', 'delete', array('uid'=>$uid));
}
function uc_user_checkname($username) {
return call_user_func(UC_API_FUNC, 'user', 'check_username', array('username'=>$username));
}
function uc_user_checkemail($email) {
return call_user_func(UC_API_FUNC, 'user', 'check_email', array('email'=>$email));
}
function uc_user_addprotected($username, $admin='') {
return call_user_func(UC_API_FUNC, 'user', 'addprotected', array('username'=>$username, 'admin'=>$admin));
}
function uc_user_deleteprotected($username) {
return call_user_func(UC_API_FUNC, 'user', 'deleteprotected', array('username'=>$username));
}
function uc_user_getprotected() {
$return = call_user_func(UC_API_FUNC, 'user', 'getprotected', array('1'=>1));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_get_user($username, $isuid=0) {
$return = call_user_func(UC_API_FUNC, 'user', 'get_user', array('username'=>$username, 'isuid'=>$isuid));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_user_merge($oldusername, $newusername, $uid, $password, $email) {
return call_user_func(UC_API_FUNC, 'user', 'merge', array('oldusername'=>$oldusername, 'newusername'=>$newusername, 'uid'=>$uid, 'password'=>$password, 'email'=>$email));
}
function uc_pm_location($uid, $newpm = 0) {
$apiurl = uc_api_url('pm_client', 'ls', "uid=$uid", ($newpm ? '&folder=newbox' : ''));
@header("Expires: 0");
@header("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
@header("location: $apiurl");
}
function uc_pm_checknew($uid) {
return call_user_func(UC_API_FUNC, 'pm', 'check_newpm', array('uid'=>$uid));
}
function uc_pm_send($fromuid, $msgto, $subject, $message, $instantly = 1, $replypmid = 0, $isusername = 0) {
if($instantly) {
$replypmid = @is_numeric($replypmid) ? $replypmid : 0;
return call_user_func(UC_API_FUNC, 'pm', 'sendpm', array('fromuid'=>$fromuid, 'msgto'=>$msgto, 'subject'=>$subject, 'message'=>$message, 'replypmid'=>$replypmid, 'isusername'=>$isusername));
} else {
$fromuid = intval($fromuid);
$subject = urlencode($subject);
$msgto = urlencode($msgto);
$message = urlencode($message);
$replypmid = @is_numeric($replypmid) ? $replypmid : 0;
$replyadd = $replypmid ? "&pmid=$replypmid&do=reply" : '';
$apiurl = uc_api_url('pm_client', 'send', "uid=$fromuid", "&msgto=$msgto&subject=$subject&message=$message$replyadd");
@header("Expires: 0");
@header("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
@header("location: ".$apiurl);
}
}
function uc_pm_delete($uid, $folder, $pmids) {
return call_user_func(UC_API_FUNC, 'pm', 'delete', array('uid'=>$uid, 'folder'=>$folder, 'pmids'=>$pmids));
}
function uc_pm_list($uid, $page = 1, $pagesize = 10, $folder = 'inbox', $filter = 'newpm', $msglen = 0) {
$uid = intval($uid);
$page = intval($page);
$pagesize = intval($pagesize);
$return = call_user_func(UC_API_FUNC, 'pm', 'ls', array('uid'=>$uid, 'page'=>$page, 'pagesize'=>$pagesize, 'folder'=>$folder, 'filter'=>$filter, 'msglen'=>$msglen));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_pm_ignore($uid) {
$uid = intval($uid);
return call_user_func(UC_API_FUNC, 'pm', 'ignore', array('uid'=>$uid));
}
function uc_pm_view($uid, $pmid) {
$uid = intval($uid);
$pmid = @is_numeric($pmid) ? $pmid : 0;
$return = call_user_func(UC_API_FUNC, 'pm', 'view', array('uid'=>$uid, 'pmid'=>$pmid));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_pm_viewnode($uid, $type = 0, $pmid = 0) {
$uid = intval($uid);
$pmid = @is_numeric($pmid) ? $pmid : 0;
$return = call_user_func(UC_API_FUNC, 'pm', 'viewnode', array('uid'=>$uid, 'pmid'=>$pmid, 'type'=>$type));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_pm_blackls_get($uid) {
$uid = intval($uid);
return call_user_func(UC_API_FUNC, 'pm', 'blackls_get', array('uid'=>$uid));
}
function uc_pm_blackls_set($uid, $blackls) {
$uid = intval($uid);
return call_user_func(UC_API_FUNC, 'pm', 'blackls_set', array('uid'=>$uid, 'blackls'=>$blackls));
}
function uc_domain_ls() {
$return = call_user_func(UC_API_FUNC, 'domain', 'ls', array('1'=>1));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_credit_exchange_request($uid, $from, $to, $toappid, $amount) {
$uid = intval($uid);
$from = intval($from);
$toappid = intval($toappid);
$to = intval($to);
$amount = intval($amount);
return uc_api_post('credit', 'request', array('uid'=>$uid, 'from'=>$from, 'to'=>$to, 'toappid'=>$toappid, 'amount'=>$amount));
}
function uc_tag_get($tagname, $nums = 0) {
$return = call_user_func(UC_API_FUNC, 'tag', 'gettag', array('tagname'=>$tagname, 'nums'=>$nums));
return UC_CONNECT == 'mysql' ? $return : uc_unserialize($return);
}
function uc_avatar($uid) {
$uid = intval($uid);
$uc_input = uc_api_input("uid=$uid");
$uc_avatarflash = UC_API.'/images/camera.swf?inajax=1&appid='.UC_APPID.'&input='.$uc_input.'&agent='.md5($_SERVER['HTTP_USER_AGENT']).'&ucapi='.urlencode(UC_API);
return '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9" width=447 height=477 id="mycamera"><param name="movie" value="'.$uc_avatarflash.'"><param name="quality" value="high"><param name="menu" value="false"><embed src="'.$uc_avatarflash.'" quality="high" menu="false" width="447" height="477" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" name="mycamera" swLiveConnect="true"></embed></object>';
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -