Example #1
0
 public function run()
 {
     parent::run();
     $data['cnn'] = Content::model()->findAll(array("condition" => "category_id = 31 and state = 1", "order" => "id desc", "limit" => 6));
     $data['count'] = Content::model()->count(array("condition" => "category_id = 31 and state = 1", "order" => "id desc"));
     $this->render('study_by_cnn', $data);
 }
Example #2
0
 public function run()
 {
     parent::run();
     $data['new_music'] = Content::model()->findAll(array("condition" => "category_id = 33 and state = 1", "limit" => 20, "order" => "id desc"));
     $data['hot_music'] = Content::model()->findAll(array("condition" => "category_id = 33 and state = 1", "limit" => 20, "order" => "view desc"));
     $this->render('study_by_music', $data);
 }
 public function run()
 {
     parent::run();
     $data = array();
     $id_listen_cat = Category::model()->findAll("taxonomy_id = " . $this->_id_bai_hoc . " and state = 1");
     $id_listen_cat_array = array();
     foreach ($id_listen_cat as $k) {
         $id_listen_cat_array[] = $k->id;
     }
     $id_news_cat = Category::model()->findAll("taxonomy_id = " . $this->_id__tintuc . " and state = 1");
     $id_news_cat_array = array();
     foreach ($id_news_cat as $k) {
         $id_news_cat_array[] = $k->id;
     }
     $comment = Comment::model()->findAll(array("condition" => "state = 1", "limit" => 5, "order" => "id desc"));
     $options = array();
     $i = 0;
     foreach ($comment as $k) {
         $options[$i]['content'] = Content::model()->findByPk($k->content_id);
         $options[$i]['category'] = Category::model()->findByPk($options[$i]['content']->category_id);
         $options[$i]['parent'] = '';
         if ($options[$i]['category']->parent != 0) {
             $options[$i]['parent'] = Category::model()->findByPk($options[$i]['category']->parent);
         }
         $options[$i]['taxonomy'] = Taxonomy::model()->findByPk($options[$i]['category']->taxonomy_id);
         $i++;
     }
     $data['comments'] = $comment;
     $data['options'] = $options;
     $data['news'] = Content::model()->findAll(array("condition" => "state = 1 and category_id in (" . implode(",", $id_news_cat_array) . ")", "limit" => 10, "order" => "id desc"));
     $data['listen'] = Content::model()->findAll(array("condition" => "state = 1 and category_id in (" . implode(",", $id_listen_cat_array) . ")", "limit" => 10, "order" => "id desc"));
     $this->render('news_lession_comment', $data);
 }
Example #4
0
 public function run()
 {
     parent::run();
     $data['user']['total'] = Member::model()->count();
     $data['user']['new'] = Member::model()->find(array("order" => "id desc"));
     $this->render('statistics', $data);
 }
Example #5
0
 public function run()
 {
     parent::run();
     $cs = Yii::app()->getClientScript();
     $cs->registerScript('Audio', '$(".vlum").click(function(e){playAudio($(this),$(this).attr("alt"));})', CClientScript::POS_END);
     $data['danhngon'] = Danhngon::model()->findAll(array("condition" => "state = 1", "order" => "created_date desc", "limit" => 10));
     $this->render('danhngon', $data);
 }
Example #6
0
 public function run()
 {
     parent::run();
     $data['mem_nhiettinh'] = Member::model()->findAll(array("limit" => 6, "order" => "point desc"));
     $data['mem_chuyencan'] = Member::model()->findAll(array("limit" => 6, "order" => "diligent_point desc"));
     $data['mem_thanhtich'] = Member::model()->findAll(array("limit" => 6, "order" => "mark desc"));
     $this->render('top_member', $data);
 }
Example #7
0
 public function run()
 {
     parent::run();
     $data['trailer'] = Content::model()->findAll(array("condition" => "category_id = 30 and state = 1", "order" => "id desc", "limit" => 5));
     $data['count_tl'] = Content::model()->count(array("condition" => "category_id = 30 and state = 1", "order" => "id desc"));
     $data['voa'] = Content::model()->findAll(array("condition" => "category_id = 27 and state = 1", "order" => "id desc", "limit" => 5));
     $data['count_voa'] = Content::model()->count(array("condition" => "category_id = 27 and state = 1", "order" => "id desc"));
     $this->render('study_by_film', $data);
 }
Example #8
0
 public function run()
 {
     parent::run();
     $criteria = new CDbCriteria();
     $criteria->order = 't.id ASC';
     $criteria->condition = 'state = 1';
     $menus = Taxonomy::model()->findAll($criteria);
     $this->render('menu', array('menus' => $menus, 'total' => count($menus)));
 }
Example #9
0
 public function run()
 {
     parent::run();
     $user = array();
     if ($this->_session['isLogin'] == 1 & $this->_session['login_id'] > 0) {
         $user = Member::model()->findByPk($this->_session['login_id']);
     }
     //$this->_session['login_id']
     $user_login = new UserLoginForm();
     $this->render('login', array('iUser' => $user_login, 'user' => $user));
 }
Example #10
0
 public function run()
 {
     parent::run();
     $data['count_gt'] = Content::model()->count(array("condition" => "category_id = 28 and state = 1", "order" => "id desc"));
     $data['giaotiep'] = Content::model()->findAll(array("condition" => "category_id = 28 and state = 1", "order" => "id desc", "limit" => 6));
     $data['count_nt'] = Content::model()->count(array("condition" => "category_id = 29 and state = 1", "order" => "id desc"));
     $data['noitieng'] = Content::model()->findAll(array("condition" => "category_id = 29 and state = 1", "order" => "id desc", "limit" => 6));
     $data['count_ytb'] = Content::model()->count(array("condition" => "category_id = 25 and state = 1", "order" => "id desc"));
     $data['youtube'] = Content::model()->findAll(array("condition" => "category_id = 25 and state = 1", "order" => "id desc", "limit" => 6));
     $this->render('study_by_clip', $data);
 }
Example #11
0
 public function run()
 {
     parent::run();
     if (isset($_POST['submit_reply'])) {
         $id = $_POST['hid'];
         $model = new Mquestion();
         $model->content = Yii::app()->request->getPost('content_reply', true);
         $model->parent = $_POST['hid'];
         $model->user_id = $this->_session['login_id'];
         $model->state = 0;
         if (Libraries::get_vip($model->user_id) != 0) {
             $model->state = 1;
         }
         $model->date_create = new CDbExpression('NOW()');
         $model->save();
     }
     $data['question'] = Mquestion::model()->findAll(array("condition" => "state = 1 and parent = 0 ", "order" => "date_create desc", "limit" => 1));
     $data['u_log'] = $this->_session['login_id'];
     $this->render('member_question', $data);
 }
Example #12
0
 public function run()
 {
     parent::run();
     $data = Content::model()->findAll(array('condition' => 'state = 1 and category_id = ' . $this->cat_id, 'limit' => 4, 'order' => 'created_date desc'));
     $root = Category::model()->findByPk($this->cat_id);
     if ($this->type == 'news') {
         $this->render('sub/news', array('data' => $data, 'root' => $root));
     }
     if ($this->type == 'collect') {
         $category = Category::model()->findAll("parent = " . $this->cat_id);
         $this->render('sub/collect', array('data' => $data, 'root' => $root, "category" => $category));
     }
     if ($this->type == 'listen') {
         $this->render('sub/listen', array('data' => $data, 'root' => $root));
     }
     if ($this->type == 'play') {
         $cate = Category::model()->findAll(array("condition" => "state = 1 and parent = " . $this->cat_id, 'limit' => 4, 'order' => '"order" desc'));
         $this->render('sub/learn', array('data' => $data, 'root' => $root, 'cate' => $cate));
     }
 }
Example #13
0
 public function run()
 {
     parent::run();
     $data = array();
     $this->r_slug = Taxonomy::model()->findByPk($this->tax_id)->slug;
     $current = Content::model()->findByPk($this->p_id);
     $data['cat'] = Category::model()->findByPk($this->c_id);
     $id = Category::model()->findAll(array('condition' => 'taxonomy_id =  ' . $data['cat']->taxonomy_id));
     $arr_id = array();
     foreach ($id as $k) {
         $arr_id[] = $k->id;
         $data['category_'][$k->id] = $k->slug;
     }
     $this->own = Content::model()->find(array('condition' => 'id < :pid and category_id = :cid ', 'params' => array(':pid' => $this->p_id, ':cid' => $this->c_id)));
     $this->new = Content::model()->find(array('condition' => 'id > :pid and category_id = :cid ', 'params' => array(':pid' => $this->p_id, ':cid' => $this->c_id)));
     $data['same_thread'] = Content::model()->findAll(array('condition' => 'id != :pid and category_id in ( :cid ) and state = 1', 'params' => array(':pid' => $this->p_id, ':cid' => implode(",", $arr_id)), 'order' => 'rand()', 'limit' => 3));
     if (count($this->own) == 0) {
         $this->own = $current;
     }
     if (count($this->new) == 0) {
         $this->new = $current;
     }
     $this->render('more_listen', $data);
 }
Example #14
0
 public function run()
 {
     parent::run();
     $data = Category::model()->findAll("taxonomy_id = 10");
     $this->render('tienganhphothong', array("data" => $data));
 }
Example #15
0
 public function run()
 {
     parent::run();
     $mail = new FrmNewslettters();
     $this->render('newsletter_exam');
 }
Example #16
0
 public function run()
 {
     parent::run();
     $this->render('test');
 }
Example #17
0
 public function run()
 {
     parent::run();
     $act = '';
     if ($_POST) {
         $act = @$_POST['act'];
     }
     $data = Yii::app()->getBasePath() . '/../data/emoticon/';
     $images = glob($data . '*.gif');
     $items = array();
     if (count($images) > 0) {
         foreach ($images as $image) {
             $image = explode('/', $image);
             $img[] = $image[count($image) - 1];
             $img2[] = str_replace(".gif", "", $image[count($image) - 1]);
         }
         $items = $img;
     }
     $stt = 1;
     if ($this->u_id) {
         $stt = count(Comment::model()->findAll(array('condition' => 'content_id = ' . $this->c_id . ' and mem_id = ' . $this->u_id)));
     }
     if ($stt == 0) {
         if ($act == 'submit') {
             $model = new Comment();
             $model->attributes = $_POST['Comment'];
             $comment = htmlspecialchars($model->comment);
             if ($comment != '' & strlen($comment) > 10) {
                 foreach ($img2 as $k => $v) {
                     $comment = str_replace("(:" . $v . ":)", "<img src='" . Yii::app()->getBaseUrl(true) . "/data/emoticon/" . $v . ".gif'>", $comment);
                 }
                 $model->comment = $comment;
                 $returnValue = preg_replace('(:emo33:)', '<img src="emo33.gif">', '', -1, $count);
                 $model->content_id = $this->c_id;
                 $model->mem_id = $this->u_id;
                 $model->mem_username = $this->_session['login_name'];
                 $model->created_date = new CDbExpression('NOW()');
                 $model->state = 1;
                 if ($model->save()) {
                     $mem = Member::model()->findByPk($this->u_id);
                     Member::model()->updateByPk($this->u_id, array('point' => $mem->point + 1));
                 }
                 $stt = 1;
             } else {
                 $class = 'red bold';
             }
         }
     }
     $condition = "content_id = " . $this->c_id;
     if ($act == 'view') {
         $name = $_POST['filter_name'];
         $type = $_POST['filter_type'];
         $order = array();
         if ($name != '') {
             $condition .= " and mem_username like '%" . $name . "%'";
         }
         if ($type == 1) {
             $order[] = "order by mem_id";
         }
         if ($type == 1) {
             $order[] = "order by mem_id desc";
         }
     }
     $comments_item = Comment::model()->findAll($condition);
     $this->render('comments', array('items' => $items, 'stt' => $stt, 'login' => $this->u_id, 'comments_item' => $comments_item, 'class' => @$class));
 }
Example #18
0
 public function run()
 {
     parent::run();
     $this->render('search');
 }
Example #19
0
 public function run()
 {
     parent::run();
     $lich_hoc = Content::model()->findAll("category_id = 47 and state = 1");
     $this->render('lichhoc', array('lich_hoc' => $lich_hoc));
 }
Example #20
0
 public function run()
 {
     parent::run();
     $this->render('luyentaptienganh');
 }
Example #21
0
 public function run()
 {
     parent::run();
     $this->render('support2');
 }
Example #22
0
 public function run()
 {
     parent::run();
     $this->render('header');
 }
Example #23
0
 public function run()
 {
     parent::run();
     $data['data'] = Supports::model()->findAll(array("condition" => "state = 1", "order" => "'order' desc"));
     $this->render('support', $data);
 }
Example #24
0
 public function run()
 {
     parent::run();
     $mail = new FrmNewslettters();
     $this->render('mailnewsletters', array('mail' => $mail));
 }
Example #25
0
 public function run()
 {
     parent::run();
 }
Example #26
0
 public function run()
 {
     parent::run();
     $this->render('box_game');
 }
 public function run()
 {
     parent::run();
     $this->render('tienganhgiaotiepcoban');
 }
Example #28
0
 public function run()
 {
     parent::run();
     $this->render('buy_card');
 }
Example #29
0
 public function run()
 {
     parent::run();
     $this->render('tienhanhtreem');
 }