<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>UCenter 接口开发手册 - 短消息接口</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="images/style.css" type="text/css" media="all" />
<meta content="Comsenz Inc." name="Copyright" />
<script type="text/javascript" src="javascript/common.js"></script>
</head>
<body>
<script type="text/javascript" src="javascript/header.js"></script>
<a name="location"></a>
<h3>进入短消息中心</h3>
<div class="submsg">
<h4>uc_pm_location(<i>integer</i> uid , <i>bool</i> newpm)</h4>
<h5>函数参数</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th>参数</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th><i>integer</i> uid</th>
<td>用户 ID</td>
</tr>
<tr>
<th><i>bool</i> newpm</th>
<td>
是否直接查看未读短消息<br />
<em>1:</em>是<br />
<em>0:</em><strong>(默认值)</strong> 否<br />
</td>
</tr>
</tbody>
</table>
<br />
本接口函数运行后会发送一个 header 的 location 请求,使当前页面跳转到短消息中心。所以请不要在这个函数运行前后有任何的输出性的代码。如果 newpm 为 1 则进入短消息中心后,会默认打开新件箱。
<h6><a href="###" class="spread" onclick="collapse(this, 's1')">进入短消息中心示例 (PHP)</a></h6>
<div class="code" id="s1" style="display: none"><pre>
<?php
uc_pm_location($uid);
?>
</pre></div>
</div>
<a name="checknew"></a>
<h3>检查新的短消息</h3>
<div class="submsg">
<h4><i>bool/array</i> uc_pm_checknew(<i>integer</i> uid [, <i>bool</i> more])</h4>
<h5>函数参数</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th>参数</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th><i>integer</i> uid</th>
<td>用户 ID</td>
</tr>
<tr>
<th><i>bool</i> more</th>
<td>是否显示更多信息<br />
<em>2:</em>返回短消息数、最后消息时间, 最后消息内容<br />
<em>1:</em>返回短消息数、最后消息时间<br />
<em>0:</em><strong>(默认值)</strong> 只返回短消息数<br />
</td>
</tr>
</tbody>
</table>
<h5>返回值 (当 more = 0 时)</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th>值</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th><i>integer</i></th>
<td>未读消息数</td>
</tr>
</tbody>
</table>
<h5>返回值 (当 more = 1 时)</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th colspan="2">值</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="2"><i>array</i></th>
<th><i>integer</i> ['newpm']</th>
<td>未读消息数</td>
</tr>
<tr>
<th><i>integer</i> ['newprivatepm']</th>
<td>私人消息数</td>
</tr>
</tbody>
</table>
<h5>返回值 (当 more = 2 时)</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th colspan="2">值</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="4"><i>array</i></th>
<th><i>integer</i> ['newpm']</th>
<td>未读消息数</td>
</tr>
<tr>
<th><i>integer</i> ['newprivatepm']</th>
<td>私人消息数</td>
</tr>
<tr>
<th><i>integer</i> ['newchatpm']</th>
<td>群聊消息数</td>
</tr>
</tbody>
</table>
<h5>返回值 (当 more = 3 时)</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th colspan="2">值</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th rowspan="8"><i>array</i></th>
<th><i>integer</i> [newpm]</th>
<td>未读消息数</td>
</tr>
<tr>
<th><i>integer</i> ['newprivatepm']</th>
<td>私人消息数</td>
</tr>
<tr>
<th><i>integer</i> ['newchatpm']</th>
<td>群聊消息数</td>
</tr>
<tr>
<th><i>integer</i> ['lastdate']</th>
<td>最后消息时间</td>
</tr>
<tr>
<th><i>integer</i> ['lastmsgfromid']</th>
<td>最后消息发件人 ID</td>
</tr>
<tr>
<th><i>string</i> ['lastmsgfrom']</th>
<td>最后消息发件人用户名</td>
</tr>
<tr>
<th><i>string</i> ['lastmsg']</th>
<td>最后消息内容</td>
</tr>
</tbody>
</table>
<br />
本接口函数会检查指定用户是否有新的短消息。
<h6><a href="###" class="spread" onclick="collapse(this, 's2')">检查新短消息示例 (PHP)</a></h6>
<div class="code" id="s2" style="display: none"><pre>
if(uc_pm_checknew($uid)) {
echo "您有新短消息";
}
</pre></div>
</div>
<a name="send"></a>
<h3>发送短消息</h3>
<div class="submsg">
<h4><i>integer</i> uc_pm_send(<i>integer</i> fromuid , <i>string</i> msgto , <i>string</i> subject , <i>string</i> message [, <i>bool</i> instantly , <i>integer</i> replypmid , <i>bool</i> isusername , <i>integer</i> type])</h4>
<h5>函数参数</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th>参数</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th><i>integer</i> fromuid</th>
<td>发件人用户 ID</td>
</tr>
<tr>
<th><i>string</i> msgto</th>
<td>收件人用户名 / 用户 ID,多个用逗号分割</td>
</tr>
<tr>
<th><i>string</i> subject</th>
<td>消息标题</td>
</tr>
<tr>
<th><i>string</i> message</th>
<td>消息内容</td>
</tr>
<tr>
<th><i>bool</i> instantly</th>
<td>
是否直接发送<br />
<em>1:</em><strong>(默认值)</strong> 直接发送消息<br />
<em>0:</em>进入发送短消息的界面<br />
</td>
</tr>
<tr>
<th><i>integer</i> replypid</th>
<td>
回复的消息 ID<br />
<em>大于 0:</em>回复指定的短消息<br />
<em>0:</em><strong>(默认值)</strong> 发送新的短消息<br />
</td>
</tr>
<tr>
<th><i>bool</i> isusername</th>
<td>
msgto 参数是否为用户名<br />
<em>1:</em>msgto 参数为用户名<br />
<em>0:</em><strong>(默认值)</strong> msgto 参数为用户 ID<br />
</td>
</tr>
<tr>
<th><i>integer</i> type</th>
<td>
消息类别<br />
<em>1:</em>群聊消息<br />
<em>0:</em><strong>(默认值)</strong>私人消息<br />
</td>
</tr>
</tbody>
</table>
<h5>返回值</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th>值</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th><i>integer</i></th>
<td>
<em>大于 0:</em>发送成功的最后一条消息 ID<br />
<em>0:</em>发送失败<br />
<em>-1:</em>超过两人会话的最大上限<br />
<em>-2:</em>超过两次发送短消息时间间隔<br />
<em>-3:</em>不能给非好友批量发送短消息(已废弃)<br />
<em>-4:</em>目前还不能使用发送短消息功能(注册多少日后才可以使用发短消息限制)<br />
<em>-5:</em>超过群聊会话的最大上限<br />
<em>-6:</em>在忽略列表中<br />
<em>-7:</em>超过群聊人数上限<br />
<em>-8:</em>不能给自己发短消息<br />
<em>-9:</em>收件人为空<br />
<em>-10:</em>发起群聊人数小于两人<br />
</td>
</tr>
</tbody>
</table>
<br />
本接口函数用于发送短消息。当 instantly 为 1 时,短消息会直接发送出去,否则本函数会发送一个 header 的 location 请求,使当前页面跳转到短消息中心的发送短消息页面。因此,当 instantly 为 0 时请不要在这个函数运行前后有任何的输出性的代码。type 为 1 时为发送群聊消息。msgto 默认为用户 ID,如果要让用户名作为参数,可让 isusername 为 1。replypid 为 0 表示发送的短消息为短消息话题的发起者,如果 replypid 为指定的消息 ID 则表示发送的短消息为回复指定短消息话题的回复信息。如果 instantly 为 1,那么发送成功后函数返回发送成功的最后一条消息 ID,返回 0 表示发送失败。
<h6><a href="###" class="spread" onclick="collapse(this, 's3')">发送短消息示例 (PHP)</a></h6>
<div class="code" id="s3" style="display: none"><pre>
if(uc_pm_send($uid, $_POST['msgto'], $_POST['subject'], $_POST['message'])) {
echo "短消息发送成功";
}
</pre></div>
</div>
<a name="delete"></a>
<h3>删除短消息</h3>
<div class="submsg">
<h4><i>integer</i> uc_pm_delete(<i>integer</i> uid , <i>string</i> folder , <i>array</i> pmids)</h4>
<h5>函数参数</h5>
<table border="0" cellspacing="0" cellpadding="0" class="msgtable">
<thead>
<tr>
<th>参数</th>
<td>含义</td>
</tr>
</thead>
<tbody>
<tr>
<th><i>integer</i> uid</th>
<td>用户 ID</td>
</tr>
<tr>
<th><i>string</i> folder</th>
<td>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ucenter接口帮助文档.rar (37个子文件)
html
pm.htm 29KB
user.htm 22KB
mail.htm 3KB
images
avatar.jpg 30KB
error.gif 158B
headbg.gif 170B
navbg.gif 104B
menubg.gif 1KB
listicon.gif 82B
spread.gif 309B
shrink.gif 313B
Thumbs.db 25KB
citeicon.gif 333B
helplogo.gif 5KB
arrowr.gif 52B
correct.gif 147B
intro.gif 15KB
codeicon.gif 407B
style.css 7KB
wrapbg.gif 53B
bg_repx.gif 314B
bg_repy.gif 167B
function.htm 2KB
avatar.htm 5KB
structure.htm 4KB
index.htm 2KB
feed.htm 8KB
example.htm 3KB
javascript
header.js 402B
footer.js 221B
common.js 3KB
friend.htm 6KB
api.htm 20KB
tag.htm 3KB
app.htm 2KB
credit.htm 2KB
index.htm 658B
共 37 条
- 1
zhouzhibin1001
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页