public function getvideosAction()
 {
     if ($this->auth->hasIdentity()) {
         $getvideos = new Application_Model_Videos($this->registry['DB']);
         $videoid = $this->getRequest()->getParam('videoid');
         $this->view->results = $getvideos->getVideos($videoid);
         $this->view->videoid = $videoid;
         $this->view->mydetails = $this->authIdentity;
         if ($this->_request->isXmlHttpRequest() && $this->getRequest()->getParam('format') == 'xml') {
             $this->_helper->viewRenderer->renderScript('videos/getvideos.ajax.phtml');
         }
     }
 }
Esempio n. 2
0
 public function myStreams($ruserid)
 {
     if (isset($this->authIdentity)) {
         $sql = $this->_db->select()->from('activity', array('activityid', 'userid', 'ruserid', 'contentid', 'title', 'contenttype', 'contenturl', 'alternate_contentid', 'date'))->joinLeft('freniz', 'freniz.userid=activity.ruserid', array('ruserid' => 'userid', 'rusername' => 'username', 'ruserurl' => 'url'))->joinLeft('image', 'image.imageid=freniz.propic', 'image.url as ruserimageurl')->where('ruserid=?', $ruserid)->where('(contenttype=\'post\' and activity.title=\'posted on\') or (contenttype=\'video\' and activity.title=\'post a video on\') or (contenttype=\'image\' and activity.title=\'post image\' and activity.userid!=?) or (contenttype in (\'propic\',\'basicinfo\',\'personalinfo\',\'mood\',\'city\'))', $ruserid);
         $results = $this->_db->fetchAssoc($sql);
         $myStreamsMapper = array();
         foreach ($results as $id => $values) {
             switch ($values['contenttype']) {
                 case 'post':
                     $myStreamsMapper['posts'][$id] = $values['contentid'];
                     break;
                 case 'image':
                     $myStreamsMapper['images'][$id] = $values['contentid'];
                     break;
                 case 'video':
                     $myStreamsMapper['videos'][$id] = $values['contentid'];
                     break;
             }
         }
         if (!empty($myStreamsMapper['posts'])) {
             $posts = new Application_Model_Post($this->_db);
             $myStream_results['post'] = $posts->getPosts($myStreamsMapper['posts']);
         }
         if (!empty($myStreamsMapper['images'])) {
             $images = new Application_Model_Images($this->_db);
             $myStream_results['image'] = $images->getArrayOfImages($myStreamsMapper['images']);
         }
         if (!empty($myStreamsMapper['videos'])) {
             $videos = new Application_Model_Videos($this->_db);
             $myStream_results['video'] = $videos->getVideos($myStreamsMapper['videos']);
         }
         $final_results['mystream'] = $results;
         $final_results['results'] = $myStream_results;
         $sql = $this->_db->select()->from('commentactivity', 'max(id) as maxcomment');
         $result = $this->_db->fetchRow($sql);
         $final_results['maxcomment'] = $result['maxcomment'];
         return $final_results;
     }
 }
 public function viewAction()
 {
     $videos = new Application_Model_Videos();
     $videoList = $videos->getVideos();
     $videoInfo = array();
     $videoCat = "";
     foreach ($videoList as $fK => $fV) {
         if ($videoCat != $fV["category"]) {
             $videoInfo[$fV["category"]][] = $fV;
         }
     }
     //echo "<pre>";print_r($faqInfo);
     $this->view->videos = $videoInfo;
     $faqs = new Application_Model_Faqs();
     $ddl_category_list = $faqs->fetchCategoryNameList(2);
     $this->view->ddl_category_list = $ddl_category_list;
 }