public static function error($message, $type = 'error', $notification = 'true', $forwardUrl = '', $callbackType = 'closeCurrent') { if ($message instanceof CModel) { if ($message->hasErrors()) { $message = preg_replace("/\n/", '', CHtml::errorSummary($message)); } else { $message = ''; } } YiicmsHelper::responseAjax($message, $type, $notification, $forwardUrl, $callbackType); }
public function actionBoardDelete() { $params = array('board_reply' => $_POST['board_reply'], 'object_type' => $_POST['object_type'], 'object_id' => $_POST['object_id']); $pk = $_POST['people_pk']; $PeopleBoard = new PeopleBoard(); $model = $PeopleBoard->findByPk($pk); if (!empty($model)) { //当导师未回复前,发表者允许删除. 导师可以自己删除回复 if ($model->isDeleteAccess()) { $model->deleteMark(); YiicmsHelper::ok('删除成功。'); } } YiicmsHelper::error('回复失败,可能留言不存在。'); }
<!-- 留言板 --> <?php YiicmsHelper::_cklogin(); $form = $this->beginWidget('BootActiveForm', array('id' => $htmlOptions['id'], 'action' => $action, 'enableClientValidation' => true, 'clientOptions' => array('validateOnSubmit' => true))); ?> <input type="hidden" value="<?php echo $refer; ?> " name="refer"> <input type="hidden" value="<?php echo $formhash; ?> " name="formhash"> <?php echo $form->hiddenField($model, 'object_id'); ?> <?php echo $form->hiddenField($model, 'object_type'); ?> <div class="row"> <?php echo $form->textArea($model, 'board_content', array('class' => 't_input t_area reply_form', 'style' => "height:40px;")); ?> <?php echo CHtml::errorSummary($model); ?> <?php echo $form->error($model, 'content'); ?> </div> <?php
?> <?php if (!isset($no_author)) { ?> <td> <?php echo CHtml::link($topic->user->username, array('/space/index', 'uid' => $topic['uid'])); ?> </td> <?php } ?> <td> <?php if ($topic['postcount'] > 0) { echo $topic['postcount']; } ?> </td> <td align="right"> <span class="color02"><?php echo YiicmsHelper::friendlyDate('m-d H:i', $topic['replytime'] ? $topic['replytime'] : $topic['ctime']); ?> </span> </td> </tr> <?php } ?> </table>
</span> <span class="left"> <a href="<?php echo Yii::app()->createUrl('/space/', array('uid' => $last['uid'])); ?> "> <strong class="name<?php echo $last['uid']; ?> "><?php echo $last['name']; ?> </strong> </a> <span class="time"><?php echo YiicmsHelper::friendlyDate('Y-m-d H:s', $last['ctime']); ?> </span> </span> </h4> <p><?php echo $last['comment']; ?> <a href="javascript:reply(<?php echo $last['uid']; ?> ,<?php echo $id; ?> )" onclick="">回复</a></p> </div>
<a href="<?php echo $this->createUrl('/space/index', array('uid' => $topic['uid'])); ?> " class="tips"> <?php echo $post->user->getUserName(); ?> </a> </h4> <div id="comment_<?php echo $post['id']; ?> " class=""> <?php echo YiicmsHelper::CMarkdown($post->content); ?> </div> <textarea id="comment_txt_<?php echo $topic['id']; ?> " style="display:none;">子非鱼,焉知鱼之乐。</textarea> <div id="operate_<?php echo $topic['id']; ?> " class="operate"> <?php if ($topic['lock'] == 1 || empty($actor_level) || 1) { ?> <?php } else {
<h2><?php echo CHtml::link('> 回' . $group['name'] . '小组', array('/group/group/show', 'gid' => $group['id'])); ?> </h2> <?php if (!empty($new_topics)) { ?> <h2>本组最近其他话题</h2> <div class="sidebar"> <ul> <?php foreach ($new_topics as $topic) { ?> <li> <?php echo CHtml::link(YiicmsHelper::cutString($topic->getTopicTitle(), 22), array('topic/show', 'tid' => $topic['id']), array('title' => $topic->getTopicTitle())); ?> <span class="pl"> (<?php echo $topic->user->username; ?> )</span> </li> <?php } ?> </ul> </div> <br/> <?php }
<?php } ?> </td> <td width="70"> <?php $this->widget('WUserFace', array('uid' => $msg_user->id)); ?> </td> <td width="184"> <?php echo $msg_user->getSpaceUrlWithName(); ?> <br /> <?php echo YiicmsHelper::friendlyDate('Y-m-d H:i', $msg->ctime); ?> </td> <td width="473"> <?php if ($msg["is_read"]) { ?> <?php echo CHtml::link($msg->subject, array('show', 'msg_id' => $msg->id)); ?> <?php } else { ?> <strong><?php echo CHtml::link($msg->subject, array('show', 'msg_id' => $msg->id)); ?>
</span> <a href="<?php echo $this->createUrl('/space/', array('uid' => $vo['uid'])); ?> " class="U"><?php echo $vo->username; ?> </a> </div> <div class="left" style="width: 67%;"> <h3 class="f14px"><?php echo CHtml::link($vo->subject, array('/vote/show', 'uid' => $vo->uid, 'id' => $vo->id), array('class' => 'U')); ?> </h3> <p class="cGray2">投票发起时间:<?php echo YiicmsHelper::friendlyDate('Y-m-d', $vo->ctime); ?> </p> <p class="cGray2">目前投票人数:<?php echo $vo->votercount; ?> </p> <p><span class="right">此投票由<?php echo CHtml::link($vo->username, array('/space/', 'uid' => $vo->uid)); ?> 发起。</span> <?php if ($vo['expiration'] <= time()) { ?> <span class="cRed">已结束</span> <?php
<p class="date"> <?php if ($ones->isDeleteAccess()) { ?> <a href="<?php echo $this->controller->createUrl('/board/Delete', array('people_pk' => $ones->primaryKey)); ?> " class="a_confirm_link" data-title="确认删除本评论吗?">删除</a> <?php } ?> <?php echo YiicmsHelper::friendlyDate('Y-m-d H:i:s', strtotime($ones['ctime'])); ?> </p> <?php if ($ones['object_type'] == 'mentor') { ?> <!-- board --> <?php if (!empty($ones->board_reply)) { ?> <div class="reply"> <div class="handler"> <span class="tips">导师回复</span> </div> <p class="replyedContent"> <?php
} ?> <?php if ($subcomment['status'] == 1) { ?> <span class="ml5"><?php echo $delete; ?> </span><?php } ?> <?php echo CHtml::link($subcomment['name'], array('/space', 'uid' => $subcomment['uid'])); ?> <em class="cGray2"><?php echo YiicmsHelper::friendlyDate('Y-m-d H:i:s', $subcomment['ctime']); ?> </em> <?php if ($subcomment['quietly'] == 1) { ?> <strong style="color:red">[悄悄话]</strong><?php } ?> </h3> <p><?php echo $subcomment['comment']; ?> </p> </div> <div class="c"></div>
</h1> </div> <div class="content"> <div class="alert-message block-message warning"> <a class="close" href="#"></a> <?php echo $group['logo']; ?> <?php echo YiicmsHelper::CMarkdown($group->intro); ?> <div class="cdate">创建于 <?php echo YiicmsHelper::friendlyDate('m-d H:i', $group['ctime']); ?> </div> <div class="member_op clearfix"> <?php if ($this->module->isGroupMember) { ?> 我是这个小组的成员 <?php echo CHtml::link('> 退出小组', array('group/quit', 'gid' => $group['id']), array('class' => 'a_confirm_link', 'data-title' => '真的要退出小组吗?')); ?> <?php } ?> <div style="float:right"> <?php
/** * 好友添加 */ public function actionAdd() { $model = new Friend(); $uid = Yii::app()->user->id; $fuid = Yii::app()->request->getParam('uid'); $msg = ''; //不允许加自己好友 if ($fuid == $uid) { $msg = '不允许自己加自己好友...'; } $t = Yii::app()->request->getParam('t'); //加好友的权限设置 if ($t != "agree") { //$model->__checkeFriendPrivacy($fuid); } //检查好友状态 $is_add = $model->checkFriendStatus($uid, $fuid); if ("1" === $is_add) { $msg = '你们已经是好友了...'; } elseif ("0" === $is_add) { $msg = '等待验证中...'; } //对方已经发过请求了,直接就加为好友 if ("0" === $model->checkFriendStatus($fuid, $uid)) { //并且弹出好友分组页面 //$model->__straightAddFrends($fuid,intval($_GET['nid'])); } $model->fuid = $fuid; if (isset($_POST['Friend'])) { $model->attributes = $_POST['Friend']; if ($model->save()) { YiicmsHelper::goBack(); #$this->redirect(array('list')); } } $data = array('model' => $model, 'msg' => $msg); if (Yii::app()->request->isAjaxRequest) { $this->renderPartial('add', $data); } else { $this->render('add', $data); } }
if (!empty($month)) { $model = $month; $items = ''; $pre = 'month'; ?> <dt><span class="label important">每月运程</span> <?php #if(empty($month)) echo '暂无'; else $this->widget('WStarRating',array('object_type'=>'astro_month','object_id'=>$month->primaryKey)); ?> </dt> <dd> <div id="month-tabs"> <?php $arr = array('sum_content' => '总体', 'money_content' => '财运', 'love_content' => '恋爱', 'relax_way' => '放松方式', 'luck_way' => '幸运星'); foreach ($arr as $attr => $title) { $star_attr = str_replace('_content', '', $attr); $content = YiicmsHelper::CMarkdown($model->{$attr}); $item = array('title' => $title, 'id' => $pre . '_' . $attr, 'content' => $content); $items[$title] = $item; } $this->widget('BootTabs', array('type' => 'tabs', 'tabs' => $items)); ?> </div> </dd> <?php } ?> </dl> </div> <div class="sidebar"> <?php
<?php } } ?> </div> <div> <span>发起时间:<?php echo YiicmsHelper::friendlyDate('Y-m-d H:i:s', $vote['ctime']); ?> </span><br/> <span>已投票数:<?php echo $vote->votercount; ?> </span><br/> <span>截止时间:<?php echo YiicmsHelper::friendlyDate('Y-m-d H:i:s', $vote['expiration']); ?> </span> </div> </div> <div style="width:70%; margin:0 auto;"> <h1 class="alC lh35 f14px"><span class="f14px fB cBlue"><?php echo $vote->subject; ?> </span><span class="cGray2" >(可选<span id="most_vote_num"><?php echo intval($vote['maxchoice']) + 1; ?> </span>个)</span></h1> <p class="cGray2"><?php echo $vote['message']; ?>
<?php echo CHtml::image($this->image_dir . $gift['gift']->img, $gift['gift']->name, array('desc' => $gift['gift']->desc)); ?> </div> <div class="left" style="width:480px;"> <div class="lh20"> <?php if ($gift['access'] == 3) { echo CHtml::encode('神秘人士'); } else { echo CHtml::link($gift['fromUsername'], array('/space/', 'uid' => $gift['fromUserId'])); } ?> 在<?php echo YiicmsHelper::friendlyDate('Y-m-d', $gift['ctime']); ?> 赠送给 <?php echo CHtml::link($gift['toUsername'], array('/space/', 'uid' => $gift['toUserId'])); ?> <?php if ($this->mid == $gift['toUserId']) { ?> <br/> <?php echo CHtml::link('回赠礼物', array('gift/index', 'uid' => $gift['fromUserId'])); ?> <?php }
public function actionDoDelNotify() { $msg_id = Yii::app()->request->getQuery('notify_id'); $model = new Notify(); $notify = $model->loadMsg($msg_id); $return = $msg->delNotify(); YiicmsHelper::goBack(); #echo $return; }
<div style="width: 15%;" class="left alR"> </div> <div style="width: 85%;" class="left"></div> </li> </ul> <?php } ?> <?php if (!empty($thisLoginInfo)) { ?> <h2 class="lh35 f14px btmline"><strong>本次的登录:</strong></h2> <ul> <li> <div style="width: 15%;" class="left alR">登录时间:</div> <div style="width: 85%;" class="left cGray2"><?php echo YiicmsHelper::friendlyDate('Y年m月d日 H:i:s', $thisLoginInfo['login_time']); ?> <br/> </div> <div class="left cGray2"></div> </li> <li> <div style="width: 15%;" class="left alR">IP 地址:</div> <div style="width: 85%;" class="left"><?php echo $thisLoginInfo['login_ip']; ?> </div> </li> <li> <div style="width: 15%;" class="left alR">上网地点:</div> <div id="thisLoginAddress" style="width: 85%;" class="left">本机地址 </div>