示例#1
0
 public function player($id)
 {
     $string = new String();
     $player = $this->getPart($id, 'player');
     $this->videoEmbedHtml = $player['items'][0]['player']['embedHtml'];
     $explode = $string->explode($this->videoEmbedHtml, '<');
     foreach ($explode as $key => $value) {
         $iframe = $string->explode($value, '=');
         foreach ($iframe as $iframeKey => $iframeValue) {
             if ($iframeKey == 1) {
                 $this->videoWidth = $string->between('"', '"', $iframe[$iframeKey]);
             }
             if ($iframeKey == 2) {
                 $this->videoHeight = $string->between('"', '"', $iframe[$iframeKey]);
             }
         }
     }
 }
示例#2
0
 public function getCatergoryPath($articleId)
 {
     //Include String Class
     $string = new Framework\String();
     //Grab table names from Database Class
     $this->tables();
     //Grab the cat id based off the article id
     $results = $this->q("SELECT catid FROM {$this->content} WHERE id = '{$articleId}'");
     $articleCatId = $results[0]['catid'];
     //Grab the path based off the catid that was based off the article id
     $results = $this->q("SELECT path FROM {$this->categories} WHERE id = '{$articleCatId}'");
     $catPath = $results[0]["path"];
     //Explode the path by forward slash
     $results = $string->explode($catPath, '/');
     //Loop through the exploded path
     //Create a current object variable and assign it $result (which is each part of the $results array)
     foreach ($results as $key => $result) {
         $this->{'path_' . $key} = trim($result);
     }
 }
示例#3
0
 public function stateCityLinkByAlias($routerId, $routerView, $alias)
 {
     $string = new Framework\String();
     $this->tables();
     if ($routerView == 'article') {
         $query = $this->q("SELECT catid FROM `{$this->content}` WHERE id = '{$routerId}'");
         $catId = $query[0]['catid'];
         $query = $this->q("SELECT path FROM `{$this->categories}` WHERE id = '{$catId}'");
         $path = $query[0]['path'];
     } else {
         $query = $this->q("SELECT path FROM `{$this->categories}` WHERE id = '{$routerId}'");
         $path = $query[0]['path'];
     }
     $pathExplode = $string->explode($path, '/');
     $state = $pathExplode[0];
     $city = $pathExplode[1];
     $pathMenu = $alias;
     $pathMenu .= '-';
     $pathMenu .= $city;
     $query = $this->q("SELECT id, link FROM `{$this->menu}` WHERE path = '{$pathMenu}'");
     $menuId = $query[0]['id'];
     $menuLink = $query[0]['link'];
     $link = $menuLink;
     $link .= '&Itemid=';
     $link .= $menuId;
     return $link;
 }