function loaducenter() { require_once DISCUZ_ROOT.'./config/config_ucenter.php'; require_once DISCUZ_ROOT.'./uc_client/client.php'; }
loaducenter();
方法定义位置:
source\function\function_core.php
系统通知的方法、notification_add()
$content='刚才您的分享的技术资料:'.$file_name.'...,有收益到账。'.'<a href="##">点击查看详情</a>'; $content 支持html 代码哦~
$authorid 接收通知的uid,即发给谁;
notification_add($touid, $type, $note, $notevars = array(), $system = 0)
notification_add(
$authorid
,
'system'
,
$content
,
1
);
获取到消息列表
uc_pm_list($uid, $page = 1, $pagesize = 10, $folder = 'inbox', $filter = 'newpm', $msglen = 0)
判断是否有新的消息
uc_pm_checknew($_G['uid'], 1)
- //新短消息
- loaducenter();//这个必须加上否则会报错,这个是用来调用Ucenter相关函数信息
- $arr = uc_pm_checknew($_G['uid'],1);
发送消息
loaducenter();//这个必须加上否则会报错,这个是用来调用Ucenter相关函数信息sendpm( $toid , $subject , $message , $fromid = '' , $replypmid = 0, $isusername = 0, $type = 0)
sendpm($touid, $subject, $message, $formuid, 0, 0, $type)
参数含义:
其中有四个参数,前三个为必填参数,最后一个为可选参数;
$toid参数是接收短消息的用户uid;($toid为0时,消息类型为公共消息)
$subject参数是短消息的标题;
$message个参数是短消息的正文内容(不支持HTML);
$fromid个参数是发送短消息的用户uid;($fromid为0时,消息类型为系统消息)