本文整理汇总了PHP中Avatar类的典型用法代码示例。如果您正苦于以下问题:PHP Avatar类的具体用法?PHP Avatar怎么用?PHP Avatar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Avatar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fromAvatar
static function fromAvatar(Avatar $avatar)
{
$alink = new AvatarLink();
$alink->type = $avatar->mediatype;
$alink->height = $avatar->height;
$alink->width = $avatar->width;
$alink->url = $avatar->displayUrl();
return $alink;
}
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:9,代码来源:avatarlink.php
示例2: getAvatar
public function getAvatar($email, $size = 100, $default = null)
{
if (!is_int($size)) {
throw new \InvalidArgumentException('Size must be an integer');
}
$default = $this->_parseDefault($default);
$hash = $this->_getHash($email);
$url = $this->_buildUrl($hash, $size, $default);
$avatar = new Avatar();
$avatar->setUrl($url);
$avatar->setSize($size);
$avatar->setDefault($default);
return $avatar;
}
开发者ID:mothership-ec,项目名称:cog-mothership-user,代码行数:14,代码来源:Gravatar.php
示例3: map
/**
* Mapping function where to find what
* @param type $object the object
* @param type $function the called function
* @return string output
*/
private static function map($object, $function)
{
/**
* If you want to add an object to the helper simply add to this array
*/
$mapping = array('User' => array('link' => function ($obj) {
return URLHelper::getLink('dispatch.php/profile', array('username' => $obj->username));
}, 'name' => function ($obj) {
return htmlReady($obj->getFullname());
}, 'avatar' => function ($obj) {
return Avatar::getAvatar($obj->id, $obj->username)->getImageTag(Avatar::SMALL, array('title' => htmlReady($obj->getFullname('no_title'))));
}), 'Course' => array('link' => function ($obj) {
return URLHelper::getLink('seminar_main.php', array('auswahl' => $obj->id));
}, 'name' => function ($obj) {
return htmlReady($obj->name);
}, 'avatar' => function ($obj) {
return CourseAvatar::getAvatar($obj->id)->getImageTag($size = CourseAvatar::SMALL, array('title' => htmlReady($obj->name)));
}));
/*
* Some php magic to call the right function if it exists
*/
if ($object && $mapping[get_class($object)]) {
return $mapping[get_class($object)][$function]($object);
}
return "";
}
开发者ID:ratbird,项目名称:hope,代码行数:32,代码来源:ObjectdisplayHelper.php
示例4: prepare
/**
* Take arguments for running
*
* @param array $args $_REQUEST args
*
* @return boolean success flag
*/
protected function prepare(array $args = array())
{
parent::prepare($args);
$this->count = 5000;
// max 5000, completely arbitrary...
$this->target = $this->getTargetProfile($this->arg('id'));
if (!$this->target instanceof Profile) {
// TRANS: Client error displayed when requesting a list of followers for a non-existing user.
$this->clientError(_('No such user.'), 404);
}
$this->profiles = $this->getProfiles();
// only keep id, name, nickname and avatar URL
foreach ($this->profiles as $p) {
try {
$avatar = Avatar::byProfile($p, AVATAR_STREAM_SIZE);
$avatar = $avatar->url;
} catch (Exception $e) {
$avatar = false;
}
$this_user = array($p->fullname, $p->nickname, $avatar);
if (!$p->isLocal()) {
$this_user[3] = $p->getUrl();
} else {
$this_user[3] = false;
}
$this->users_stripped[$p->id] = $this_user;
}
return true;
}
开发者ID:allmende,项目名称:qvitter,代码行数:36,代码来源:apiqvitterallfollowing.php
示例5: __construct
/**
* Constructor
*
* @param User $user the user for the feed
* @param User $cur the current authenticated user, if any
* @param boolean $indent flag to turn indenting on or off
*
* @return void
*/
function __construct($user, $cur = null, $indent = true)
{
parent::__construct($cur, $indent);
$this->user = $user;
if (!empty($user)) {
$profile = $user->getProfile();
$ao = ActivityObject::fromProfile($profile);
array_push($ao->extra, $profile->profileInfo($cur));
// XXX: For users, we generate an author _AND_ an <activity:subject>
// This is for backward compatibility with clients (especially
// StatusNet's clients) that assume the Atom will conform to an
// older version of the Activity Streams API. Subject should be
// removed in future versions of StatusNet.
$this->addAuthorRaw($ao->asString('author'));
$depMsg = 'Deprecation warning: activity:subject is present ' . 'only for backward compatibility. It will be ' . 'removed in the next version of StatusNet.';
$this->addAuthorRaw("<!--{$depMsg}-->\n" . $ao->asString('activity:subject'));
}
// TRANS: Title in atom user notice feed. %s is a user name.
$title = sprintf(_("%s timeline"), $user->nickname);
$this->setTitle($title);
$sitename = common_config('site', 'name');
$subtitle = sprintf(_('Updates from %1$s on %2$s!'), $user->nickname, $sitename);
$this->setSubtitle($subtitle);
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$logo = $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
$this->setLogo($logo);
$this->setUpdated('now');
$this->addLink(common_local_url('showstream', array('nickname' => $user->nickname)));
$self = common_local_url('ApiTimelineUser', array('id' => $user->id, 'format' => 'atom'));
$this->setId($self);
$this->setSelfLink($self);
$this->addLink(common_local_url('sup', null, null, $user->id), array('rel' => 'http://api.friendfeed.com/2008/03#sup', 'type' => 'application/json'));
}
开发者ID:microcosmx,项目名称:experiments,代码行数:42,代码来源:atomusernoticefeed.php
示例6: get_instance
public static function get_instance()
{
if (!isset(self::$instance)) {
self::$instance = new Avatar();
}
return self::$instance;
}
开发者ID:RalphBrabante,项目名称:sysgage,代码行数:7,代码来源:avatar.php
示例7: showNotice
function showNotice($notice)
{
$profile = $notice->getProfile();
if (empty($profile)) {
common_log(LOG_WARNING, sprintf("Notice %d has no profile", $notice->id));
return;
}
$this->out->elementStart('li', 'hentry notice');
$this->out->elementStart('div', 'entry-title');
$avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
$this->out->elementStart('span', 'vcard author');
$this->out->elementStart('a', array('title' => $profile->fullname ? $profile->fullname : $profile->nickname, 'href' => $profile->profileurl, 'class' => 'url'));
$this->out->element('img', array('src' => $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_MINI_SIZE), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar photo', 'alt' => $profile->fullname ? $profile->fullname : $profile->nickname));
$this->out->text(' ');
$this->out->element('span', 'fn nickname', $profile->nickname);
$this->out->elementEnd('a');
$this->out->elementEnd('span');
$this->out->elementStart('p', 'entry-content');
$this->out->raw($notice->rendered);
$this->out->elementEnd('p');
$this->out->elementStart('div', 'entry_content');
class_exists('NoticeList');
$nli = new NoticeListItem($notice, $this->out);
$nli->showNoticeLink();
$this->out->elementEnd('div');
if (!empty($notice->value)) {
$this->out->elementStart('p');
$this->out->text($notice->value);
$this->out->elementEnd('p');
}
$this->out->elementEnd('div');
$this->out->elementEnd('li');
}
开发者ID:microcosmx,项目名称:experiments,代码行数:33,代码来源:noticesection.php
示例8: show
/**
* Show the item
*
* @return void
*/
function show()
{
$group = $this->gm->getGroup();
$sender = $this->gm->getSender();
$this->out->elementStart('li', array('class' => 'hentry notice message group-message', 'id' => 'message-' . $this->gm->id));
$this->out->elementStart('div', 'entry-title');
$this->out->elementStart('span', 'vcard author');
$this->out->elementStart('a', array('href' => $sender->profileurl, 'class' => 'url'));
$avatar = $sender->getAvatar(AVATAR_STREAM_SIZE);
$this->out->element('img', array('src' => $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE), 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'class' => 'photo avatar', 'alt' => $sender->getBestName()));
$this->out->element('span', array('class' => 'nickname fn'), $sender->nickname);
$this->out->elementEnd('a');
$this->out->elementEnd('span');
$this->out->elementStart('p', array('class' => 'entry-content message-content'));
$this->out->raw($this->gm->rendered);
$this->out->elementEnd('p');
$this->out->elementEnd('div');
$this->out->elementStart('div', 'entry-content');
$this->out->elementStart('a', array('rel' => 'bookmark', 'class' => 'timestamp', 'href' => $this->gm->url));
$dt = common_date_iso8601($this->gm->created);
$this->out->element('abbr', array('class' => 'published', 'title' => $dt), common_date_string($this->gm->created));
$this->out->elementEnd('a');
$this->out->elementEnd('div');
$this->out->elementEnd('li');
}
开发者ID:Grasia,项目名称:bolotweet,代码行数:30,代码来源:groupmessagelistitem.php
示例9: getInstance
public static function getInstance($class = '')
{
if (self::$_instances[$class]) {
return self::$_instances[$class];
}
return self::$_instance = new Avatar();
}
开发者ID:kenyonjohnston,项目名称:hott_theater,代码行数:7,代码来源:avatar.php
示例10: handle
/**
* Class handler.
*
* @param array $args query arguments
*
* @return boolean false if nickname or user isn't found
*/
protected function handle()
{
parent::handle();
$nickname = $this->trimmed('nickname');
if (!$nickname) {
// TRANS: Client error displayed trying to get an avatar without providing a nickname.
$this->clientError(_('No nickname.'));
}
$size = $this->trimmed('size') ?: 'original';
$user = User::getKV('nickname', $nickname);
if (!$user) {
// TRANS: Client error displayed trying to get an avatar for a non-existing user.
$this->clientError(_('No such user.'));
}
$profile = $user->getProfile();
if (!$profile) {
// TRANS: Error message displayed when referring to a user without a profile.
$this->clientError(_('User has no profile.'));
}
if ($size === 'original') {
try {
$avatar = Avatar::getUploaded($profile);
$url = $avatar->displayUrl();
} catch (NoAvatarException $e) {
$url = Avatar::defaultImage(AVATAR_PROFILE_SIZE);
}
} else {
$url = $profile->avatarUrl($size);
}
common_redirect($url, 302);
}
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:38,代码来源:avatarbynickname.php
示例11: execute
function execute($par)
{
global $wgUser, $wgOut;
$wgOut->disable();
header("Content-type: text/plain;");
header('Expires: ' . gmdate('D, d M Y H:i:s', 0) . ' GMT');
header("Cache-Control: private, must-revalidate, max-age=0");
if ($wgUser->getID() == 0) {
return;
}
if (self::isUserBlocked()) {
self::updateRemote();
return;
}
$avatar = wfGetPad(Avatar::getAvatarURL($wgUser->getName()));
$result = "";
$result .= "UniqueID={$wgUser->getID()}\n";
$result .= "Name={$wgUser->getName()}\n";
$result .= "Email={$wgUser->getEmail()}\n";
$result .= "Avatar={$avatar}\n";
$result .= "CurrentDate=" . date("r") . "\n";
$result .= "Groups=" . implode(',', $wgUser->getGroups()) . "\n";
wfDebug("ProxyConnect: returning {$result}\n");
print $result;
self::updateRemote();
return;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:27,代码来源:ProxyConnect.body.php
示例12: updateGroupAvatars
function updateGroupAvatars($group)
{
if (!have_option('q', 'quiet')) {
print "Updating avatars for group '" . $group->nickname . "' (" . $group->id . ")...";
}
if (empty($group->original_logo)) {
print "(none found)...";
} else {
// Using clone here was screwing up the group->find() iteration
$orig = User_group::staticGet('id', $group->id);
$group->original_logo = Avatar::url(basename($group->original_logo));
$group->homepage_logo = Avatar::url(basename($group->homepage_logo));
$group->stream_logo = Avatar::url(basename($group->stream_logo));
$group->mini_logo = Avatar::url(basename($group->mini_logo));
if (!$group->update($orig)) {
throw new Exception("Can't update avatars for group " . $group->nickname . ".");
}
}
if (have_option('v', 'verbose')) {
print "DONE.";
}
if (!have_option('q', 'quiet') || have_option('v', 'verbose')) {
print "\n";
}
}
开发者ID:microcosmx,项目名称:experiments,代码行数:25,代码来源:updateavatarurl_group.php
示例13: afterStoreCallback
public function afterStoreCallback()
{
if ($this->isDirty()) {
//add notification to writer of review
if (!$this->review['host_id'] && $this->review['user_id'] !== $this['user_id']) {
PersonalNotifications::add($this->review['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat einen Kommentar zu Ihrem Review geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
}
//add notification to all users of this servers who discussed this review but are neither the new
//commentor nor the writer of the review
$statement = DBManager::get()->prepare("\n SELECT user_id\n FROM lernmarktplatz_comments\n WHERE review_id = :review_id\n AND host_id IS NULL\n GROUP BY user_id\n ");
$statement->execute(array('review_id' => $this->review->getId()));
foreach ($statement->fetchAll(PDO::FETCH_COLUMN, 0) as $user_id) {
if (!in_array($user_id, array($this->review['user_id'], $this['user_id']))) {
PersonalNotifications::add($user_id, URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat auch einen Kommentar geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
}
}
//only push if the comment is from this server and the material-server is different
if (!$this['host_id']) {
$myHost = LernmarktplatzHost::thisOne();
$data = array();
$data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
$data['data'] = $this->toArray();
$data['data']['foreign_comment_id'] = $data['data']['comment_id'];
unset($data['data']['comment_id']);
unset($data['data']['id']);
unset($data['data']['user_id']);
unset($data['data']['host_id']);
$user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
if ($user_description_datafield) {
$datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
}
$data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
$statement = DBManager::get()->prepare("\n SELECT host_id\n FROM lernmarktplatz_comments\n WHERE review_id = :review_id\n AND host_id IS NOT NULL\n GROUP BY host_id\n ");
$statement->execute(array('review_id' => $this->review->getId()));
$hosts = $statement->fetchAll(PDO::FETCH_COLUMN, 0);
if ($this->review['host_id'] && !in_array($this->review['host_id'], $hosts)) {
$hosts[] = $this->review['host_id'];
}
if ($this->review->material['host_id'] && !in_array($this->review->material['host_id'], $hosts)) {
$hosts[] = $this->review->material['host_id'];
}
foreach ($hosts as $host_id) {
$remote = new LernmarktplatzHost($host_id);
if (!$remote->isMe()) {
$review_id = $this->review['foreign_review_id'] ?: $this->review->getId();
if ($this->review['foreign_review_id']) {
if ($this->review->host_id === $remote->getId()) {
$host_hash = null;
} else {
$host_hash = md5($this->review->host['public_key']);
}
} else {
$host_hash = md5($myHost['public_key']);
}
$remote->pushDataToEndpoint("add_comment/" . $review_id . "/" . $host_hash, $data);
}
}
}
}
}
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:60,代码来源:LernmarktplatzComment.php
示例14: get
/**
* Gets the avatar information for the user. The avatars are provided by
* plugins that can integrate with a variety of services like gravatar.com,
* LDAP, Social Identities, etc.
*
* If logged in user doesn't have access to view avatars or not avatar is found,
* then a default avatar will be used.
*
* Note that the provided user id may no longer has a corresponding user in the
* system, if the user was deleted.
*
* @param integer $p_user_id The user id.
* @param integer $p_size The desired width/height of the avatar.
*
* @return array The array with avatar information.
*/
public static function get($p_user_id, $p_size = 80)
{
$t_enabled = config_get('show_avatar') !== OFF;
$t_avatar = null;
if ($t_enabled) {
$t_user_exists = user_exists($p_user_id);
if ($t_user_exists && access_has_project_level(config_get('show_avatar_threshold'), null, $p_user_id)) {
$t_avatar = event_signal('EVENT_USER_AVATAR', array($p_user_id, $p_size));
}
if ($t_avatar === null) {
$t_avatar = new Avatar();
}
$t_avatar->normalize($p_user_id, $t_user_exists);
}
return $t_avatar;
}
开发者ID:spring,项目名称:spring-website,代码行数:32,代码来源:Avatar.class.php
示例15: __construct
/**
* Constructor
*
* @param User $user the user for the feed
* @param User $cur the current authenticated user, if any
* @param boolean $indent flag to turn indenting on or off
*
* @return void
*/
function __construct($user, $cur = null, $indent = true)
{
parent::__construct($cur, $indent);
$this->user = $user;
if (!empty($user)) {
$profile = $user->getProfile();
$this->addAuthor($profile->nickname, $user->uri);
$this->setActivitySubject($profile->asActivityNoun('subject'));
}
// TRANS: Title in atom user notice feed. %s is a user name.
$title = sprintf(_("%s timeline"), $user->nickname);
$this->setTitle($title);
$sitename = common_config('site', 'name');
$subtitle = sprintf(_('Updates from %1$s on %2$s!'), $user->nickname, $sitename);
$this->setSubtitle($subtitle);
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
$logo = $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
$this->setLogo($logo);
$this->setUpdated('now');
$this->addLink(common_local_url('showstream', array('nickname' => $user->nickname)));
$self = common_local_url('ApiTimelineUser', array('id' => $user->id, 'format' => 'atom'));
$this->setId($self);
$this->setSelfLink($self);
$this->addLink(common_local_url('sup', null, null, $user->id), array('rel' => 'http://api.friendfeed.com/2008/03#sup', 'type' => 'application/json'));
}
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:34,代码来源:atomusernoticefeed.php
示例16: updateGroupUrls
function updateGroupUrls()
{
printfnq("Updating group URLs...\n");
$group = new User_group();
if ($group->find()) {
while ($group->fetch()) {
try {
printfv("Updating group {$group->nickname}...");
$orig = User_group::getKV('id', $group->id);
if (!empty($group->original_logo)) {
$group->original_logo = Avatar::url(basename($group->original_logo));
$group->homepage_logo = Avatar::url(basename($group->homepage_logo));
$group->stream_logo = Avatar::url(basename($group->stream_logo));
$group->mini_logo = Avatar::url(basename($group->mini_logo));
}
// XXX: this is a hack to see if a group is local or not
$localUri = common_local_url('groupbyid', array('id' => $group->id));
if ($group->getUri() != $localUri) {
$group->mainpage = common_local_url('showgroup', array('nickname' => $group->nickname));
}
$group->update($orig);
printfv("DONE.");
} catch (Exception $e) {
echo "Can't update avatars for group " . $group->nickname . ": " . $e->getMessage();
}
}
}
}
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:28,代码来源:updateurls.php
示例17: delete
function delete()
{
$filename = $this->filename;
if (parent::delete()) {
@unlink(Avatar::path($filename));
}
}
开发者ID:Br3nda,项目名称:laconica,代码行数:7,代码来源:Avatar.php
示例18: afterStoreCallback
public function afterStoreCallback()
{
if (!$this->material['host_id'] && $this->material['user_id'] !== $GLOBALS['user']->id) {
PersonalNotifications::add($this->material['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/details/" . $this->material->getId() . "#review_" . $this->getId()), $this->isNew() ? sprintf(_("%s hat ein Review zu '%s' geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id']), $this->material['name']) : sprintf(_("%s hat ein Review zu '%s' verändert."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id']), $this->material['name']), "review_" . $this->getId(), Icon::create("support", "clickable"));
}
//only push if the comment is from this server and the material-server is different
if ($this->material['host_id'] && !$this['host_id'] && $this->isDirty()) {
$remote = new LernmarktplatzHost($this->material['host_id']);
$myHost = LernmarktplatzHost::thisOne();
$data = array();
$data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
$data['data'] = $this->toArray();
$data['data']['foreign_review_id'] = $data['data']['review_id'];
unset($data['data']['review_id']);
unset($data['data']['id']);
unset($data['data']['user_id']);
unset($data['data']['host_id']);
$user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
if ($user_description_datafield) {
$datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
}
$data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
if (!$remote->isMe()) {
$remote->pushDataToEndpoint("add_review/" . $this->material['foreign_material_id'], $data);
}
}
}
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:27,代码来源:LernmarktplatzReview.php
示例19: updateAvatars
function updateAvatars($user)
{
$touched = false;
if (!have_option('q', 'quiet')) {
print "Updating avatars for user '" . $user->nickname . "' (" . $user->id . ")...";
}
$avatar = new Avatar();
$avatar->profile_id = $user->id;
if (!$avatar->find()) {
if (have_option('v', 'verbose')) {
print "(none found)...";
}
} else {
while ($avatar->fetch()) {
if (have_option('v', 'verbose')) {
if ($avatar->original) {
print "original...";
} else {
print $avatar->width . "...";
}
}
$orig_url = $avatar->url;
$avatar->url = Avatar::url($avatar->filename);
if ($avatar->url != $orig_url) {
$sql = "UPDATE avatar SET url = '" . $avatar->url . "' " . "WHERE profile_id = " . $avatar->profile_id . " " . "AND width = " . $avatar->width . " " . "AND height = " . $avatar->height . " ";
if ($avatar->original) {
$sql .= "AND original = 1 ";
}
if (!$avatar->query($sql)) {
throw new Exception("Can't update avatar for user " . $user->nickname . ".");
} else {
$touched = true;
}
}
}
}
if ($touched) {
$profile = $user->getProfile();
common_broadcast_profile($profile);
}
if (have_option('v', 'verbose')) {
print "DONE.";
}
if (!have_option('q', 'quiet') || have_option('v', 'verbose')) {
print "\n";
}
}
开发者ID:microcosmx,项目名称:experiments,代码行数:47,代码来源:updateavatarurl.php
示例20: html_start
/**
* Returns html string representing the beginning block of a timeline entry
* @return string
*/
public function html_start()
{
$t_avatar = Avatar::get($this->user_id, 32);
if ($t_avatar === null) {
return sprintf('<div class="entry"><div class="timestamp">%s</div>', $this->format_timestamp($this->timestamp));
}
return sprintf('<div class="entry"><div class="avatar"><a href="%s"><img class="avatar" src="%s" alt="%s" width="32" height="32" /></a></div><div class="timestamp">%s</div>', $t_avatar->link, $t_avatar->image, $t_avatar->text, $this->format_timestamp($this->timestamp));
}
开发者ID:spring,项目名称:spring-website,代码行数:12,代码来源:TimelineEvent.class.php
注:本文中的Avatar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论