本文整理汇总了PHP中User::getAvatar方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getAvatar方法的具体用法?PHP User::getAvatar怎么用?PHP User::getAvatar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User::getAvatar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* @throws CException
*/
public function run()
{
$this->imageSrc = $this->user->getAvatar($this->size);
$this->imageAlt = $this->user->nick_name;
$this->width = $this->size . 'px';
$this->htmlOptions = ['class' => 'avatar avatar-' . $this->user->id];
if (!$this->height) {
$this->height = $this->width;
}
Yii::app()->clientScript->registerCssFile(Yii::app()->assetManager->publish(Yii::getPathOfAlias('user.assets.css') . '/image-wrapper.css'));
$htmlOptions = ['class' => 'img-wrapper-tocenter', 'style' => 'width: ' . $this->width . '; height: ' . $this->height . '; background-color: ' . $this->backgroundColor . ';'];
if (isset($this->htmlOptions['class'])) {
$class = $this->htmlOptions['class'];
unset($this->htmlOptions['class']);
$htmlOptions['class'] .= ' ' . $class;
}
if (isset($this->htmlOptions['style'])) {
$style = $this->htmlOptions['style'];
unset($this->htmlOptions['style']);
$htmlOptions['style'] .= ' ' . $style;
}
if (is_array($this->htmlOptions) && count($this->htmlOptions) > 0) {
$htmlOptions = array_merge($htmlOptions, $this->htmlOptions);
}
echo CHtml::tag('div', $htmlOptions, CHtml::image($this->imageSrc . ($this->noCache ? '?' . microtime(true) : ''), $this->imageAlt, $this->imageHtmlOptions));
}
示例2: orders
public function orders()
{
$data = array();
$seo['seo_title'] = 'Управления заказами';
Funcs::setMeta($seo);
if (Funcs::$uri[2] == '') {
$data['list'] = Manager::getManagerOrders();
View::render('manager/orders', $data);
} else {
$data = Orders::getOne(Funcs::$uri[2]);
$data['avatar'] = User::getAvatar($data['iuser']);
View::render('manager/order', $data);
}
}
示例3: update
public function update(User $user)
{
$id = $user->getId();
$login = $this->db->quote($user->getLogin());
$password = $this->db->quote($user->getPassword());
$email = $this->db->quote($user->getEmail());
$avatar = $this->db->quote($user->getAvatar());
$query = "UPDATE\t user \n\t\t\t\t\t\tSET \tlogin\t\t='" . $login . "', \n\t\t\t\t\t\t\t\tpassword\t='" . $password . "',\n\t\t\t\t\t\t\t\temail\t\t='" . $email . "', \n\t\t\t\t\t\t\t\tavatar\t\t='" . $avatar . "' \n\t\t\t\t\t\t\t\tWHERE id\t='" . $id . "'";
$res = $this->db->exec($query);
if ($res) {
return $this->findById($id);
} else {
throw new Exception("Internal Server Error");
}
}
示例4: run
public function run()
{
$data = $this->_getComment();
echo "<legend>讨论区</legend>";
if (empty($data)) {
echo "<center><div class='well well-small'>暂无会签意见!</div> </center>";
} else {
$this->render($this->_listView, array("dataArr" => $data, 'enableReply' => $this->enableReply, 'model' => $this->_model, 'pk' => $this->_pk, 'viewTemplate' => $this->_listViewTemplate));
}
if ($this->enableEdit) {
$loginUser = Yii::app()->user->id;
$userInfo = User::model()->getUserInfoById($loginUser);
$avatar = User::getAvatar($loginUser, $userInfo['avatar'], 'm', $userInfo['gender'], TOrgUtil::userIsOnline($loginUser));
$this->render($this->_formView, array("model" => $this->_model, "pk" => $this->_pk, "avatar" => $avatar));
}
}
示例5: update
public function update(User $user)
{
$id = $user->getId();
$login = mysqli_real_escape_string($this->db, $user->getLogin());
$password = mysqli_real_escape_string($this->db, $user->getHash());
$email = mysqli_real_escape_string($this->db, $user->getEmail());
$avatar = mysqli_real_escape_string($this->db, $user->getAvatar());
/*/!\*/
$query = "UPDATE user SET login='" . $login . "', password='" . $password . "', email='" . $email . "', avatar='" . $avatar . "' WHERE id='" . $id . "'";
$res = mysqli_query($this->db, $query);
if ($res) {
return $this->findById($id);
} else {
return "Internal Server Error";
}
}
示例6: run
public function run($template)
{
//Remove the whole string as the first result
array_shift($this->URLMatch);
//Get the database
$dbh = Engine::getDatabase();
//Get result ID
$resultID = $this->URLMatch[0];
//Check if the result is in the array and return results
$sql = "SELECT * FROM Results WHERE Result_ID IN (SELECT Result_ID FROM Result_History WHERE Result_ID= :result) LIMIT 1";
$stmt = $dbh->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
$stmt->execute(array(':result' => $resultID));
$result = $stmt->fetchObject('Result');
if ($result == false) {
exit;
}
//There's no result to give an image for
$result->Data = json_decode($result->Data, true);
$data = $result->Data;
$blueBackground = imagecreatefromstring(file_get_contents(__DIR__ . '/../public/images/share-background.png', "r"));
$friends = array_keys($data['interaction']);
$friend1 = imagecreatefromstring(file_get_contents(User::getAvatar($friends[0])));
//200,200 (width x height)
$friend2 = imagecreatefromstring(file_get_contents(User::getAvatar($friends[1])));
$friend3 = imagecreatefromstring(file_get_contents(User::getAvatar($friends[2])));
$gaussian = array(array(1.0, 2.0, 1.0), array(2.0, 4.0, 2.0), array(1.0, 2.0, 1.0));
for ($i = 0; $i < 60; $i++) {
imageconvolution($friend1, $gaussian, 16, 0);
imageconvolution($friend2, $gaussian, 16, 0);
imageconvolution($friend3, $gaussian, 16, 0);
}
$graph = imagecreatefromstring(file_get_contents(__DIR__ . '/../public/images/white-logo-transparent-medium.png', "r"));
$foreground = imagecreatefromstring(file_get_contents(__DIR__ . '/../public/images/share-foreground.png', "r"));
imagecopy($blueBackground, $friend1, -50, 25, 0, 0, imagesx($friend1), imagesy($friend1));
imagecopy($blueBackground, $friend2, 150, 25, 0, 0, imagesx($friend2), imagesy($friend2));
imagecopy($blueBackground, $friend3, 350, 25, 0, 0, imagesx($friend3), imagesy($friend3));
$graph = imagescale($graph, imagesx($friend1) * 2);
imagecopy($blueBackground, $graph, 80, -20, 0, 0, imagesx($graph), imagesy($graph));
imagecopy($blueBackground, $foreground, 0, 0, 0, 0, imagesx($foreground), imagesy($foreground));
ob_clean();
ob_start();
header('Content-Type: image/png');
imagepng($blueBackground);
}
示例7: create
public function create($login, $email, $password, $avatar)
{
$user = new User($this->link);
$user->setLogin($login);
$user->setEmail($email);
$user->setPassword($password);
$user->setAvatar($avatar);
$login = mysqli_real_escape_string($this->link, $user->getLogin());
$email = mysqli_real_escape_string($this->link, $user->getEmail());
$password = mysqli_real_escape_string($this->link, $user->getPassword());
$avatar = mysqli_real_escape_string($this->link, $user->getAvatar());
$request = "INSERT INTO user VALUES(NULL, '" . $login . "', '" . $email . "', '" . $password . "', '" . $avatar . "','')";
$res = mysqli_query($this->link, $request);
if ($res) {
return $this->select(mysqli_insert_id($this->link));
} else {
throw new Exception("Internal server error");
}
}
示例8: array
<?php
$widget_p_top = Widgets::instance()->render('post_top');
$widget_p_bot = Widgets::instance()->render('post_bottom');
?>
<?php
if ($post->taxonomy or $config->use_submitted) {
?>
<div class="row meta">
<?php
if ($config->use_submitted) {
?>
<div class="col-md-7">
<span class="author">
<?php
echo HTML::anchor($post->user->url, User::getAvatar($post->user));
?>
<?php
echo HTML::anchor($post->user->url, $post->user->nick, array('title' => $post->user->nick));
?>
</span>
<span class="date-created">
<?php
echo Date::date_format($post->created);
?>
</span>
</div>
<?php
}
?>
示例9: getTopThreeCatergory
private function getTopThreeCatergory()
{
//Returns three friends that are the first in the 3 categories in a presentable HTML format
$topLike = null;
$topComment = null;
$topTag = null;
foreach ($this->Data['interaction'] as $id => $person) {
if ($topLike['likes'] < $person['likes']) {
$topLike = array_merge($person, array('id' => $id));
}
if ($topComment['comments'] < $person['comments']) {
$topComment = array_merge($person, array('id' => $id));
}
if ($topTag['tags'] < $person['tags']) {
$topTag = array_merge($person, array('id' => $id));
}
}
$result = "";
if (!is_null($topLike)) {
$result .= "\n\t\t\t\t<div class='friend starred'>\n\t\t\t\t\t<p><b>Likes</b></p>\n\t\t\t\t\t<div class='avatar' style='background: url(\"" . User::getAvatar($topLike['id']) . "\") no-repeat; background-position: center; background-size: cover;'>\n\t\t\t\t\t\t<span>1<sup>st</sup></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p>" . $topLike['name'] . "</p>\n\t\t\t\t</div>\n\t\t\t";
}
if (!is_null($topComment)) {
$result .= "\n\t\t\t\t<div class='friend starred'>\n\t\t\t\t<p><b>Comments</b></p>\n\t\t\t\t\t<div class='avatar' style='background: url(\"" . User::getAvatar($topComment['id']) . "\") no-repeat; background-position: center; background-size: cover;'>\n\t\t\t\t\t<span>1<sup>st</sup></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p>" . $topComment['name'] . "</p>\n\t\t\t\t</div>\n\t\t\t";
}
if (!is_null($topTag)) {
$result .= "\n\t\t\t\t<div class='friend starred'>\n\t\t\t\t\t<p><b>Tagged</b></p>\n\t\t\t\t\t<div class='avatar' style='background: url(\"" . User::getAvatar($topTag['id']) . "\") no-repeat; background-position: center; background-size: cover;'>\n\t\t\t\t\t\t<span>1<sup>st</sup></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p>" . $topTag['name'] . "</p>\n\t\t\t\t</div>\n\t\t\t";
}
if ($result != "") {
$result = "\n\t\t\t\t<div class='topThree category'>\n\t\t\t\t<h5>" . $this->getPronoun() . " top interactive friends!</h5>\n\t\t\t\t{$result}\n\t\t\t\t</div>\n\t\t\t";
}
return $result;
}
示例10: flush
/**
*
* @param User $user
* @return int id of the User inserted in base. False if it didn't work.
*/
public static function flush($user)
{
$userId = $user->getId();
$login = $user->getLogin();
$password = $user->getPassword();
$mail = $user->getMail();
$inscriptionDate = $user->getInscriptionDate();
$firstName = $user->getFirstName();
$lastName = $user->getLastName();
$birthDate = $user->getBirthDate();
$address = $user->getAddress();
$phoneNumber = $user->getPhoneNumber();
$avatar = $user->getAvatar();
$role = $user->getRole()->getId();
if ($userId > 0) {
$sql = 'UPDATE user u SET ' . 'u.login = ?, ' . 'u.passwd = ?, ' . 'u.mail = ?, ' . 'u.inscription_date = ?, ' . 'u.first_name = ?, ' . 'u.last_name = ?, ' . 'u.birth_date = ?, ' . 'u.address = ?, ' . 'u.phone_number = ?, ' . 'u.avatar = ?, ' . 'u.ROLE_id_role = ? ' . 'WHERE u.id_user = ?';
$params = array('ssssssssssii', &$login, &$password, &$mail, &$inscriptionDate, &$firstName, &$lastName, &$birthDate, &$address, &$phoneNumber, &$avatar, &$role, &$userId);
} else {
$sql = 'INSERT INTO user ' . '(login, passwd, mail, inscription_date, first_name, ' . 'last_name, birth_date, address, phone_number, avatar, ROLE_id_role) ' . 'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
$params = array('ssssssssssi', &$login, &$password, &$mail, &$inscriptionDate, &$firstName, &$lastName, &$birthDate, &$address, &$phoneNumber, &$avatar, &$role);
}
$idInsert = BaseSingleton::insertOrEdit($sql, $params);
if ($idInsert !== false && $userId > 0) {
$idInsert = $userId;
}
return $idInsert;
}
示例11: __
<div class="panel-heading">
<h3 class="panel-title"><?php
echo __('Friends');
?>
</h3>
</div>
<?php
foreach ($friends as $id) {
?>
<div class="list-group-item friends panel-body">
<?php
$accept = User::lookup($id);
?>
<?php
echo HTML::anchor("user/view/" . $accept->id, User::getAvatar($accept), array('class' => 'action-view', 'rel' => "popover", 'data-placement' => "right", 'rel1' => "tooltip", 'data-html' => "true", 'data-original-title' => "<strong>{$accept->nick}</strong>"));
?>
<?php
echo HTML::anchor("user/view/" . $accept->id, $accept->nick, array('class' => 'action-view', 'title' => __('view profile')));
?>
<?php
if ($is_owner) {
?>
<?php
echo HTML::anchor("buddy/delete/" . $accept->id, '<i class="fa fa-trash-o"></i>', array('class' => 'action-delete pull-right', 'title' => __('Delete')));
?>
<?php
}
?>
</div>
示例12: toArray
public static function toArray(User $user)
{
$params = array(':userId' => $user->getId(), ':password' => $user->getPassword(), ':name' => $user->getName(), ':gender' => $user->getGender(), ':telephone' => $user->getTelephone(), ':email' => $user->getEmail(), ':avatar' => $user->getAvatar(), ':slogan' => $user->getSlogan(), ':birthday' => $user->getBirthday(), ':createdAt' => $user->getCreatedAt(), ':character' => $user->getCharacter());
return $params;
}
示例13: setAvatar
function setAvatar(User $user)
{
$parametros["avatar"] = $user->getAvatar();
$parametrosWhere = array();
$parametrosWhere["email"] = $user->getEmail();
return $this->bd->update2($this->tabla, $parametros, $parametrosWhere);
}
示例14: getProfileX
function getProfileX($mid)
{
global $people_allow_sexe, $people_allow_birthday, $people_allow_zodiac, $people_allow_website, $people_allow_nation;
$html = "";
// from User.class.php
$musername = getUsernameByMembershipID($this->Database, $mid);
$user = new User($musername);
$avat = $user->getAvatar();
$name_surname = $user->getNameSurname();
$age = $user->getAge();
$zsign = $this->evaluateZSign($user->getZSign());
$exact_birthday = date('m/d/Y', strtotime($user->getBirthday()));
$birthday = date('F, j', strtotime($user->getBirthday()));
$nationality_1 = $user->getNationality();
$nationality_flag_1 = $user->getNationalityFlag($nationality_1);
$sexe = $user->getSexe();
$sexeicon = $user->getSexeIcon($sexe);
$contact_icq = $user->getContactICQ();
$contact_jabber = $user->getContactJabber();
$contact_msn = $user->getContactMSN();
$contact_yahoo = $user->getContactYahoo();
$contact_aim = $user->getContactAIM();
$contact_email = $user->getEmail();
$website = $user->getWebSite();
$html .= <<<EOS
\t <div style="position:absolute;visibility:hidden;">
\t
\t
\t <textarea id="inf_namesurname">{$name_surname}</textarea>
\t <textarea id="inf_sexe">{$sexe}</textarea>"
\t <textarea id="inf_birthday">{$exact_birthday}</textarea>
\t <textarea id="inf_nationality">{$nationality_1}</textarea>
\t <textarea id="inf_myspace">{$website}</textarea>
\t
\t <textarea id="inf_email"></textarea>
\t <textarea id="inf_aim">{$contact_aim}</textarea>"
\t <textarea id="inf_msn">{$contact_msn}</textarea>
\t <textarea id="inf_yahoo">{$contact_yahoo}</textarea>
\t <textarea id="inf_jabber">{$contact_jabber}</textarea>
\t <textarea id="inf_icq">{$contact_icq}</textarea>
\t
\t
\t </div>
\t
EOS;
// and start the HTML
$html .= "<div class=\"vcard\">";
$html .= "<img class=\"photo\" src=\"{$avat}?" . rand(0, 1000) . "\" width=\"80\" alt=\"{$name_surname}\" height=\"80\" border=\"0\" align=\"left\" style=\"margin-bottom: 5px;margin-left: 15px; margin-right: 25px;\" />";
$html .= "<div style=\"font-size: 1.2em;\"><b><span class=\"fn\">{$name_surname}</span>";
if ($people_allow_birthday) {
$html .= " ({$age})";
}
$html .= "</b> ";
if ($people_allow_nation) {
$html .= "<img src=\"{$nationality_flag_1}\" width=\"16\" height=\"11\" border=\"0\" />";
}
$html .= "</div>";
if ($people_allow_website) {
$html .= "<div style=\"font-size: 1.1em;margin-bottom: 10px;\"><a class=\"url\" href=\"{$website}\">{$website}</a></div>";
}
$html .= "<div style=\"margin-bottom: 10px;\">";
if ($people_allow_sexe) {
$html .= "<img align=\"bottom\" src=\"{$sexeicon}\" border=\"0\" alt=\"\" width=\"16\" height=\"16\" /> ";
}
if ($people_allow_zodiac) {
$html .= $zsign . " (<span class=\"bday\">{$birthday}</span>)";
}
$html .= "</div>";
$html .= "";
/*
$html .= "<div>";
$html .= "<a class=\"url\" type=\"application/x-icq\" href=\"http://www.icq.com/people/cmd.php?uin={$contact_icq}&action=message\"><img src=\"{$this->OnlineStatusIndicator}icq/{$contact_icq}\" alt=\"\" border=\"0\" style=\"margin-right: 5px; margin-right: 25px;\" /></a>";
$html .= "<a class=\"url\" href=\"xmpp:{$contact_jabber}\"><img src=\"{$this->OnlineStatusIndicator}jabber/{$contact_jabber}\" alt=\"\" border=\"0\" style=\"margin-right: 5px; margin-right: 25px;\" /></a>";
$html .= "<a class=\"url\" href=\"msnim:chat?contact={$contact_msn}\"><img src=\"{$this->OnlineStatusIndicator}msn/{$contact_msn}\" alt=\"\" border=\"0\" style=\"margin-right: 5px; margin-right: 25px;\" /></a>";
$html .= "<a class=\"url\" href=\"ymsgr:sendIM?{$contact_yahoo}\"><img src=\"{$this->OnlineStatusIndicator}yahoo/{$contact_yahoo}\" alt=\"\" border=\"0\" style=\"margin-right: 5px; margin-right: 25px;\" /></a>";
$html .= "<a class=\"url\" href=\"aim:goim?screenname={$contact_aim}\"><img src=\"{$this->OnlineStatusIndicator}aim/{$contact_aim}\" alt=\"\" border=\"0\" style=\"margin-right: 5px; margin-right: 25px;\" /></a>";
$html .= "</div>";
*/
$html .= "</div>";
if (isset($_SESSION['valid_user']) && $musername == $_SESSION['valid_user']) {
$html .= <<<EOS
<script type="text/javascript" src="http://grou.ps/includes/wz_dragdrop.js"></script>
<script type="text/javascript">
<!--
function crop_preloader() {
SET_DHTML('theCrop');
}
crop_preloader();
function my_DragFunc()
{
var z = xHeight('theImage')<=xWidth('theImage')?xHeight('theImage'):xWidth('theImage');
//.........这里部分代码省略.........
示例15: __
<?php
}
?>
<li><a href="<?php
echo URL::site('/user/login');
?>
"><i class="fa fa-fw fa-chevron-left"></i><?php
echo __('Sign In');
?>
</a></li>
<?php
} else {
?>
<li class="dropdown">
<?php
echo HTML::anchor('#', User::getAvatar($_user, array('size' => 20)) . ' ' . $_user->name . '<b class="caret"></b>', array('data-toggle' => 'dropdown', 'class' => 'dropdown-toggle'));
?>
<ul class="dropdown-menu">
<li class="dropdown-header"><strong><?php
echo $_user->nick;
?>
</strong></li>
<li class="dropdown-header"><?php
echo $_user->mail;
?>
</li>
<li class="divider"></li>
<li class="dropdown-header"><?php
_e('Profile');
?>