Assembla home | Assembla project page
 

Changeset 72

Show
Ignore:
Timestamp:
06/21/07 16:56:48 (1 year ago)
Author:
digitalspaghetti
Message:

Started working on YouTube? functionality

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branch/config/core.php

    r70 r72  
    5555 * In development mode, you need to click the flash message to continue. 
    5656 */ 
    57         define('DEBUG', 2); 
     57        define('DEBUG', 0); 
    5858/** 
    5959 * Turn off or enable cache checking application-wide. 
  • branch/controllers/videos_controller.php

    r70 r72  
    22class VideosController extends AppController { 
    33 
    4         var $name = 'Videos'; 
    5         var $helpers = array('Html', 'Form' ); 
    6         var $components = array('PhpYoutube'); 
     4        var $dev_id = "5ya5T7dkAR0"; 
     5         
    76        function index() { 
    87                $this->Video->recursive = 0; 
     
    109        } 
    1110 
    12         function view($id = null) { 
    13                 pr($this->PhpYoutube->getDetails("MIJvpW8ZqKY")); 
    14                 $this->set('video', $this->PhpYoutube->getDetails("MIJvpW8ZqKY")); 
     11        function viewuser($id = null) { 
     12                 
     13                vendor('phpYoutube/phpYoutube'); 
     14                $phpYoutube = new phpYoutube($this->dev_id); 
     15                 
     16                //pr($phpYoutube->videos_listbyuser($id)); 
     17                $this->set('videos', $phpYoutube->videos_listbyuser($id)); 
     18        } 
     19         
     20        function video($id = null) 
     21        { 
     22                vendor('phpYoutube/phpYoutube'); 
     23                $phpYoutube = new phpYoutube($this->dev_id); 
     24 
     25                $this->set('video_id', $id); 
     26                $this->set('video', $phpYoutube->videos_getdetails($id)); 
    1527        } 
    1628 
  • branch/views/elements/js_include.ctp

    r68 r72  
    11<?php e($javascript->link('jquery'));?> 
    2 <?php e($javascript->link('dimensions'));?> 
     2<?php e($javascript->link('jquery.dimensions'));?> 
    33<?php e($javascript->link('jquery.bgiframe.min'));?> 
    44<?php e($javascript->link('jquery.cookie'));?> 
    55<?php e($javascript->link('jquery.form'));?> 
    66<?php e($javascript->link('jquery.autocomplete'));?> 
    7 <?php e($javascript->link('treeview/jquery.treeview.pack'));?> 
     7<?php e($javascript->link('jquery.jdMenu'));?> 
    88<?php e($javascript->link('wymeditor/jquery.wymeditor'));?> 
    99<?php e($javascript->link('wymeditor/plugins/tidy/jquery.wymeditor.tidy'));?> 
    1010<?php e($javascript->link('wymeditor/plugins/hovertools/jquery.wymeditor.hovertools'));?> 
    11 <?php e($javascript->link('thickbox'));?> 
     11<?php e($javascript->link('jquery.thickbox'));?> 
    1212<?php e($javascript->link('webrocket'));?> 
  • branch/views/elements/mainnav.ctp

    r67 r72  
    11<?php $menus = $this->requestAction('/menus/index/1');?> 
    22<div id="mainnav" class="primarynav"> 
    3         <?php e($treeMenu->generate($menus,true,'mytreemenu'));?> 
     3        <?php e($treeMenu->generate($menus,true,'jd_menu jd_menu_slate'));?> 
    44</div> 
  • branch/views/layouts/default.ctp

    r71 r72  
    1212        <?php echo $html->css('thickbox');?> 
    1313        <?php echo $html->css('jquery.autocomplete');?> 
     14        <?php echo $html->css('jdMenu');?> 
     15        <?php echo $html->css('jdMenu.slate');?> 
    1416        <?php echo $html->css('../js/wymeditor/skins/default/screen');?> 
    1517         
     
    1719</head> 
    1820<body class="jamal"> 
    19 <div id="doc3" class="yui-t2"> 
    20    <div id="hd"><h1>YUI: CSS Grid Builder</h1></div> 
    21    <div id="bd"> 
    22         <div id="yui-main"> 
    23         <div class="yui-b"><div class="yui-g" id="content"> 
    24                 <?php   if($session->check('Message.flash')): 
    25                                         $session->flash(); 
    26                                 endif; 
    27                 ?> 
     21        <div id="doc3" class="yui-t7"> 
     22                <div id="hd"> 
     23                         
     24                </div> 
     25                <div class="nav-area"><?php e($this->element('mainnav'));?></div> 
     26                <div id="bd"> 
     27                        <div class="yui-g" id="content"> 
     28                                <?php   if($session->check('Message.flash')): 
     29                                                $session->flash(); 
     30                                        endif; 
     31                                ?> 
    2832 
    29         <?php echo $content_for_layout;?> 
     33                                <?php echo $content_for_layout;?> 
     34                        </div> 
     35                        <div class="yui-g" id="boxes"> 
     36                        <div class="yui-gb first"> 
     37                                <div class="yui-u first"> 
     38                                                <?php e($this->element('tagcloud'));?> 
     39                                </div> 
     40                                <div class="yui-u"> 
     41                                                <?php e($this->element('tagcloud'));?> 
     42                                </div> 
     43                                <div class="yui-u"> 
     44                                                <?php e($this->element('tagcloud'));?> 
     45                                </div> 
     46                            </div> 
     47                        </div> 
     48                </div> 
     49                <div id="ft">Footer is here.</div> 
    3050        </div> 
    31 <div class="yui-g"> 
    32     <div class="yui-gb first"> 
    33         <div class="yui-u first"> 
    34                         <?php e($this->element('tagcloud'));?> 
    35                 </div> 
    36         <div class="yui-u"> 
    37         <!-- YOUR DATA GOES HERE --> 
    38                 </div> 
    39         <div class="yui-u"> 
    40         <!-- YOUR DATA GOES HERE --> 
    41                 </div> 
    42     </div> 
    43 </div> 
    44 </div> 
    45         </div> 
    46         <div class="yui-b"><?php e($this->element('mainnav'));?></div> 
    47          
    48         </div> 
    49    <div id="ft">Footer is here.</div> 
    50 </div> 
    51 <?php echo $cakeDebug?> 
     51        <?php echo $cakeDebug?> 
    5252</body> 
    5353</html> 
  • branch/views/posts/index.ctp

    r57 r72  
    22        <div class="hentry"> 
    33                <h2 class="entry-title"><?php e($html->link($post['Post']['title'], array('controller'=>'posts', 'action'=>'view', $post['Post']['stub']))); ?></h2> 
    4                 <?php echo $html->link('Edit', array('action'=>'edit', $post['Post']['id'])); ?> 
    5                 <abbr class="updated" title=""><?php echo $post['Post']['post_date']; ?></abbr> 
    6                 <span class="vcard author"><?php echo $html->link($post['User']['username'], array('controller'=> 'users', 'action'=>'view', $post['User']['id'])); ?></span> 
     4                <div class="entry-infobar"> 
     5                        Updated on <abbr class="updated" title=""><?php echo $post['Post']['post_date']; ?></abbr> by  
     6                        <span class="vcard author fn"><?php echo $html->link($post['User']['username'], array('controller'=> 'users', 'action'=>'view', $post['User']['id'])); ?></span> 
     7                </div> 
    78                <div class="entry-content"> 
    89                        <?php echo $post['Post']['body']; ?> 
  • branch/views/posts/view.ctp

    r57 r72  
    44                <abbr class="updated" title=""><?php echo $post['Post']['post_date']; ?></abbr> 
    55                <span class="vcard author"><?php echo $html->link($post['User']['username'], array('controller'=> 'users', 'action'=>'view', $post['User']['id'])); ?></span> 
     6                 
    67                <div class="entry-content"> 
    78                        <?php echo $post['Post']['body']; ?> 
  • branch/views/videos/index.ctp

    r55 r72  
    33 
    44<table cellpadding="0" cellspacing="0"> 
     5        <thead> 
    56        <tr> 
    67                <th><?php echo $paginator->sort('id');?></th> 
     
    1819                <th>Actions</th> 
    1920        </tr> 
     21        </thead> 
     22        <tbody> 
     23                <?php $row = 0; ?> 
    2024<?php foreach ($videos as $video): ?> 
    21         <tr
     25        <tr class="<?php ($row % 2 ? e('even') : e('odd'));?>"
    2226                <td><?php echo $video['Video']['id']; ?></td> 
    2327                <td><?php echo $video['Video']['title']; ?></td> 
     
    3842                </td> 
    3943        </tr> 
     44        <?php $row++; ?> 
    4045<?php endforeach; ?> 
     46</tbody> 
    4147</table> 
    4248 
  • branch/views/videos/viewuser.ctp

    r55 r72  
    11<div class="video"> 
    22<h2>View Video</h2> 
     3Found <?php e($videos['total']);?> videos 
    34 
    4         <dl> 
    5                 <dt>Id</dt> 
    6                 <dd>&nbsp;<?php echo $video['Video']['id']?></dd> 
    7                 <dt>Title</dt> 
    8                 <dd>&nbsp;<?php echo $video['Video']['title']?></dd> 
    9                 <dt>Url</dt> 
    10                 <dd>&nbsp;<?php echo $video['Video']['url']?></dd> 
    11                 <dt>Video Location</dt> 
    12                 <dd>&nbsp;<?php echo $video['Video']['video_location']?></dd> 
    13                 <dt>Video Date</dt> 
    14                 <dd>&nbsp;<?php echo $video['Video']['video_date']?></dd> 
    15                 <dt>Body</dt> 
    16                 <dd>&nbsp;<?php echo $video['Video']['body']?></dd> 
    17                 <dt>Copyright Owner</dt> 
    18                 <dd>&nbsp;<?php echo $video['Video']['copyright_owner']?></dd> 
    19                 <dt>Copyright</dt> 
    20                 <dd>&nbsp;<?php echo $html->link($video['Copyright']['title'], array('controller'=> 'copyrights', 'action'=>'view', $video['Copyright']['id'])); ?></dd> 
    21                 <dt>Published</dt> 
    22                 <dd>&nbsp;<?php echo $video['Video']['published']?></dd> 
    23                 <dt>User</dt> 
    24                 <dd>&nbsp;<?php echo $html->link($video['User']['name'], array('controller'=> 'users', 'action'=>'view', $video['User']['id'])); ?></dd> 
    25                 <dt>Subject</dt> 
    26                 <dd>&nbsp;<?php echo $html->link($video['Subject']['title'], array('controller'=> 'subjects', 'action'=>'view', $video['Subject']['id'])); ?></dd> 
    27                 <dt>Tags</dt> 
    28                 <dd>&nbsp;<?php echo $video['Video']['tags']?></dd> 
    29         </dl> 
    30 </div> 
    31 <div class="actions"> 
    32         <ul> 
    33                 <li><?php echo $html->link('Edit Video',   array('action'=>'edit', $video['Video']['id'])); ?> </li> 
    34                 <li><?php echo $html->link('Delete Video', array('action'=>'delete', $video['Video']['id']), null, 'Are you sure you want to delete #' . $video['Video']['id'] . '?'); ?> </li> 
    35                 <li><?php echo $html->link('List Videos', array('action'=>'index')); ?> </li> 
    36                 <li><?php echo $html->link('New Video', array('action'=>'add')); ?> </li> 
    37                 <li><?php echo $html->link('List Copyright', array('controller'=> 'copyrights', 'action'=>'index')); ?> </li> 
    38                 <li><?php echo $html->link('New Copyrights', array('controller'=> 'copyrights', 'action'=>'add')); ?> </li> 
    39                 <li><?php echo $html->link('List User', array('controller'=> 'users', 'action'=>'index')); ?> </li> 
    40                 <li><?php echo $html->link('New Users', array('controller'=> 'users', 'action'=>'add')); ?> </li> 
    41                 <li><?php echo $html->link('List Subject', array('controller'=> 'subjects', 'action'=>'index')); ?> </li> 
    42                 <li><?php echo $html->link('New Subjects', array('controller'=> 'subjects', 'action'=>'add')); ?> </li> 
    43         </ul> 
     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> 
     13                 
     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> 
    4425 
    4526</div> 
    46 <div class="related"> 
    47 <h3>Related Tags</h3> 
    48 <?php if(!empty($video['Tag'])):?> 
    49 <table cellpadding="0" cellspacing="0"> 
    50         <tr> 
    51                 <th>Id</th> 
    52                 <th>Tag</th> 
    53                 <th>Actions</th> 
    54         </tr> 
    55 <?php foreach($video['Tag'] as $tag):?> 
    56         <tr> 
    57                 <td><?php echo $tag['id'];?></td> 
    58                 <td><?php echo $tag['tag'];?></td> 
    59                 <td class="actions"> 
    60                         <?php echo $html->link('View', array('controller'=> 'tags', 'action'=>'view', $tag['id'])); ?> 
    61                         <?php echo $html->link('Edit', array('controller'=> 'tags', 'action'=>'edit', $tag['id'])); ?> 
    62                         <?php echo $html->link('Delete', array('controller'=> 'tags', 'action'=>'delete', $tag['id']), null, 'Are you sure you want to delete #' . $tag['id'] . '?'); ?> 
    63                 </td> 
    64         </tr> 
    65 <?php endforeach; ?> 
    66 </table> 
    67 <?php endif; ?> 
    68  
    69         <div class="actions"> 
    70                 <ul> 
    71                         <li><?php echo $html->link('New Tag', array('controller'=> 'tags', 'action'=>'add'));?> </li> 
    72                 </ul> 
    73         </div> 
    74 </div> 
  • branch/webroot/css/default.css

    r63 r72  
    11/* Layout Code */ 
    22 
     3body { 
     4        background: #000 url('../img/bg.png') repeat-x; 
     5        color:#fff; 
     6} 
     7 
     8a {color:#004dcb; text-decoration:none;} 
     9 
    310div#hd { 
    4         height:150px; 
    5         background: #000
     11        height:130px; 
     12        background: #fff url('../img/NoHalfMeasures.jpg') no-repeat
    613        color: #fff; 
    714} 
     
    916div#content { 
    1017        overflow:auto; 
     18        min-height:340px; 
    1119} 
    1220 
     
    2028} 
    2129 
     30div.nav-area { 
     31        margin-bottom:0; 
     32} 
     33 
    2234/* Style Code */ 
     35 
     36div.yui-u { 
     37        /*border:1px solid #000;*/ 
     38        background:#000; 
     39} 
     40 
     41div.yui-u h3 { 
     42        height:20px; 
     43        background: url('../img/h2_top.png') repeat-x; 
     44        font-size:1em; 
     45        border:2px solid #000; 
     46        color:#000; 
     47        font-weight:bold; 
     48} 
    2349 
    2450h2 { font-size:2em; } 
     
    107133 
    108134thead { 
    109         border-left:1px solid #2293FF;         
     135        border-left:1px solid #fff;    
    110136} 
    111137 
    112138thead th { 
    113         background: #2293FF
     139        background: #2293FF url('../img/h2_top.png') repeat-x
    114140        color: #FFFFFF; 
    115141        font-size: 125%; 
    116         border-top:1px solid #2293FF
    117         border-right:1px solid #2293FF
     142        border-top:1px solid #fff
     143        border-right:1px solid #fff
    118144        padding: 4px 0.4em 4px 0.4em;    
    119145} 
    120146 
    121147tfoot td, tfoot th { 
    122         border-top:1px solid #2293FF
     148        border-top:1px solid #fff
    123149        border-right: none; 
    124150        font-weight: bolder; 
     
    128154 
    129155tbody td, tbody th { 
    130         background-color: #D9ECFF
    131         border-right:1px solid #2293FF
     156        background-color: #222
     157        border-right:1px solid #fff
    132158        font-size: 110%; 
    133159        padding: 0.4em 0.5em 0.4em 0.5em; 
     
    135161 
    136162tbody tr.odd th, tbody tr.odd td{ 
    137         background-color: #BDDFFF
     163        background-color: #444
    138164} 
    139165 
     
    143169} 
    144170 
    145 table a:link, table a:visited, table a:active {  
    146         color:#444F66; 
     171table a, a:link, table a:visited, table a:active {       
    147172        background-color: transparent; 
    148         text-decoration: underline; 
    149173} 
    150174 
    151175table a:hover { 
    152176        text-decoration:none; 
    153         background-color: #1E90FF; 
    154177        color: #FFFFFF; 
    155178} 
     
    177200ul.gallery li {float:left; margin-right:20px;} 
    178201ul.gallery li img {border:5px groove #000;} 
     202 
     203/* Navigation */ 
     204 
     205/* Entry */ 
     206div.hentry h2 { 
     207        background: url('../img/h2_top.png') repeat-x; 
     208} 
     209 
     210div.hentry h2 a { 
     211        color:#000; 
     212        margin-left:30px; 
     213} 
     214 
     215div.hentry div.entry-infobar { 
     216        background: #000; 
     217        color: #fff; 
     218        border-bottom:2px solid #fff; 
     219} 
     220 
     221div.hentry div.entry-content { 
     222        padding-left:50px; 
     223        padding-right:50px; 
     224        margin-top:10px; 
     225        margin-bottom:10px; 
     226} 
     227 
     228div.hentry div.meta { 
     229        margin-top:10px; 
     230        clear:both; 
     231        border-top:2px solid #fff; 
     232} 
     233 
     234/* videos */ 
     235 
     236div.video { 
     237        margin: auto 0; 
     238        width:60%; 
     239        text-align:center; 
     240} 
     241 
     242dl.video-gallery { 
     243         
     244} 
     245 
     246dl.video-gallery dt { 
     247        /*clear:left;*/ 
     248        text-align:left; 
     249} 
     250 
     251dl.video-gallery dd { 
     252        float:left; 
     253        margin-right:30px; 
     254} 
  • branch/webroot/js/webrocket.js

    r68 r72  
    4141         
    4242        $j(".wymsubmit").click(function () {alert($j(this).siblings(".wymeditor").val());}); 
    43          
    44         $j("ul.mytreemenu").Treeview({speed: "slow", collapsed: true, store: true}); 
    45          
     43                 
    4644        var autoopts = { 
    4745                multiple: true, 
     
    5048         
    5149        $j(".tags").autocomplete("/tags/autocomplete", autoopts); 
     50         
     51        $j('ul.jd_menu').jdMenu(); 
    5252         
    5353        /*var options = {