From c2652b82b46cc066774cc49b2c004b0a60b853d7 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 23 Jun 2014 20:02:56 +0000 Subject: [PATCH] adding video application adding styles for videos page updating output for 4 featured videos on home page --- Toolkit/Page.php | 4 +- Toolkit/Videos/WebDecorator.php | 37 ++++---- Toolkit/Videos/templates/webDecorator.html | 13 +-- .../Videos/templates/webPageDecorator.html | 28 +++--- static/433.phtml | 6 ++ styles.css | 91 +++++++++++++++++++ templates/template.html | 31 +------ 7 files changed, 139 insertions(+), 71 deletions(-) create mode 100644 static/433.phtml diff --git a/Toolkit/Page.php b/Toolkit/Page.php index 6e9fd7b..4a0cd63 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -171,9 +171,7 @@ class Toolkit_Page FROM videos WHERE featured = true AND active = true - ORDER BY pos - LIMIT 1 - OFFSET 0"; + ORDER BY pos"; $row = $dbh->query($sql)->fetch(PDO::FETCH_ASSOC); if ($row) { $video = new Toolkit_Videos_WebDecorator(); diff --git a/Toolkit/Videos/WebDecorator.php b/Toolkit/Videos/WebDecorator.php index 50c2092..eaa572e 100644 --- a/Toolkit/Videos/WebDecorator.php +++ b/Toolkit/Videos/WebDecorator.php @@ -31,7 +31,7 @@ class Toolkit_Videos_WebDecorator private $_flexyOptions = array(); private $_template = 'webDecorator.html'; - + /** * Class Constructor * @@ -73,27 +73,28 @@ class Toolkit_Videos_WebDecorator SELECT id FROM videos WHERE featured = true - ORDER BY pos - LIMIT 1 - OFFSET 0"; - $row = $dbh->query($sql)->fetch(PDO::FETCH_ASSOC); - if ($row) { - $tpl = new HTML_Template_Flexy($this->_flexyOptions); - $page = new stdClass; - $page->videoUrl = Toolkit_Template_Page::getSeoUrl($gateway, 189); - $videoMapper - = new Toolkit_Videos_VideoMapper($dbh); - $video = $videoMapper->getVideoById($row['id'], false); - if ($video) { - $page->vCode = $video->getVideoCode(); - $page->title = $video->getVideoTitle(); - } + ORDER BY pos"; + $data = $dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC); + if ($data) { + foreach ($data as $row) { + $tpl = new HTML_Template_Flexy($this->_flexyOptions); + $page = new stdClass; + $page->videoUrl = Toolkit_Template_Page::getSeoUrl($gateway, 189); + $videoMapper + = new Toolkit_Videos_VideoMapper($dbh); + $video = $videoMapper->getVideoById($row['id'], false); + if ($video) { + $page->vCode = $video->getVideoCode(); + $page->title = $video->getVideoTitle(); + } - $tpl->compile($this->_template); - return $tpl->bufferedOutputObject($page); + $tpl->compile($this->_template); + $videos .= $tpl->bufferedOutputObject($page); + } } else { return false; } + return $videos; } catch(PDOException $e) { Toolkit_Common::handle_error($e); } diff --git a/Toolkit/Videos/templates/webDecorator.html b/Toolkit/Videos/templates/webDecorator.html index d7114d0..8746ffb 100644 --- a/Toolkit/Videos/templates/webDecorator.html +++ b/Toolkit/Videos/templates/webDecorator.html @@ -1,11 +1,6 @@
-

Check out our Video Spotlight

-

{title:h}

- - - - -

- See All Our Videos -

+ + + +
diff --git a/Toolkit/Videos/templates/webPageDecorator.html b/Toolkit/Videos/templates/webPageDecorator.html index 71622ca..09d4000 100644 --- a/Toolkit/Videos/templates/webPageDecorator.html +++ b/Toolkit/Videos/templates/webPageDecorator.html @@ -1,14 +1,14 @@ -
- {foreach:videos,v} - {if:v[firstInRow]}
{end:} -
- - - -
- {v[title]:h} -
-
- {if:v[lastInRow]}
{end:} - {end:} -
+
+

Videos

+ +
\ No newline at end of file diff --git a/static/433.phtml b/static/433.phtml new file mode 100644 index 0000000..76f114c --- /dev/null +++ b/static/433.phtml @@ -0,0 +1,6 @@ +toHtml( + Toolkit_Database::getInstance(), + null +); \ No newline at end of file diff --git a/styles.css b/styles.css index 195ef66..957abc6 100755 --- a/styles.css +++ b/styles.css @@ -868,3 +868,94 @@ p.captionDescWrapper { #copyright a { color: #FFF; } +/* Video Gallery */ +#video_wrapper { + display: block; + width: 100%; + overflow: hidden; + clear: both; +} +#video_wrapper h2 { + display: block; + width: 100%; + overflow: hidden; + clear: both; + margin: 0 0 16px 5px; + padding: 0; +} +ul#videoGallery { + display: block; + width: 100%; + overflow: hidden; + margin: 0; + padding: 0; + list-style-type: none; +} +ul#videoGallery li { + display: block; + float: left; + width: 22%; + margin: 0 1.5% 24px 1.5%; + padding: 0; + border: 1px solid #DDDFDD; + background: #FDFDFF; + border-radius: 3px; + -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05); + box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.05); +} +ul#videoGallery li:nth-child(4n-3) { + clear: left; + width: 22.75%; + margin: 0 3% 24px 0; +} +ul#videoGallery li:nth-child(4n-2) { + width: 22.75%; + margin: 0 3% 24px 0; +} +ul#videoGallery li:nth-child(4n-1) { + width: 22.75%; + margin: 0 3% 24px 0; +} +ul#videoGallery li:nth-child(4n) { + width: 22.75%; + margin: 0 0 24px 0; +} +ul#videoGallery li a { + position: relative; + z-index: 10; + display: block; + width: 100%; + overflow: hidden; + padding: 10px; +} +ul#videoGallery li a img { + display: block; + width: 100%; +} +ul#videoGallery li a span#vidtitle { + display: block; + position: relative; + width: 100%; + padding: 5px 30px 0 0; + color: #A9ABA9; + font-size: 12px; + min-height: 27px; +} +ul#videoGallery li a:hover span#vidtitle { + color: #3FAC46; +} +ul#videoGallery li a span#vidtitle span#play { + display: block; + position: absolute; + z-index: 11; + width: 25px; + height: 27px; + right: 0; + top: 5px; + background: url(assets/video_overlay.png)0 0 no-repeat; + backgorund-size: contain; +} +ul#videoGallery li:hover a span#vidtitle span#play { + background-position: 0 -27px; +} \ No newline at end of file diff --git a/templates/template.html b/templates/template.html index 6bf172d..b086f06 100755 --- a/templates/template.html +++ b/templates/template.html @@ -27,8 +27,8 @@
- - - - - +

Watch Our Videos

+ {if:video}{video:h}{end:}
-- 2.17.1