Changeset 73
- Timestamp:
- 06/22/07 14:26:01 (1 year ago)
- Files:
-
- branch/controllers/videos_controller.php (modified) (1 diff)
- branch/models/video.php (modified) (1 diff)
- branch/views/videos/video.ctp (modified) (1 diff)
- branch/views/videos/viewplaylist.ctp (moved) (moved from branch/views/videos/viewuser.ctp) (1 diff)
- branch/webroot/css/default.css (modified) (1 diff)
- branch/webroot/js/webrocket.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/controllers/videos_controller.php
r72 r73 9 9 } 10 10 11 function view user($id = null) {11 function viewplaylist($id = null) { 12 12 13 13 vendor('phpYoutube/phpYoutube'); 14 14 $phpYoutube = new phpYoutube($this->dev_id); 15 15 16 //pr($phpYoutube->videos_listbyuser($id)); 17 $this->set('videos', $phpYoutube->videos_listbyuser($id)); 16 $results = $this->Video->read(null,$id); 17 $this->set('results', $results); 18 //pr($results); 19 $this->set('videos', $phpYoutube->videos_listbyplaylist($results['Video']['playlist_id'])); 18 20 } 19 21 branch/models/video.php
r69 r73 6 6 var $actsAs = array('CounterCache','Tag'); 7 7 8 var $validate = array( 9 'title' => VALID_NOT_EMPTY, 10 'url' => VALID_NOT_EMPTY, 11 'video_location' => VALID_NOT_EMPTY, 12 'video_date' => VALID_NOT_EMPTY, 13 'body' => VALID_NOT_EMPTY, 14 'copyright_owner' => VALID_NOT_EMPTY, 15 'copyright_id' => VALID_NOT_EMPTY, 16 'published' => VALID_NOT_EMPTY, 17 'user_id' => VALID_NOT_EMPTY, 18 'subject_id' => VALID_NOT_EMPTY, 19 'tags' => VALID_NOT_EMPTY, 20 ); 8 var $validate = array(); 21 9 22 10 //The Associations below have been created with all possible keys, those that are not needed can be removed 23 11 var $belongsTo = array( 24 'Copyright' => array('className' => 'Copyright',25 'foreignKey' => 'copyright_id',26 'conditions' => '',27 'fields' => '',28 'order' => '',29 'counterCache' => ''),30 12 'User' => array('className' => 'User', 31 13 'foreignKey' => 'user_id', branch/views/videos/video.ctp
r72 r73 1 <object width="425" height="350"> 2 <param name="movie" value="http://www.youtube.com/v/<?php e($video_id);?>"></param> 3 <param name="wmode" value="transparent"></param> 4 <embed src="http://www.youtube.com/v/<?php e($video_id);?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> 5 </object> 1 <div class="video-view"> 2 <p align="center"> 3 <object width="425" height="350"> 4 <param name="movie" value="http://www.youtube.com/v/<?php e($video_id);?>"></param> 5 <param name="wmode" value="transparent"></param> 6 <embed src="http://www.youtube.com/v/<?php e($video_id);?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> 7 </object> 8 </p> 9 <p> 10 <h2>Video Details</h2> 11 <dl class="video-details"> 12 <dd>Video Title:</dd> 13 <dt><?php e($video['title']);?></dt> 14 <dd>Description:</dd> 15 <dt><?php e($video['description']);?></dt> 16 <dd>Length:</dd> 17 <dt><?php if ($video['length_seconds'] > 0) { 18 $mins = floor ($video['length_seconds'] / 60); 19 $secs = $video['length_seconds'] % 60; 20 printf ("%d:%2.0f", $mins, $secs); 21 } 22 ?></dt> 23 <dd>Rating:</dd> 24 <dt><?php e($video['rating_avg']);?></dt> 25 <dd>Views:</dd> 26 <dt><?php e($video['view_count']);?></dt> 27 </dl> 28 29 </p> 30 </div> branch/views/videos/viewplaylist.ctp
r72 r73 1 1 <div class="video"> 2 <h2>View Video</h2>3 Found <?php e($videos['total']);?> videos2 <h2>View Video</h2> 3 Found <?php e($videos['total']);?> videos 4 4 5 <dl class="video-gallery"> 6 <?php foreach($videos['video'] as $video) : ?> 7 <dt><a href="/videos/video/<?php e($video['id']);?>" class="thickbox" title="<?php e($video['description']);?>"><?php e($video['title']);?></a></dt> 8 <dd><a href="/videos/video/<?php e($video['id']);?>" class="thickbox" title="<?php e($video['description']);?>"><img src="<?php e($video['thumbnail_url']);?>" /></a></dd> 9 10 <dd>Views: <?php e($video['view_count']);?></dd> 11 12 <dd>Comments: <?php e($video['comment_count']);?></dd> 5 <div class="video-gallery"> 6 <p align="center"> 7 <ul> 8 <?php foreach($videos['video'] as $video) : ?> 9 <li> 10 <a href="/videos/video/<?php e($video['id']);?>" class="videolink" title="<?php e($video['description']);?>"> 11 <img src="<?php e($video['thumbnail_url']);?>" /> 12 </a> 13 </li> 14 <?php endforeach; ?> 15 </ul> 16 </p> 17 </div> 18 19 <div class="video-player"> 13 20 14 <dd>Ave Rating: <?php e($video['rating_avg']);?></dd> 15 16 <dd>Length: <?php if ($video['length_seconds'] > 0) { 17 $mins = floor ($video['length_seconds'] / 60); 18 $secs = $video['length_seconds'] % 60; 19 printf ("%d:%2.0f", $mins, $secs); 20 } 21 ?></dd> 22 <br style="clear:left;" /> 23 <?php endforeach; ?> 24 </dl> 25 21 </div> 26 22 </div> branch/webroot/css/default.css
r72 r73 235 235 236 236 div.video { 237 margin: auto 0; 238 width:60%; 239 text-align:center; 240 } 241 242 dl.video-gallery { 243 244 } 245 246 dl.video-gallery dt { 247 /*clear:left;*/ 248 text-align:left; 249 } 250 251 dl.video-gallery dd { 237 width:620px; 238 margin:0 auto; 239 } 240 241 div.video h2 { 242 background: url('../img/h2_top.png') repeat-x; 243 } 244 245 div.video-gallery { 246 width:160px; 247 height:600px; 248 overflow:auto; 249 float:right; 250 padding: auto auto; 251 } 252 253 div.video-gallery ul { 254 list-style:none; 255 } 256 257 div.video-gallery ul li { 252 258 float:left; 253 259 margin-right:30px; 254 260 } 261 262 div.video-player { 263 background:#000; 264 border:3px solid #fff; 265 width:450px; 266 height:600px; 267 overflow:auto; 268 } branch/webroot/js/webrocket.js
r72 r73 51 51 $j('ul.jd_menu').jdMenu(); 52 52 53 $j('a.videolink').bind('click', function(){ 54 $j('div.video-player').load(this.href); 55 return false; 56 }); 57 53 58 /*var options = { 54 59 target: '#content', // target element(s) to be updated with server response