本文整理汇总了PHP中UserModel::getUserAvatar方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModel::getUserAvatar方法的具体用法?PHP UserModel::getUserAvatar怎么用?PHP UserModel::getUserAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserModel
的用法示例。
在下文中一共展示了UserModel::getUserAvatar方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFriendsInGroup
public function showFriendsInGroup($user_id, $group_id)
{
$friendModel = new FriendModel();
$aFirends = $friendModel->getFriendsInGroup($user_id, $group_id);
$htmlStr = "";
$counter = count($aFirends);
$i = 1;
$userModel = new UserModel();
foreach ($aFirends as $friend) {
$user_default_avatar = $userModel->getUserAvatar($friend['id']);
$avator_path = $user_default_avatar['sys_av_id'] ? $user_default_avatar['sys_path'] : $user_default_avatar['path'];
if (!$avator_path || $avator_path == 'no.png') {
$avator_path = $this->image_url . 'avatar/no25.jpg';
} else {
$avator_path = $this->image_url . 'avatar/' . $avator_path;
}
$htmlStr .= '<dd class="friend-list-dd ' . ($counter == $i ? 'last' : '') . '">
<a class="nm" href="' . Project::getRequest()->createUrl('User', 'Profile', null, $friend['login']) . '">' . $friend['login'] . '<img src="' . $avator_path . '" class="avatar" alt="' . $user_default_avatar['av_name'] . '" /></a>
<span class="memo">( <span>Заметка</span>: ' . $friend['note'] . ' )</span>
<div class="act">
<form name="editForm" method="post" action="' . Project::getRequest()->createUrl('Messages', 'Friend') . '">
<input type="hidden" value="changeFriend" name="messageAction" />
<input type="hidden" value="' . $friend['id'] . '" name="friend_table_id"/>
<a onclick="this.parentNode.submit(); return false;" href="#">редактировать</a>
</form>
</div>
</dd>';
$i++;
}
return $htmlStr;
}
示例2: CorrespondenceWithAction
public function CorrespondenceWithAction()
{
$messagesModel = new MessagesModel();
$userModel = new UserModel();
$user = Project::getUser()->getDbUser();
$request = Project::getRequest();
$corr_user_id = $request->corr_user_id;
// $this -> _view -> assign('tab_list', TabController::getOwnTabs(false, false, false, false, false, false, false, false, false, $corr_user_id));
$this->_view->assign('tab_list', TabController::getOwnTabs(false, false, false, false, false, false, false, false, false, true));
$correspondent_user = $userModel->getUserById($corr_user_id);
$this->_view->assign('user_login', $user->login);
$this->_view->assign('correspondent_user_login', $correspondent_user['login']);
$this->_view->assign('corr_user_id', $request->corr_user_id);
$this->_view->assign('correspondent_user', $correspondent_user);
$this->_view->assign('correspondent_user_avatar', $userModel->getUserAvatar($request->corr_user_id));
$this->_view->assign('user_id', $user->id);
$this->_view->assign('curr_user', $userModel->getUserById($user->id));
$this->_view->assign('curr_user_avatar', $userModel->getUserAvatar($user->id));
$this->_view->assign('curr_user_avatars', $userModel->getAllUserAvatars($user->id));
$aMessages = $messagesModel->getCorrespondenceBetweenUsers(array($user->id, $correspondent_user['id']));
$this->_view->assign('aMessages', $aMessages);
$this->_view->CorrespondenceWithPage();
$this->_view->parse();
}
示例3: CommentList
/**
*
*/
public function CommentList($item_id, $page_number, $page_size, $cur_controller, $cur_action, $item_name, $params, $allowComment = 1)
{
$userModel = new UserModel();
$info = array();
if ((int) $page_size <= 0) {
$page_size = self::DEFAULT_COMMENT_PER_PAGE;
}
$request = Project::getRequest();
$user = Project::getUser()->getDbUser();
$isAdmin = $user->user_type_id == 1 ? true : false;
$user_id = (int) Project::getUser()->getDbUser()->id;
$info['cur_controller'] = $cur_controller;
$info['cur_action'] = $cur_action;
$info['item_name'] = $item_name;
$info['add_comment_element_id'] = $item_id;
$info['add_comment_id'] = 0;
$info['isAdmin'] = $isAdmin;
$info['user_id'] = $user_id;
$info['default_avatar'] = $userModel->getUserAvatar($user_id);
$requested_user_id = (int) Project::getUser()->getShowedUser()->id;
$model = new CommentModel($item_name . '_comment', $item_name . '_id', 0);
$pager = new DbPager($page_number, $page_size);
$model->setPager($pager);
$list = $model->loadByItem($item_id);
foreach ($list as &$item) {
if ($user_id > 0 && ($user_id === $requested_user_id || (int) $item['user_id'] === $user_id || $isAdmin)) {
$item['del_link'] = $request->createUrl("BaseComment", "DeleteComment", array($item_id, $item['id'], $item_name));
} else {
$item['del_link'] = false;
}
}
$info['add_comment_url'] = $request->createUrl('BaseComment', 'AddComment');
$info['change_comment_url'] = $request->createUrl('BaseComment', 'EditComment');
$info['comment_list'] = $list;
$pager_view = new SitePagerView();
$info['comment_list_pager'] = $pager_view->show2($model->getPager(), $cur_controller, $cur_action, $params);
$info['user_moods'] = $userModel->getAllUserMoods($user_id);
$info['user_avatars'] = $userModel->getAllUserAvatars($user_id);
$info['allowComment'] = $allowComment;
$this->_view->CommentList($info);
return $this->_view->parse();
}
示例4: sendMessage
function sendMessage($form, $to, $subject, $body, $avatar = false, $allow_html = true)
{
if ($allow_html) {
$this->header = $subject;
$this->m_text = $body;
} else {
$this->header = stripslashes(htmlspecialchars($subject));
$this->m_text = stripslashes(htmlspecialchars($body));
}
$this->send_date = date("Y-m-d H:i:s");
$this->author_id = $form;
$this->recipient_id = $to;
if (!$avatar) {
$user = new UserModel();
$user->load($from);
$this->avatar_id = $user->getUserAvatar($user->id);
$this->avatar_id = $this->avatar_id['id'];
} else {
$this->avatar_id = $avatar;
}
$this->is_read = 0;
$this->is_deleted = 0;
$messageId = $this->save();
return $messageId;
}
示例5: foreach
<h2>Найдено <span><?=$finded_user_num; ?></span> пользователя:</h2>
<? } ?>
<ul class="user-blog-view">
<? foreach($this->list_search_user as $key => $item) { ?>
<?php if($item['time_online']) {
$online_offline = 'online-icon';
}
else {
$online_offline = 'offline-icon';
}
?>
<li class="it clearfix">
<dl>
<?php
$userModel = new UserModel();
$user_default_avatar = $userModel->getUserAvatar($item['id']);
?>
<?php $avator_path = ($user_default_avatar['sys_av_id'])?$user_default_avatar['sys_path']:$user_default_avatar['path'];
if(!$avator_path || $avator_path == 'no.png') $avator_path = $this->image_url.'avatar/no90.jpg';
else $avator_path = $this->image_url.'avatar/'.$avator_path;
?>
<dt><a href="<?=$request->createUrl('Index','Index', null, $item['login']);?>" class="with-icon-s"><i class="icon-s <?=$online_offline; ?>"></i><?=$item['first_name']; ?> <?=$item['last_name']; ?></a> [ <a href="<?=$request->createUrl('Index','Index', null, $item['login']);?>"><?=$item['login']; ?></a> ]</dt>
<dd class="av"><a href="<?=$request->createUrl('Index','Index', null, $item['login']);?>"><img class="avatar" alt="<?php echo $user_default_avatar['av_name'];?>" src="<?php echo $avator_path;?>" /></a></dd>
<dd>
<? if ($item['country_name'] != '') { echo $item['country_name'].','; } ?>
<?=$item['city_name'];?>,
<? if ($item['user_age'] != '') { ?>
<?=$item['user_age'];?> лет<br />
<? } ?>
<? if ($item['registration_date'] != '') { ?>
Зарегистрирован : <?=date_format(new DateTime($item['registration_date']),'d.m.Y');?><br />
示例6: foreach
<div class="d-wrap clearfix">
<div class="d-content"><div class="inn">
<table class="stat-table">
<thead>
<tr>
<th>Тема</th>
<th>Предложил</th>
</tr>
</thead>
<tbody id="themeTable">
<?php $i=1; foreach ($this->aThemes as $theme){
//if ($i/2 == 1){$tr_id = ""; $i=1;} else {$tr_id = "cmod_tab2"; $i++;}
$tr_id = "cmod_tab2";
if ($this->isAdmin || $this->user_id == $theme['user_id']) {$delTheme = '<a href="'.$this->createUrl('Debate', 'DebateDelTheme').'/theme_id:'.$theme['debate_theme_id'].'" class="red">Удалить</a> ';} else $delTheme='';
$userModel = new UserModel();
$user_default_avatar = $userModel->getUserAvatar($theme['user_id']);
$avator_path = ($user_default_avatar['sys_av_id'])?$user_default_avatar['sys_path']:$user_default_avatar['path'];
if(!$avator_path || $avator_path == 'no.png') $avator_path = $this->image_url.'avatar/no25.jpg';
else $avator_path = $this->image_url.'avatar/'.$avator_path;
echo '
<tr id="'.$tr_id.'">
<td class="qv"><a href="#">'.$delTheme.$theme['debate_theme_theme'].'</a></td>
<td class="av"><a class="avatar-link" href="'.$this->createUrl('User', 'Profile', null, $theme['login']).'"><img src="'.$avator_path.'" alt="" class="avatar" style="width:25px;height:25px;"/><span class="t">'.$theme['login'].'</span></a></td>
</tr>';
} ?>
</tbody>
</table>
<ul class="short-pages-list">
<?php echo $this->debate_pager; ?>
</ul>
示例7: if
</div>
<!-- /site-info -->
<div class="user-bar clearfix">
<?php
// $v_session = Project::getSession();
// print '<pre>!!!!!!!!!!!!!!';
// print_r($v_session -> getKey('logged', false));
// print '</pre>';
?>
<?php if($this->current_user && ((int)$this->current_user->id > 0)) {?>
<?php
$nr = Project::getUser()->getDbUser()->getUserRateNMByRegistrationData($this->current_user->id);
$user = Project::getUser()->getDbUser()->getUserById($this->current_user->id);
$userModel = new UserModel();
$user_default_avatar = $userModel->getUserAvatar($this->current_user->id);
$avator_path = ($user_default_avatar['sys_av_id'])?$user_default_avatar['sys_path']:$user_default_avatar['path'];
if(!$avator_path || $avator_path == 'no.png') $avator_path = $this->image_url.'avatar/no25.jpg';
else $avator_path = $this->image_url.'avatar/'.$avator_path;
?>
<ul>
<li class="user-link"><a href="<?php echo $this->createUrl('User', 'Profile', null, $this->current_user->login)?>"><img style="width: 28px; height: 25px;" src="<?=$avator_path; ?>" alt="<?php echo $this->current_user->login;?>" /><?php echo $this->current_user->login;?></a></li>
<li class="updates-link">
<div class="dropdown">
<div class="d-head">
<i class="icon updates-icon"></i><a href="#" class="script-link"><span class="t">Обновления (30)</span><i class="arrow-icon"></i></a>
</div>
<div class="d-body">
<ul>
<li><a href="<?php echo $this->createUrl('Messages', 'Friend',null, $this->current_user->login); ?>">Друзья</a> (2)</li>
示例8: MoodAction
public function MoodAction()
{
$userModel = new UserModel();
$user = Project::getUser()->getShowedUser();
$isAdmin = $user->user_type_id == 1 ? true : false;
$request = Project::getRequest();
$this->_view->clearFlashMessages();
$noErrors = true;
if ($request->mood_action == 'ok') {
if ($request->add_mood) {
if (!$request->mood_name) {
$this->_view->addFlashMessage(FM::ERROR, "Выберите текст настроения");
$noErrors = false;
}
if ($noErrors) {
$userModel->addMood($user->id, $request->mood_name);
Project::getResponse()->redirect(Project::getRequest()->createUrl('User', 'Mood'));
}
} elseif ($request->change_mood) {
$aMoodNames = $request->moods;
foreach ($aMoodNames as $mood_id => $mood_name) {
$userModel->changeMood($mood_id, $mood_name);
}
$aMoodDelete = $request->del_moods;
foreach ($aMoodDelete as $mood_id => $mood_del_val) {
$userModel->delMood($mood_id);
}
}
}
$this->_view->assign('user_moods', $userModel->getAllUserMoods($user->id));
$this->_view->assign('user_default_avatar', $userModel->getUserAvatar($user->id));
$this->_view->assign('user_profile', $user->data());
$this->_view->assign('user', $user);
$this->_view->assign('isAdmin', $isAdmin);
$this->_view->assign('tab_list', TabController::getOwnTabs(true));
$this->_view->MoodPage();
$this->_view->parse();
}
示例9: UserModel
echo $online ? 'online' : 'offline';
?>
</span></span>
</div>
<div class="user-profile">
<div class="clearfix">
<dl class="main-info">
<dt> <strong><?
if(!trim($name_usr)) echo 'Нет имени';
else echo $name_usr;?></strong> / <span class="nick"><?php
echo $user['login'];
?>
</span> /</dt>
<?php
$userModel = new UserModel();
$user_default_avatar = $userModel->getUserAvatar($this->showed_user_profile['id']);
?>
<?php
$avator_path = $user_default_avatar['sys_av_id'] ? $user_default_avatar['sys_path'] : $user_default_avatar['path'];
if (!$avator_path || $avator_path == 'no.png') {
$avator_path = $this->image_url . 'avatar/no90.jpg';
} else {
$avator_path = $this->image_url . 'avatar/' . $avator_path;
}
?>
<dd class="av"><img alt="<?php
echo $user_default_avatar['av_name'];
?>
" src="<?php
echo $avator_path;
?>
示例10: DebateAction
//.........这里部分代码省略.........
$current_page_number=$request->getKeyByNumber(0);
$debate_pager = $pager_view->show3('Debate', 'Debate', array(), $pages_number, $current_page_number);
$this-> _view -> assign('debate_pager', $debate_pager);
$page_settings = array("record_per_page"=>$record_per_page, "current_page_number"=>$current_page_number+1);
// END PAGER
$aThemes = $debateModel->getAllThemesPager($page_settings, "debate_theme.votes DESC");
*/
$aThemes = $debateModel->getAllThemes("debate_theme.votes DESC");
$this->_view->assign('aThemes', $aThemes);
$isVoted = $debateModel->getThemeVoteByUserId($user->id);
$this->_view->assign('isVoted', $isVoted);
$this->_view->DebateVoteThemePage();
// END ETAP 2.
} elseif ($activeEtap['name'] == 'ChooseSecondUser') {
// ETAP 3. Election for Secont USER , by auction, who pay more - get part in debate
$userModel = new UserModel();
if ($request->doStake && $request->stake_amount && $user->nextmoney >= $request->stake_amount) {
$stake_amount = abs($request->stake_amount);
$result = $debateModel->doStakeSecondUser($user->id, $stake_amount, $debateNow);
if ($result) {
$userModel->changeUserMoney($debateNow['user_id_2'], 0, $debateNow['stake_amount'], "возвращение ставки в дебатах");
$userModel->changeUserMoney($user->id, 0, -$stake_amount, "ставка в дебатах, при выборе 2-го учасника");
}
$this->returnStakeSecondUser($stake_amount);
return;
//Project::getResponse()->redirect(Project::getRequest()->createUrl('Debate', 'Debate'));
}
$currentUser = $userModel->getUserById($user->id);
$this->_view->assign('currentUser', $currentUser);
$user1 = $userModel->getUserById($debateNow['user_id_1']);
$this->_view->assign('debateUser1', $user1);
$user2 = $userModel->getUserById($debateNow['user_id_2']);
$this->_view->assign('debateUser2', $user2);
$user1_avatar = $userModel->getUserAvatar($debateNow['user_id_1']);
$this->_view->assign('user1_avatar', $user1_avatar);
$user2_avatar = $userModel->getUserAvatar($debateNow['user_id_2']);
$this->_view->assign('user2_avatar', $user2_avatar);
$this->_view->DebateChooseSecondUserPage();
// END ETAP 3. Election for Secont USER , by auction
} elseif ($activeEtap['name'] == 'ChooseHelpers') {
// ETAP 4. Election for Helpers
$userModel = new UserModel();
if ($request->helper1) {
$lastHelperId = $debateModel->addHelperCheck($user->id, $debateNow['user_id_1']);
$this->returnChooseHelpers($lastHelperId);
return;
//Project::getResponse()->redirect(Project::getRequest()->createUrl('Debate', 'Debate'));
} elseif ($request->helper2) {
$lastHelperId = $debateModel->addHelperCheck($user->id, $debateNow['user_id_2']);
$this->returnChooseHelpers($lastHelperId);
return;
//Project::getResponse()->redirect(Project::getRequest()->createUrl('Debate', 'Debate'));
} elseif ($request->check_helper) {
$isInHelperTable = $debateModel->isInHelperTable($request->check_helper);
if ($isInHelperTable && $isInHelperTable['debate_user_id'] == $user->id) {
if (!$userNumber) {
Project::getResponse()->redirect(Project::getRequest()->createUrl('Debate', 'Debate'));
}
if ($debateNow['helper_id_' . $userNumber . '_1'] != $request->check_helper && $debateNow['helper_id_' . $userNumber . '_2'] != $request->check_helper) {
if (!$debateNow['helper_id_' . $userNumber . '_1']) {
$debateModel->changeOneValue('debate_now', $debateNow['id'], 'helper_id_' . $userNumber . '_1', $request->check_helper);
} elseif (!$debateNow['helper_id_' . $userNumber . '_2']) {
$debateModel->changeOneValue('debate_now', $debateNow['id'], 'helper_id_' . $userNumber . '_2', $request->check_helper);
}
}
}
示例11: returnThemesVote
function returnThemesVote($message)
{
$debateModel = new DebateModel();
$response = Project::getAjaxResponse();
$lastThemeId = $message['lastThemeId'];
$aThemes = $debateModel->getAllThemes("debate_theme.votes DESC");
$isVoted = $debateModel->getThemeVoteByUserId($message['user_id']);
$strTable = '<table class="stat-table questions">
<thead>
<tr>
<th class="main-row">Тема</th>
<th>Предложил</th>
<th>Голосов</th>
<th>Действия</th>
</tr>
</thead>
<tbody>';
$userModel = new UserModel();
foreach ($aThemes as $theme) {
if ($message['user_id'] && !$isVoted && $message['user_id'] != $theme['user_id']) {
$vote = '<i class="big-icon vote-en-icon"></i><a href="javascript: void(0);" onclick="vote_theme(' . $theme['debate_theme_id'] . ', \'theme\');">голосовать</a>';
} elseif ($message['user_id'] == $theme['user_id']) {
$vote = '<span class="my-vote"><i class="big-icon vote-my-icon"></i>моя тема</span>';
} else {
$vote = '<span><i class="big-icon vote-ds-icon"></i>голос принят</span>';
}
$user_default_avatar = $userModel->getUserAvatar($theme['user_id']);
$avator_path = $user_default_avatar['sys_av_id'] ? $user_default_avatar['sys_path'] : $user_default_avatar['path'];
if (!$avator_path || $avator_path == 'no.png') {
$avator_path = $this->image_url . 'avatar/no25.jpg';
} else {
$avator_path = $this->image_url . 'avatar/' . $avator_path;
}
$strTable .= '<tr>
<td class="qv"><a href="#">' . $theme['debate_theme_theme'] . '</a></td>
<td class="av"><a class="avatar-link" href="' . Project::getRequest()->createUrl('User', 'Profile', null, $theme['login']) . '"><img src="' . $avator_path . '" alt="" class="avatar" style="width:25px;height:25px;" /><span class="t">' . $theme['login'] . '</span></a></td>
<td class="an">' . (int) $theme['debate_theme_votes'] . '</td>
<td class="act">' . $vote . '</td>
</tr>';
}
$strTable .= '</tbody>
</table>';
$response->block('themeDivTable', true, $strTable);
}