如何使用 php 在 ejabberd 数据库中添加现有用户的 VCard 详细信息
how can I add VCard details of an existing user in ejabberd database using php
我正在尝试编写 php
脚本来添加已注册到我们 ejabberd server
的现有用户的 VCard 详细信息。在vcard table
中,有一个字段vcard
。我知道它由 XML-data
填充。您能否指导我如何实现此功能,adding VCard using php
。我尝试了互联网上提供的一些示例,其中 none 个有效。这可以在不使用 ejabberd-xmlrpc
模块的情况下完成吗?是否有任何 php
库已经实现了该功能?
$ ejabberdctl set_vcard user1 localhost NICKNAME "User 1"
$ ejabberdctl get_vcard user1 localhost NICKNAME
User 1
$ ejabberdctl help set_vcard
Command Name: set_vcard
Arguments: user::binary
host::binary
name::binary
content::binary
Returns: res::rescode
Tags: vcard
Description: Set content in a vCard field
Some vcard field names in get/set_vcard are:
FN - Full Name
NICKNAME - Nickname
BDAY - Birthday
TITLE - Work: Position
ROLE - Work: Role
Some vcard field names and subnames in get/set_vcard2 are:
N FAMILY - Family name
N GIVEN - Given name
N MIDDLE - Middle name
ADR CTRY - Address: Country
ADR LOCALITY - Address: City
TEL HOME - Telephone: Home
TEL CELL - Telephone: Cellphone
TEL WORK - Telephone: Work
TEL VOICE - Telephone: Voice
EMAIL USERID - E-Mail Address
ORG ORGNAME - Work: Company
ORG ORGUNIT - Work: Department
For a full list of vCard fields check XEP-0054: vcard-temp at
http://www.xmpp.org/extensions/xep-0054.html
我正在尝试编写 php
脚本来添加已注册到我们 ejabberd server
的现有用户的 VCard 详细信息。在vcard table
中,有一个字段vcard
。我知道它由 XML-data
填充。您能否指导我如何实现此功能,adding VCard using php
。我尝试了互联网上提供的一些示例,其中 none 个有效。这可以在不使用 ejabberd-xmlrpc
模块的情况下完成吗?是否有任何 php
库已经实现了该功能?
$ ejabberdctl set_vcard user1 localhost NICKNAME "User 1"
$ ejabberdctl get_vcard user1 localhost NICKNAME
User 1
$ ejabberdctl help set_vcard
Command Name: set_vcard
Arguments: user::binary
host::binary
name::binary
content::binary
Returns: res::rescode
Tags: vcard
Description: Set content in a vCard field
Some vcard field names in get/set_vcard are:
FN - Full Name
NICKNAME - Nickname
BDAY - Birthday
TITLE - Work: Position
ROLE - Work: Role
Some vcard field names and subnames in get/set_vcard2 are:
N FAMILY - Family name
N GIVEN - Given name
N MIDDLE - Middle name
ADR CTRY - Address: Country
ADR LOCALITY - Address: City
TEL HOME - Telephone: Home
TEL CELL - Telephone: Cellphone
TEL WORK - Telephone: Work
TEL VOICE - Telephone: Voice
EMAIL USERID - E-Mail Address
ORG ORGNAME - Work: Company
ORG ORGUNIT - Work: Department
For a full list of vCard fields check XEP-0054: vcard-temp at
http://www.xmpp.org/extensions/xep-0054.html