Skip to content

Commit 21a5f28

Browse files
committed
Add source of video, fixes #141
1 parent 320535c commit 21a5f28

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

application/modules/default/views/scripts/search/index.phtml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
<?php endforeach;?>
4040
</div>
4141
<div class="clearfix"></div>
42-
<br/>
43-
4442
<?php if ($this->ytUser) : ?>
4543
<h2>Found YouTube user <?php echo $this->ytUser->getSnippet()->title; ?></h2>
4644
<div class="content-centre">
@@ -69,7 +67,6 @@
6967
</div>
7068
<div class="clearfix"></div>
7169
<?php endif; ?>
72-
<br/>
7370
<h2>YouTube results for: <?php echo $this->strSearchTerm; ?></h2>
7471
<div class="content-centre" id="youtubevids">
7572
<?php foreach($this->videoFeed->items as $ytVideo): ?>

application/modules/default/views/scripts/video/watch.phtml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ $vhost = Chaplin_Config_Chaplin::getInstance()->getFullVhost();
6161
<br/>
6262
<br/>Uploaded by: <a href="/user/<?php echo $this->video->getUsername(); ?>"><?php echo $this->video->getUsername(); ?></a>
6363
<br/>Uploaded on <?php echo date('d/m/Y H:i', $this->video->getTimeCreated());?> (<?php echo $this->video->getTimeAgo(); ?>)
64-
<br/>Licence: <a href="<?php echo $this->video->getLicence()->getURL(); ?>"><?php echo $this->video->getLicence()->getText(); ?></a>
64+
<?php if ($this->video->getSource()): ?>
65+
<br/>Original source: <a href="https://youtube.com/watch?v=<?php echo $this->video->getSource(); ?>" target="_blank">Source Video</a>
66+
<?php endif; ?>
67+
<?php if ($this->video->getUploader()): ?>
68+
<br/>Original author: <?php echo $this->video->getUploader(); ?>
69+
<?php endif; ?>
70+
<br/>Licence: <a href="<?php echo $this->video->getLicence()->getURL(); ?>"><?php echo $this->video->getLicence()->getText(); ?></a>
6571
<br/><?php echo $this->video->getDescription(); ?>
6672
<p>Short URL: <input type="text" disabled value="<?php echo $this->short; ?>"/></p>
6773
<p><strong>&uparrow; <?php echo $this->video->getVotesUp(); ?> / <?php echo $this->video->getVotesDown(); ?> &downarrow;</strong></p>

library/Chaplin/Model/Video.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ public function setDescription($strDescription)
172172
return $this->_setField(self::FIELD_DESCRIPTION, $strDescription);
173173
}
174174

175+
public function getSource()
176+
{
177+
return $this->_getField(self::FIELD_SOURCE, null);
178+
}
179+
180+
public function getUploader()
181+
{
182+
return $this->_getField(self::FIELD_UPLOADER, null);
183+
}
184+
175185
public function getComments()
176186
{
177187
return $this->_getField(self::CHILD_ASSOC_COMMENTS, array());

0 commit comments

Comments
 (0)