into the short message center

uc_pm_location(integer uid , bool newpm)

function parameters
parameter meaning
integer uid User ID
bool newpm Whether direct view unread PM
1: Yes
0: (Default value) No

After running this interface function of the location will send a header request to the current page Jump to the short message center. So please do not run around in the function of any of the output of the code. If newpm short message to an access center, will open a new document the default box.
short message center sample (PHP)

check for new PMs

bool/array uc_pm_checknew(integer uid [, bool more])

function parameters
parameter meaning
integer uid User ID
bool more whether to display more information
2: return the number of short messages, the number of public messages, last message time, last message content
1: return the number of short messages, the number of public messages, last message time
0: (Default value) only returns the number of short message
return value (when more = 0 )
value meaning
integer number of unread messages
return value (when more = 1)
value meaning
array integer ['newpm'] number of unread messages
integer ['newprivatepm'] New private messages
return value (when more = 2 )
value meaning
array integer ['newpm'] number of unread messages
integer ['newprivatepm'] New private messages
integer ['newchatpm'] number of chat messages
return value (when more = 3 )
value meaning
array integer [newpm] number of unread messages
integer ['newprivatepm'] number of new private messages
integer ['newchatpm'] number of group chat messages
integer ['lastdate'] last message time
integer ['lastmsgfromid'] Last Message Sender ID
string ['lastmsgfrom'] last message sender user name
string ['lastmsg'] last message content

The interface function checks whether the user has specified a new short message.
check for new short message example (PHP)

send text messages

integer uc_pm_send(integer fromuid , string msgto , string subject , string message [, bool instantly , integer replypmid , bool isusername , integer type])

function parameters
parameter meaning
integer fromuid Sender user ID, 0 for the system message
string msgto recipient user name / User ID, a number with a comma separated
string subject Message Title
string message message content
bool instantly Whether directly
1: (default value) Send a message directly to
0: into the interface to send short messages
integer replypid Reply to the message ID
greater than 0: return the specified short message
0: (default value) to send a new short message
bool isusername msgto parameter is the user name
1: msgto parameters for the user name
0: (default value) msgto parameters for user ID
integer type Message type
1:Group chat message
0: (Default) Private Message
Return value
value meaning
integer greater than 0: the last message sent successfully ID
0: send failed
-1: than the 24-hour maximum allowable number of text messages sent
-2: send a short message does not meet the minimum interval of two
-3: to non-friends can not send bulk SMS
-4: is still not use to send a short message function (the number of days after registration you can use the Send PM limit)
-5:Group chat sessions exceed the maximum limit
-6:In the ignore list
-7:exceed the group chat maximum number of messages
-8:Can not send message to yourself
-9:Recipient is empty
-10:Initiated group chat number is less than two

This interface function is used to send short messages. When instantly to 1, the short message will be sent directly, otherwise, the function of the location request to send a header to the current page Jump to the short message center to send a short message page. Therefore, when instantly to 0 when you do not have any before and after running this function the output of the code. fromuid to 0 to send system messages. msgto default user ID, if you want the user name as a parameter, allowing isusername 1. replypid to 0 to send a short message to the initiator of the short message subject, if replypid for the specified message ID is said to send a short message to reply to the specified topic in the reply SMS message. If you instantly to 1, then the send function returns after the success of the last message sent successfully ID, return 0 send failed.
send a short message example (PHP)

Delete short message

integer uc_pm_delete(integer uid , string folder , array pmids)

function parameters
parameter meaning
integer uid User ID
string folder where folder may be:
inbox: PM Inbox
outbox: PM Outbox
array pmids message ID array
Return value
value meaning
integer deleted PM number

The interface function will delete the specified folder in the specified message ID of the short message. pmids parameter is an array of free Key type, such as "array (1, 2, 3, 4, 5 ...)", array values are each message ID. Delete a short message each other remove the state will be conducted UCenter detection, if the short message is deleted the other state, then the current message will be deleted in the database, or delete only record a mark.
Remove short message example (PHP)

integer uc_pm_deleteuser(integer uid , array touids)

function parameters
parameter meaning
integer uid User ID
array touids other user ID array
Return value
value meaning
integer deleted PM number

This function will delete and uid interface, the dialogue touids all the short message.

uc_pm_deletechat(integer uid , array plids [, bool type])

Function parameters
Parameter Meaning
integer uid User ID
array plids Array of message ID to delete
bool type Type
0: (Default) Exit the group chat
1:Delete the Group Chat

The interface function is used to exit the Group Chat message, and delete. plids parameter is a free Key array type, Such as "array(1, 2, 3, 4, 5 ...)", Each array value is ID.

Mark PM state as read/unread

uc_pm_readstatus(integer uid , array uids [, array plids, bool status])

function parameters
Parameter Meaning
integer uid User ID
array uids to the other user ID tag array
array pmids the message ID array to mark, the default value is an empty array
bool status To mark the state of
0: (default value) mark as read
1: mark as unread

This interface function is used to mark short messages status as read/unread. uids and plids parameter is an array of free Key type, such as "array (1, 2, 3, 4, 5 ...)", the value of each array are ID.
short message states labeled sample (PHP)

Get PM list

array uc_pm_list(integer uid [, integer page , integer pagesize , string folder , string filter, integer msglen])

function parameters
parameter meaning
integer uid User ID
integer page the current page number, default value 1
integer pagesize the maximum number of entries per page, the default value 10
string folder Where folder mau be:
newbox: New Inbox
inbox: (default value) Inbox
outbox: Outbox
string filter Filtering
newpm: (default value) unread messages, folder for the inbox and outbox used
integer msglen interception of the contents of text short message length, 0 for no interception, the default value of 0
Return value
value meaning
array integer ['count'] Total messages
array ['data'] List of short message data. See the message list array structure Table 1.

This interface function is used to access the specified folder, a list of short messages. Function has built-in paging, directly through the page and pagesize flip can be achieved.

Ignore the unread message prompts

uc_pm_ignore(integer uid)

Function parameters
parameter meaning
integer uid User ID

Ignore this interface function is used to direct the short message is not read cue.

View short message content

array uc_pm_view(integer uid , integer pmid [, integer touid , integer daterange , integer page , integer pagesize , integer type , integer isplid])

function parameters
parameter meaning
integer uid User ID
integer pmid message ID
integer touid message to other User ID
integer daterange date range
1: (default value) today
2: yesterday
3: the day before yesterday
4: last week
5: earlier
integer page Current Page
integer pagesize The maximum number of pages
integer type Message type 1: Private Message, 2: Group Chat message
integer isplid touid Parameter is the session id Or user id
Return value
value meaning
array short message content data. See a single message array structure Table 2

This interface function is used to return the specified user specified message ID of the message, the returned data contains a message for this response. If you specify touid parameter, then the short message will list all the uid and touid short message between, daterange return message can specify a date range.

Find the session number of messages

integer uc_pm_view_num(integer uid , integer touid , bool isplid)

Function parameters
Parameter Meaning
integer uid User ID
integer touid Find the session ID or user ID
bool isplid touid parameter is the session ID or user ID
Return Value
Value Meaning
integer The number of messages for the specified session

Find the number of session message example (PHP)

Get a single short message content

integer uc_pm_viewnode(integer uid , integer type , integer pmid)

function parameters
parameter meaning
integer uid User ID
integer type Message type
0: Specify a single message
integer pmid message ID
Return value
value meaning
array Message content data. See a single message array structure Table 2

Find a group chat member list

integer uc_pm_chatpmmemberlist(integer uid , integer plid)

Function parameters
Parameter Meaning
integer uid User ID
integer plid Group chat session ID
Return Value
Value Meaning
array Returns a list of the group chat members, see Table 3

Kick out Members of group chat

integer uc_pm_kickchatpm(integer plid , integer uid , integer touid)

Function parameters
Parameter Meaning
integer plid Session ID
integer uid User ID
integer touid Kick out the user ID
Return Value
Value Meaning
integer 1: kicked successfully, 2: kick failed

Add members to the group chat

integer uc_pm_appendchatpm(integer plid , integer uid , integer touid)

Function Parameters
Parameter Meaning
integer plid Session ID
integer uid User ID
integer touid Added User ID
Return Value
Value Meaning
integer 1: Added ok, 2: Add failure

get blacklist

string uc_pm_blackls_get(integer uid)

function parameters
parameter meaning
integer uid User ID
Return value
value meaning
string blacklist data

The interface function returns the user to set the contents of the blacklist.
for black sample (PHP)

updat blacklist

bool uc_pm_blackls_set(integer uid , string blackls)

function parameters
parameter meaning
integer uid User ID
string blackls blacklist
Return value
value meaning
bool 1: updated successfully
0: update failed

This function is used to update the user interface to the blacklist list data. Set blacklist, the blacklist of the staff will not be able to send a short message to the uid specified user. The staff ignored the blacklist with a user name that, when more than ignore list of comma "," to separate (example: Joe Smith, John Doe, Wang V), For ban all users sent a short message, with "(ALL)" said.
update blacklist example (PHP)

Add blacklist entry

bool uc_pm_blackls_add(integer uid , array username)

Function parameters
parameter meaning
integer uid User ID
array username user name array
Return value
value meaning
bool 1: added successfully
0: Add failed

The interface to the user's blacklist function is used to add items. For all user settings screen to add, please let username array contains "{ALL}"
Add member to blacklist example (PHP)

Remove from blacklist

uc_pm_blackls_delete(integer uid , array username)

function parameters
parameter meaning
integer uid User ID
array username user name array

This interface function is used to delete the user from blacklist. For all users to delete the settings screen, please let username array contains "{ALL}"
Add to blacklist example (PHP)

Table 1: Message list structure

integer ['plid']Session ID
integer ['uid']Current user ID
bool ['isnew']If unread marks
integer ['pmnum']Number of messages Relative to the current user session
integer ['lastupdate']The current user last Update Time
integer ['lastdateline']Last update the session
integer ['authorid']Session Author ID
integer ['pmtype']Message type, 1: Private message, 2: group chat message
string ['subject']Subject
integer ['members']Session members
integer ['touid']If pmtype parameter is 1, return value indicates the other user ID
string ['tousername']If pmtype parameter is 1, return value indicates the other user name
integer ['founddateline']the session Start Time
integer ['lastauthorid']The session Last Sender ID
string ['lastauthor']The session Last Sender Name
string ['lastsummary']The session Last Send Message
integer ['pmid'][compatible]message ID
integer ['msgfromid'][compatible]Sender user ID
string ['msgfrom'][compatible]Sender user name
integer ['msgtoid'][compatible]Recipient user ID
integer ['new'][compatible]1: unread PM
0: read PM
string ['message'][compatible]content
integer ['dateline'][compatible]send time stamp
integer ['daterange'][compatible]1: today
2: yesterday
3: the day before yesterday
4: last week
5: more early

Table 2: Message content structure

integer ['pmid']Message ID
integer ['plid']Belongs to the session ID
integer ['authorid']The message author ID
string ['author']The message author user name
integer ['pmtype']Message type, 1: Private message, 2: group chat message
string ['subject']Subject
integer ['members']Session members
integer ['dateline']send time stamp
string ['message']Message content
integer ['founderuid']Session initiated by user ID
integer ['founddateline']the session Start Time
integer ['touid']If pmtype parameter is 1, the return value indicates the other user ID
integer ['msgfromid'][compatible]Sender user ID
string ['msgfrom'][compatible]Sender user name
integer ['msgtoid'][compatible]Recipient user ID

Table 3: Group chat member list structure

integer ['author']Group chat initiator ID
array ['member']List of all group chat members ID, such as: "array(1, 2, 3, ...)"