当前位置: 首页>>代码示例>>PHP>>正文


PHP User_group::getBestName方法代码示例

本文整理汇总了PHP中User_group::getBestName方法的典型用法代码示例。如果您正苦于以下问题:PHP User_group::getBestName方法的具体用法?PHP User_group::getBestName怎么用?PHP User_group::getBestName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在User_group的用法示例。


在下文中一共展示了User_group::getBestName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mail_notify_group_join_pending

/**
 * Send notification emails to group administrator.
 *
 * @param User_group $group
 * @param Profile $joiner
 */
function mail_notify_group_join_pending($group, $joiner)
{
    $admin = $group->getAdmins();
    while ($admin->fetch()) {
        // We need a local user for email notifications...
        $adminUser = User::staticGet('id', $admin->id);
        // @fixme check for email preference?
        if ($adminUser && $adminUser->email) {
            // use the recipient's localization
            common_switch_locale($adminUser->language);
            $headers = _mail_prepare_headers('join', $admin->nickname, $joiner->nickname);
            $headers['From'] = mail_notify_from();
            $headers['To'] = $admin->getBestName() . ' <' . $adminUser->email . '>';
            // TRANS: Subject of pending group join request notification e-mail.
            // TRANS: %1$s is the joining user's nickname, %2$s is the group name, and %3$s is the StatusNet sitename.
            $headers['Subject'] = sprintf(_('%1$s wants to join your group %2$s on %3$s.'), $joiner->getBestName(), $group->getBestName(), common_config('site', 'name'));
            // TRANS: Main body of pending group join request notification e-mail.
            // TRANS: %1$s is the subscriber's long name, %2$s is the group name, and %3$s is the StatusNet sitename,
            // TRANS: %4$s is the URL to the moderation queue page.
            $body = sprintf(_('%1$s would like to join your group %2$s on %3$s. ' . 'You may approve or reject their group membership at %4$s'), $joiner->getFancyName(), $group->getFancyName(), common_config('site', 'name'), common_local_url('groupqueue', array('nickname' => $group->nickname))) . mail_profile_block($joiner) . mail_footer_block();
            // reset localization
            common_switch_locale();
            mail_send($adminUser->email, $headers, $body);
        }
    }
}
开发者ID:jianoll,项目名称:SpeakEnglish_Server,代码行数:32,代码来源:mail.php

示例2: fromGroup

 static function fromGroup(User_group $group)
 {
     $object = new ActivityObject();
     if (Event::handle('StartActivityObjectFromGroup', array($group, &$object))) {
         $object->type = ActivityObject::GROUP;
         $object->id = $group->getUri();
         $object->title = $group->getBestName();
         $object->link = $group->getUri();
         $object->avatarLinks[] = AvatarLink::fromFilename($group->homepage_logo, AVATAR_PROFILE_SIZE);
         $object->avatarLinks[] = AvatarLink::fromFilename($group->stream_logo, AVATAR_STREAM_SIZE);
         $object->avatarLinks[] = AvatarLink::fromFilename($group->mini_logo, AVATAR_MINI_SIZE);
         $object->poco = PoCo::fromGroup($group);
         Event::handle('EndActivityObjectFromGroup', array($group, &$object));
     }
     return $object;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:16,代码来源:activityobject.php

示例3: fromGroup

 static function fromGroup(User_group $group)
 {
     $poco = new PoCo();
     $poco->preferredUsername = $group->nickname;
     $poco->displayName = $group->getBestName();
     $poco->note = $group->description;
     $paddy = new PoCoAddress();
     $paddy->formatted = $group->location;
     $poco->address = $paddy;
     if (!empty($group->homepage)) {
         array_push($poco->urls, new PoCoURL('homepage', $group->homepage, true));
     }
     return $poco;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:14,代码来源:poco.php


注:本文中的User_group::getBestName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。