/** * Change comment visibility status */ public function actiontogglestatus() { if (!Yii::app()->user->checkAccess('op_users_manage_comments')) { $this->redirect(Yii::app()->request->getUrlReferrer()); } if (isset($_GET['id']) && ($model = UserComments::model()->findByPk($_GET['id']))) { $model->visible = $model->visible == 1 ? 0 : 1; $model->save(); Yii::app()->user->setFlash('success', Yii::t('global', 'Comment Updated.')); $this->redirect(Yii::app()->request->getUrlReferrer()); } else { $this->redirect(Yii::app()->request->getUrlReferrer()); } }
?> </td> <td><?php echo Yii::app()->format->number(UserComments::model()->count()); ?> </td> </tr> <tr> <td><?php echo Yii::t('adminindex', 'Latest Comments'); ?> </td> <td> <ul> <?php $lastusercomments = UserComments::model()->with(array('user'))->findAll(array('order' => 'postdate DESC', 'limit' => 5)); ?> <?php foreach ($lastusercomments as $lastcomment) { ?> <li><?php echo $lastcomment->user->getModelLink(); ?> </li> <?php } ?> </ul> </td> </tr> </table>