Skip to content

Commit

Permalink
Add source of video, fixes #141
Browse files Browse the repository at this point in the history
  • Loading branch information
danwdart committed Jul 27, 2016
1 parent 320535c commit 21a5f28
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
3 changes: 0 additions & 3 deletions application/modules/default/views/scripts/search/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
<?php endforeach;?>
</div>
<div class="clearfix"></div>
<br/>

<?php if ($this->ytUser) : ?>
<h2>Found YouTube user <?php echo $this->ytUser->getSnippet()->title; ?></h2>
<div class="content-centre">
Expand Down Expand Up @@ -69,7 +67,6 @@
</div>
<div class="clearfix"></div>
<?php endif; ?>
<br/>
<h2>YouTube results for: <?php echo $this->strSearchTerm; ?></h2>
<div class="content-centre" id="youtubevids">
<?php foreach($this->videoFeed->items as $ytVideo): ?>
Expand Down
8 changes: 7 additions & 1 deletion application/modules/default/views/scripts/video/watch.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ $vhost = Chaplin_Config_Chaplin::getInstance()->getFullVhost();
<br/>
<br/>Uploaded by: <a href="/user/<?php echo $this->video->getUsername(); ?>"><?php echo $this->video->getUsername(); ?></a>
<br/>Uploaded on <?php echo date('d/m/Y H:i', $this->video->getTimeCreated());?> (<?php echo $this->video->getTimeAgo(); ?>)
<br/>Licence: <a href="<?php echo $this->video->getLicence()->getURL(); ?>"><?php echo $this->video->getLicence()->getText(); ?></a>
<?php if ($this->video->getSource()): ?>
<br/>Original source: <a href="https://youtube.com/watch?v=<?php echo $this->video->getSource(); ?>" target="_blank">Source Video</a>
<?php endif; ?>
<?php if ($this->video->getUploader()): ?>
<br/>Original author: <?php echo $this->video->getUploader(); ?>
<?php endif; ?>
<br/>Licence: <a href="<?php echo $this->video->getLicence()->getURL(); ?>"><?php echo $this->video->getLicence()->getText(); ?></a>
<br/><?php echo $this->video->getDescription(); ?>
<p>Short URL: <input type="text" disabled value="<?php echo $this->short; ?>"/></p>
<p><strong>&uparrow; <?php echo $this->video->getVotesUp(); ?> / <?php echo $this->video->getVotesDown(); ?> &downarrow;</strong></p>
Expand Down
10 changes: 10 additions & 0 deletions library/Chaplin/Model/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ public function setDescription($strDescription)
return $this->_setField(self::FIELD_DESCRIPTION, $strDescription);
}

public function getSource()
{
return $this->_getField(self::FIELD_SOURCE, null);
}

public function getUploader()
{
return $this->_getField(self::FIELD_UPLOADER, null);
}

public function getComments()
{
return $this->_getField(self::CHILD_ASSOC_COMMENTS, array());
Expand Down

0 comments on commit 21a5f28

Please sign in to comment.