Example #1
0
 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     //find the user
     $this->layout = '//layouts/user';
     $user = User::model()->findByPk($id);
     if ($user == null) {
         throw new CHttpException(404, 'The specified user cannot be found.');
     }
     $this->user = $user;
     //find the illust
     $model = new Illust('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Illust'])) {
         $model->attributes = $_GET['Illust'];
     }
     $this->render('view', array('model' => $model, 'user' => $user));
 }
Example #2
0
 public function actionBookmark()
 {
     $user = User::model()->findByPk(Yii::app()->user->id);
     if ($user == null) {
         throw new CHttpException(404, 'The specified user cannot be found.');
     }
     $model = new Illust('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Illust'])) {
         $model->attributes = $_GET['Illust'];
     }
     $this->render('bookmark', array('model' => $model, 'user' => $user));
 }
Example #3
0
 public static function getR18MostPopular($numberOfItem)
 {
     $mostPopularIllustList = Illust::model()->findAllBySql('Select * from illust where is_r18 = 1 order by non_user_popularity DESC,popularity DESC,created_datetime DESC limit ' . $numberOfItem);
     return $mostPopularIllustList;
 }
Example #4
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Illust the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Illust::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #5
0
 public function run()
 {
     $mostPopularNonR18Illust = Illust::getNonR18MostPopular(5);
     $mostPopularR18Illust = Illust::getR18MostPopular(5);
     $this->render('application.components.view._PopularIllustWidget', array('mostPopularNonR18Illust' => $mostPopularNonR18Illust));
 }