<div class="aside-page"> <?php if (!empty($users)) { ?> <div class="aside-mod"> <?php foreach ($users as $user) { ?> <div class="media"> <div class="media-left"> <a href="<?php echo Yii::app()->createUrl('index/media', array('id' => $user['id'])); ?> "> <img class="media-object img-circle" width="50px" height="50px" src="<?php echo zmf::avatar($user, 170, true); ?> " alt="<?php echo $user['truename']; ?> "> </a> </div> <div class="media-body"> <h5 class="media-heading"> <?php echo CHtml::link($user['truename'], array('index/media', 'id' => $user['id'])); ?> </h5> <p>
* @filename _media.php * @Description 媒体循环列表模板 * @author 阿年飞少 <*****@*****.**> * @link http://www.newsoul.cn * @copyright Copyright©2015 阿年飞少 * @datetime 2015-7-6 15:25:37 */ ?> <div class="media post-item"> <div class="media-left"> <a href="<?php echo Yii::app()->createUrl('index/media', array('id' => $data['id'])); ?> "> <img class="media-object img-circle" width="80px" height="80px" src="<?php echo zmf::avatar($data, 170, true); ?> " alt="<?php echo $data['truename']; ?> "> </a> </div> <div class="media-body"> <h4 class="media-heading"> <?php echo CHtml::link($data['truename'], array('index/media', 'id' => $data['id'])); ?> </h4> <p class="color-grey"><?php
<?php /** * @filename _author.php * @Description * @author 阿年飞少 <*****@*****.**> * @link http://www.newsoul.cn * @copyright Copyright©2015 阿年飞少 * @datetime 2015-7-6 17:32:39 */ if (!empty($userInfo)) { ?> <div class="aside-mod"> <p><?php echo CHtml::link(zmf::avatar($userInfo), array('index/media', 'id' => $userInfo['id'])); ?> </p> <p><?php echo CHtml::link($userInfo['truename'], array('index/media', 'id' => $userInfo['id'])); ?> </p> <?php if ($userInfo['desc'] != '') { ?> <p class="help-block"><i class="icon-info-sign"></i> <?php echo $userInfo['desc']; ?> </p><?php } ?> <?php
if (!empty($this->newMembers)) { ?> <div class="mod" id="new_members"> <div class="hd"> <h2><?php echo zmf::t('newUsers'); ?> </h2> </div> <div class="bd"> <ul class="lists"> <?php foreach ($this->newMembers as $new) { ?> <li><?php echo zmf::avatar($new['id']); ?> </li> <?php } ?> </ul> </div> </div> <?php } ?> <?php } else { if (!empty($nearby)) { ?>
* @Description * @author 阿年飞少 <*****@*****.**> * @link http://www.newsoul.cn * @copyright Copyright©2015 阿年飞少 * @datetime 2015-7-6 17:32:39 */ if (!empty($userInfo)) { ?> <ul class="ui-list ui-list-link"> <li class="ui-border-t" data-href="<?php echo Yii::app()->createUrl('index/media', array('id' => $userInfo['id'])); ?> "> <div class="ui-list-img"> <span style="background-image:url(<?php echo zmf::avatar($userInfo, 170, true); ?> )"></span> </div> <div class="ui-list-info"> <h4 class="ui-nowrap"><?php echo $userInfo['truename']; ?> </h4> <p class="color-grey ui-nowrap"><?php echo $userInfo['desc']; ?> </p> <p><?php echo $userInfo['posts'] . '作品' . ' ' . $userInfo['hits'] . '热度'; ?>
<h3 class="item-title">上传头像</h3> <?php $imgurl = zmf::avatar($this->userInfo, 170, true); $this->renderPartial('/common/_noModelUpload', array('uploadurl' => Yii::app()->createUrl('attachments/simpleUpload', array('type' => 'avatar', 'fileholder' => 'noModelUpload_holder')), 'imgurl' => $imgurl)); ?> <p class="help-block">建议上传高宽大于200px的图片;图片上传后会被裁剪为正方形</p>
<div class="aside-page"> <div class="aside-mod"> <p><?php echo CHtml::link(zmf::avatar($this->userInfo), array('users/index')); ?> </p> <p><?php echo CHtml::link($this->userInfo['truename'], array('users/index')); ?> </p> <p class="help-block"><?php echo zmf::subStr($this->userInfo['desc'], 140); ?> </p> </div> <div class="list-group"> <?php echo CHtml::link('<i class="icon-bell-alt"></i> 提醒', array('users/notice'), array('class' => 'list-group-item')); ?> <?php echo CHtml::link('<i class="icon-cog"></i> 基本设置', array('users/config'), array('class' => 'list-group-item')); ?> <?php echo CHtml::link('<i class="icon-info-sign"></i> 更新资料', array('users/update', 'type' => 'info'), array('class' => 'list-group-item')); ?> <?php echo CHtml::link('<i class="icon-key"></i> 修改密码', array('users/update', 'type' => 'passwd'), array('class' => 'list-group-item')); ?> <?php echo CHtml::link('<i class="icon-user"></i> 上传头像', array('users/avatar'), array('class' => 'list-group-item')); ?>
/** * 卡片,包括用户及提到的坐标 */ public function actionCard() { $type = zmf::filterInput($_GET['type'], 't', 1); $id = zmf::filterInput($_POST['id']); if (!$type || !$id) { $this->jsonOutPut(0, '缺少参数'); } if ($type == 'user') { $info = Users::getUserInfo($id); if (!$info) { $this->jsonOutPut(0, '用户不存在'); } if ($id == zmf::uid()) { $itself = 1; } else { $itself = 0; } $favored = 0; if (zmf::uid() && $id != zmf::uid()) { $_info = Favorites::checkFavored($id, 'user'); if ($_info) { $favored = 1; } } $count = Users::getCounts($id, $info); $data = array('avatar' => zmf::avatar($id, 'small', true), 'userurl' => Yii::app()->createUrl('users/index', array('id' => $id)), 'username' => $info['truename'], 'posts' => $count['posts'], 'answers' => $count['answers'], 'tips' => $count['tips'], 'reputation' => $info['reputation'], 'badge' => $info['badge'], 'itself' => $itself, 'favored' => $favored, 'uid' => $id, 'desc' => $info['desc'], 'p_url' => Yii::app()->createUrl('users/index', array('id' => $id, 'type' => 'posts')), 'a_url' => Yii::app()->createUrl('users/index', array('id' => $id, 'type' => 'answer')), 't_url' => Yii::app()->createUrl('users/index', array('id' => $id, 'type' => 'tips'))); } $this->jsonOutPut(1, $data); }