本文整理汇总了PHP中ElggUser::getURL方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggUser::getURL方法的具体用法?PHP ElggUser::getURL怎么用?PHP ElggUser::getURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggUser
的用法示例。
在下文中一共展示了ElggUser::getURL方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: messageboard_add
/**
* Add messageboard post
*
* @param ElggUser $poster User posting the message
* @param ElggUser $owner User who owns the message board
* @param string $message The posted message
* @param int $access_id Access level (see defines in elgglib.php)
* @return bool
*/
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC)
{
$result_id = $owner->annotate('messageboard', $message, $access_id, $poster->guid);
if (!$result_id) {
return false;
}
elgg_create_river_item(array('view' => 'river/object/messageboard/create', 'action_type' => 'messageboard', 'subject_guid' => $poster->guid, 'object_guid' => $owner->guid, 'access_id' => $access_id, 'annotation_id' => $result_id));
// Send notification only if poster isn't the owner
if ($poster->guid != $owner->guid) {
$subject = elgg_echo('messageboard:email:subject', array(), $owner->language);
$body = elgg_echo('messageboard:email:body', array($poster->name, $message, elgg_get_site_url() . "messageboard/owner/" . $owner->username, $poster->name, $poster->getURL()), $owner->language);
$params = ['action' => 'create', 'object' => elgg_get_annotation_from_id($result_id)];
notify_user($owner->guid, $poster->guid, $subject, $body, $params);
}
return $result_id;
}
示例2: share_notify_user
/**
* Notify $user that $sharer shared his $entity.
*
* @param type $user
* @param type $sharer
* @param type $entity
*/
function share_notify_user(ElggUser $user, ElggUser $sharer, ElggEntity $entity)
{
if (!$user instanceof ElggUser) {
return false;
}
if (!$sharer instanceof ElggUser) {
return false;
}
if (!$entity instanceof ElggEntity) {
return false;
}
$title_str = $entity->title;
if (!$title_str) {
$title_str = elgg_get_excerpt($entity->description);
}
$site = get_config('site');
$subject = elgg_echo('share:notifications:subject', array($sharer->name, $title_str));
$body = elgg_echo('share:notifications:body', array($user->name, $sharer->name, $title_str, $site->name, $entity->getURL(), $sharer->getURL()));
notify_user($user->guid, $sharer->guid, $subject, $body);
}
示例3: owner_gatekeeper_apply_rules
/**
* Apply the protection rules
*
* @param ElggUser $page_owner
* @param ElggUser $user
*
* @access private
* @return bool true you have access, false you don't
*/
function owner_gatekeeper_apply_rules(ElggUser $page_owner, ElggUser $user = null)
{
if (!$page_owner instanceof ElggUser) {
return false;
}
if (current_page_url() === elgg_normalize_url($page_owner->getURL())) {
// profile page
if (!owner_gatekeeper_protect_profile()) {
return true;
}
} else {
// content pages
if (!owner_gatekeeper_protect_page_owner()) {
return true;
}
}
if (!$user instanceof ElggUser) {
return false;
}
if (!owner_gatekeeper_match_group($page_owner, $user)) {
return false;
}
return true;
}
示例4: messageboard_add
/**
* Add messageboard post
*
* @param ElggUser $poster User posting the message
* @param ElggUser $owner User who owns the message board
* @param string $message The posted message
* @param int $access_id Access level (see defines in elgglib.php)
* @return bool
*/
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC)
{
$result = $owner->annotate('messageboard', $message, $access_id, $poster->guid);
if (!$result) {
return false;
}
add_to_river('river/object/messageboard/create', 'messageboard', $poster->guid, $owner->guid, $access_id, 0, $result);
// only send notification if not self
if ($poster->guid != $owner->guid) {
$subject = elgg_echo('messageboard:email:subject');
$body = elgg_echo('messageboard:email:body', array($poster->name, $message, elgg_get_site_url() . "messageboard/" . $owner->username, $poster->name, $poster->getURL()));
notify_user($owner->guid, $poster->guid, $subject, $body);
}
return $result;
}
示例5: messageboard_add
/**
* Add messageboard post
*
* @param ElggUser $poster User posting the message
* @param ElggUser $owner User who owns the message board
* @param string $message The posted message
* @param int $access_id Access level (see defines in elgglib.php)
* @return bool
*/
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC)
{
$result_id = $owner->annotate('messageboard', $message, $access_id, $poster->guid);
if (!$result_id) {
return false;
}
elgg_create_river_item(array('view' => 'river/object/messageboard/create', 'action_type' => 'messageboard', 'subject_guid' => $poster->guid, 'object_guid' => $owner->guid, 'access_id' => $access_id, 'annotation_id' => $result_id));
// only send notification if not self
if ($poster->guid != $owner->guid) {
$subject = elgg_echo('messageboard:email:subject');
$body = elgg_echo('messageboard:email:body', array($poster->name, $message, elgg_get_site_url() . "messageboard/" . $owner->username, $poster->name, $poster->getURL()));
notify_user($owner->guid, $poster->guid, $subject, $body);
}
return $result_id;
}
示例6: parseUser
/**
* @SWG\Definition(
* definition="User",
* required={"guid","name"},
* @SWG\Property(property="guid", type="integer"),
* @SWG\Property(property="name", type="string"),
* @SWG\Property(property="icon_url", type="string"),
* @SWG\Property(property="url", type="string")
* )
*/
private function parseUser(\ElggUser $user)
{
return array('guid' => $user->guid, 'name' => html_entity_decode($user->name, ENT_QUOTES), 'icon_url' => $user->getIconURL(), 'url' => $user->getURL());
}