本文整理汇总了PHP中Streams::invite方法的典型用法代码示例。如果您正苦于以下问题:PHP Streams::invite方法的具体用法?PHP Streams::invite怎么用?PHP Streams::invite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Streams
的用法示例。
在下文中一共展示了Streams::invite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Streams_invite_post
/**
* Invites a user (or a future user) to a stream .
* @param {array} $_REQUEST
* @param {string} $_REQUEST.publisherId The id of the stream publisher
* @param {string} $_REQUEST.streamName The name of the stream the user will be invited to
* @param {string} [$_REQUEST.userId] user id or an array of user ids
* @param {string} [$_REQUEST.fb_uid] fb user id or array of fb user ids
* @param {string} [$_REQUEST.label] label or an array of labels, or tab-delimited string
* @param {string} [$_REQUEST.identifier] identifier or an array of identifiers
* @param {string|array} [$_REQUEST.addLabel] label or an array of labels for adding publisher's contacts
* @param {string|array} [$_REQUEST.addMyLabel] label or an array of labels for adding logged-in user's contacts
* @param {string} [$_REQUEST.readLevel] the read level to grant those who are invited
* @param {string} [$_REQUEST.writeLevel] the write level to grant those who are invited
* @param {string} [$_REQUEST.adminLevel] the admin level to grant those who are invited
* @param {string} [$_REQUEST.displayName] optionally override the name to display in the invitation for the inviting user
* @see Users::addLink()
*/
function Streams_invite_post()
{
$publisherId = Streams::requestedPublisherId(true);
$streamName = Streams::requestedName(true);
Streams::$cache['invited'] = Streams::invite($publisherId, $streamName, $_REQUEST, $_REQUEST);
}
示例2: invite
/**
* Invites a user (or a future user) to this stream
* @method invite
* @static
* @param {array} $who Array that can contain the following keys:
* @param {string|array} [$who.userId] user id or an array of user ids
* @param {string|array} [$who.fb_uid] fb user id or array of fb user ids
* @param {string|array} [$who.label] label or an array of labels, or tab-delimited string
* @param {string|array} [$who.identifier] identifier or an array of identifiers, or tab-delimited string
* @param {integer} [$who.newFutureUsers] the number of new Users_User objects to create via Users::futureUser in order to invite them to this stream. This typically is used in conjunction with passing the "html" option to this function.
* @param {array} [$options=array()]
* @param {string|array} [$options.label] label or an array of labels for adding publisher's contacts
* @param {string|array} [$options.myLabel] label or an array of labels for adding logged-in user's contacts
* @param {integer} [$options.readLevel] => the read level to grant those who are invited
* @param {integer} [$options.writeLevel] => the write level to grant those who are invited
* @param {integer} [$options.adminLevel] => the admin level to grant those who are invited
* @param {string} [$options.displayName] => the display name to use to represent the inviting user
* @param {string} [$options.appUrl] => Can be used to override the URL to which the invited user will be redirected and receive "Q.Streams.token" in the querystring.
* @param {array} [$options.html] => an array of ($template, $batchName) such as ("MyApp/foo.handlebars", "foo") for generating html snippets which can then be viewed from and printed via the action Streams/invitations?batchName=$batchName
* @see Users::addLink()
* @return {array} returns array with keys "success", "invited", "statuses", "identifierTypes", "alreadyParticipating"
*/
function invite($who, $options = array())
{
return Streams::invite($this->publisherId, $this->name, $who, $options);
}
示例3: die
#Read primary arguments
$LOCAL_DIR = $FROM_APP ? APP_DIR : $argv[1];
#Check paths
if (!file_exists($Q_filename = Q_DIR . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'Q.inc.php')) {
#Q Platform
die("[ERROR] {$Q_filename} not found" . PHP_EOL);
}
if (!is_dir($LOCAL_DIR)) {
#App dir
die("[ERROR] {$LOCAL_DIR} doesn't exist or is not a directory" . PHP_EOL);
}
#Define APP_DIR
if (!defined('APP_DIR')) {
define('APP_DIR', $LOCAL_DIR);
}
#Include Q
try {
include $Q_filename;
} catch (Exception $e) {
die('[ERROR] ' . $e->getMessage() . PHP_EOL . $e->getTraceAsString() . PHP_EOL);
}
$app = Q_Config::expect('Q', 'app');
$identifier = $FROM_APP ? $argv[1] : $argv[2];
$communityId = Q::ifset($argv, $FROM_APP ? 2 : 3, Users::communityId());
$labels = array_slice($argv, $FROM_APP ? 3 : 4);
$addLabel = empty($labels) ? "{$app}/admins" : $labels;
$asUserId = $app;
$skipAccess = true;
$appUrl = Q_Uri::url('Communities/onboarding');
Streams::invite($communityId, 'Streams/community/main', compact('identifier'), compact('addLabel', 'asUserId', 'skipAccess', 'appUrl'));
echo "Successfully invited {$identifier}\n";