Changeset 46
- Timestamp:
- 06/07/07 16:46:38 (1 year ago)
- Files:
-
- branch/controllers/playlists_controller.php (modified) (1 diff)
- branch/controllers/videos_controller.php (modified) (1 diff)
- branch/models/behaviors/simple_results.php (added)
- branch/models/playlist.php (modified) (1 diff)
- branch/models/playlists_track.php (modified) (1 diff)
- branch/models/track.php (modified) (1 diff)
- branch/views/elements/topnav.ctp (modified) (1 diff)
- branch/views/helpers/tree_menu.php (modified) (2 diffs)
- branch/views/playlists/admin_orderlist.ctp (added)
- branch/views/tracks/admin_add.ctp (modified) (1 diff)
- branch/views/videos/youtube.ctp (modified) (1 diff)
- branch/webrocket.sql (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/controllers/playlists_controller.php
r45 r46 139 139 } 140 140 } 141 142 function admin_orderlist($id = null) 143 { 144 $this->Session->setFlash('This method is currently disabled'); 145 $this->redirect(array('action'=>'index'), null, true); 146 /*if (!$id && empty($this->data)) 147 { 148 $this->Session->setFlash('Invalid id for Playlist'); 149 $this->redirect(array('action'=>'index'), null, true); 150 } 151 if (!empty($this->data)) 152 { 153 pr($this->data); 154 $this->Playlist->PlaylistsTrack->save($this->data); 155 //$this->Session->setFlash('Order updated'); 156 //$this->redirect(array('action'=>'index'), null, true); 157 } 158 $playlist = $this->Playlist->PlaylistsTrack->findAll(array('PlaylistsTrack.playlist_id' => $id)); 159 $this->set(compact('playlist'));*/ 160 } 141 161 142 162 } branch/controllers/videos_controller.php
r34 r46 12 12 13 13 $youtube =& new phpYoutube($dev_id); 14 $this->set('youtube', $youtube->videos_listbyuser($account, 1, 5 ));14 $this->set('youtube', $youtube->videos_listbyuser($account, 1, 50)); 15 15 } 16 16 branch/models/playlist.php
r45 r46 6 6 var $hasAndBelongsToMany = array( 7 7 'Track' => array('className' => 'Track', 8 'joinTable' => 'playlists_tracks', 9 'foreignKey' => 'playlist_id', 10 'associationForeignKey' => 'track_id', 8 11 'with' => 'PlaylistsTrack', 9 'associationForeignKey' => 'playlist_id',10 12 'order' => 'PlaylistsTrack.position ASC'), 11 13 ); 12 13 /*function beforeSave()14 {15 if ($this->data)16 {17 foreach ($this->data['Track']['Track'] as $key => $track)18 {19 $this->data['PlaylistsTrack']['position'] = $key;20 }21 }22 }*/23 24 /*function afterSave()25 {26 $playlist = $this->getLastInsertID();27 28 29 }*/30 14 31 15 } branch/models/playlists_track.php
r44 r46 4 4 { 5 5 var $belongsTo = array('Playlist', 'Track'); 6 7 var $actsAs = array('SimpleResults' => array('simplifyIfJoins' => true)); 8 9 var $useSimpleResults = true; 6 10 } 7 11 branch/models/track.php
r45 r46 22 22 var $hasAndBelongsToMany = array( 23 23 'Playlist' => array('className' => 'Playlist', 24 'with' => 'PlaylistsTrack', 25 'associationForeignKey' => 'track_id', 24 'joinTable' => 'playlists_tracks', 25 'foreignKey' => 'track_id', 26 'associationForeignKey' => 'playlist_id', 27 'with' => 'PlaylistsTrack', 26 28 'order' => 'PlaylistsTrack.position ASC'), 27 29 'Tag' => array('className' => 'Tag', branch/views/elements/topnav.ctp
r24 r46 1 1 <?php $menus = $this->requestAction('/menus/index/1');?> 2 2 <div id="topnav" class="primarynav"> 3 <?php e($treeMenu->generate($menus ));?>3 <?php e($treeMenu->generate($menus, 'jd_menu', true));?> 4 4 </div> branch/views/helpers/tree_menu.php
r25 r46 5 5 var $helpers = array('Html','othAuth'); 6 6 7 function generate($data, $class='jd_menu', $include_login = 0)7 function generate($data, $class='jd_menu', $include_login = false) 8 8 { 9 9 $output = '<ul class="' . $class . '">'; … … 18 18 $output .= '</li>'; 19 19 } 20 endforeach; 20 endforeach; 21 if ($include_login) { 22 if ($this->othAuth->sessionValid()) 23 { 24 $output .= '<li><a href="/users/logout">Logout</a></li>'; 25 } else { 26 $output .= '<li><a href="/users/login">Login</a></li>'; 27 } 28 } 21 29 $output .= '</ul>'; 22 30 return $output; branch/views/tracks/admin_add.ctp
r43 r46 13 13 <fieldset> 14 14 <legend>Meta Information</legend> 15 <?php e($form->input('infourl'));?> 15 16 <?php e($form->input('tags'));?> 16 17 <?php e($form->input('image_id', array('options'=>$images)));?> branch/views/videos/youtube.ctp
r34 r46 1 <?php print_r($youtube);?>2 1 <?php //pr($youtube);?> 2 <ul class="gallery"> 3 3 <?php foreach($youtube['video'] as $video) : ?> 4 <h2><?php e($video['title']);?></h2> 5 6 <object width="425" height="350"> 7 <param name="movie" value="http://www.youtube.com/v/<?php e($video['id']);?>"></param> 8 <param name="wmode" value="transparent"></param> 9 <embed src="http://www.youtube.com/v/<?php e($video['id']);?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> 10 </object> 4 <li class="video-item-<?php e($video['id']);?>" style="display:none;" /> 5 <?php e($video['title']);?><br /> 6 <img src="<?php e($video['thumbnail_url']);?>" /> 7 </li> 8 <?php e($javascript->codeBlock('$("li.video-item-' . $video['id'] . '").fadeIn(1000);'));?> 11 9 <?php endforeach;?> 10 </ul> branch/webrocket.sql
r42 r46 4 4 -- 5 5 -- Host: localhost 6 -- Generation Time: Jun 0 4, 2007 at 11:22PM6 -- Generation Time: Jun 07, 2007 at 05:43 PM 7 7 -- Server version: 5.0.38 8 8 -- PHP Version: 5.2.1 … … 29 29 30 30 INSERT INTO `cake_sessions` (`id`, `data`, `expires`) VALUES 31 ('f e8331bf8cc87191dd20a10e1b69cfce', 'Config|a:3:{s:9:"userAgent";s:32:"268042ced84746041c45b952d0ba6110";s:4:"time";i:1180995396;s:4:"rand";i:205194849;}othAuth|a:1:{s:41:"ADYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi";a:2:{s:4:"User";a:17:{s:2:"id";s:1:"1";s:8:"username";s:14:"WebrocketAdmin";s:6:"passwd";s:32:"fdfedc01c66e9ea2817508ca1097df2f";s:4:"name";s:15:"Webrocket Admin";s:5:"email";s:19:"admin@webrocket.com";s:10:"last_visit";s:19:"2007-06-04 16:00:00";s:8:"group_id";s:1:"1";s:10:"profile_id";s:1:"1";s:11:"posts_count";s:1:"4";s:11:"pages_count";s:1:"2";s:14:"comments_count";s:1:"2";s:12:"videos_count";s:1:"0";s:6:"active";s:1:"1";s:7:"created";s:19:"2007-03-26 00:00:00";s:8:"modified";s:19:"0000-00-00 00:00:00";s:10:"login_hash";s:32:"9959667d54c2bb525ab6b832bdd90c14";s:7:"hashkey";s:41:"ADYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi";}s:5:"Group";a:8:{s:2:"id";s:1:"1";s:4:"name";s:11:"Site Admins";s:5:"level";s:3:"999";s:8:"redirect";s:0:"";s:9:"perm_type";s:5:"allow";s:7:"created";s:19:"2007-03-26 00:00:00";s:8:"modified";s:19:"0000-00-00 00:00:00";s:10:"Permission";a:1:{i:0;a:4:{s:2:"id";s:1:"1";s:4:"name";s:1:"*";s:7:"created";s:19:"2007-03-26 00:00:00";s:8:"modified";s:19:"0000-00-00 00:00:00";}}}}}Message|a:0:{}', 1180995396);31 ('f3fa13175a022e6d7d1c445c9a39185b', 'Config|a:3:{s:9:"userAgent";s:32:"268042ced84746041c45b952d0ba6110";s:4:"time";i:1181230718;s:4:"rand";i:1380475676;}othAuth|a:1:{s:41:"ADYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi";a:2:{s:4:"User";a:18:{s:2:"id";s:1:"1";s:8:"username";s:14:"WebrocketAdmin";s:6:"passwd";s:32:"fdfedc01c66e9ea2817508ca1097df2f";s:4:"name";s:15:"Webrocket Admin";s:5:"email";s:19:"admin@webrocket.com";s:10:"last_visit";s:19:"2007-06-07 14:30:54";s:8:"group_id";s:1:"1";s:10:"profile_id";s:1:"1";s:11:"posts_count";s:1:"4";s:11:"pages_count";s:1:"2";s:14:"comments_count";s:1:"2";s:12:"videos_count";s:1:"0";s:4:"tags";s:0:"";s:6:"active";s:1:"1";s:7:"created";s:19:"2007-03-26 00:00:00";s:8:"modified";s:19:"0000-00-00 00:00:00";s:10:"login_hash";s:32:"9959667d54c2bb525ab6b832bdd90c14";s:7:"hashkey";s:41:"ADYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi";}s:5:"Group";a:9:{s:2:"id";s:1:"1";s:4:"name";s:11:"Site Admins";s:5:"level";s:3:"999";s:8:"redirect";s:0:"";s:9:"perm_type";s:5:"allow";s:11:"users_count";s:1:"0";s:7:"created";s:19:"2007-03-26 00:00:00";s:8:"modified";s:19:"0000-00-00 00:00:00";s:10:"Permission";a:1:{i:0;a:4:{s:2:"id";s:1:"1";s:4:"name";s:1:"*";s:7:"created";s:19:"2007-03-26 00:00:00";s:8:"modified";s:19:"0000-00-00 00:00:00";}}}}}', 1181230718); 32 32 33 33 -- -------------------------------------------------------- … … 556 556 `redirect` varchar(50) character set utf8 collate utf8_unicode_ci NOT NULL, 557 557 `perm_type` enum('allow','deny') NOT NULL default 'allow', 558 `users_count` int(8) unsigned NOT NULL, 558 559 `created` datetime NOT NULL default '0000-00-00 00:00:00', 559 560 `modified` datetime NOT NULL default '0000-00-00 00:00:00', … … 565 566 -- 566 567 567 INSERT INTO `groups` (`id`, `name`, `level`, `redirect`, `perm_type`, ` created`, `modified`) VALUES568 (1, 'Site Admins', 999, '', 'allow', '2007-03-26 00:00:00', '0000-00-00 00:00:00'),569 (2, 'Site Editors', 900, '', 'allow', '2007-03-26 00:00:00', '0000-00-00 00:00:00'),570 (3, 'Registered Members', 500, '', 'allow', '2007-03-26 00:00:00', '0000-00-00 00:00:00'),571 (4, 'Anonymous Visitor', 0, '', 'allow', '0000-00-00 00:00:00', '0000-00-00 00:00:00');568 INSERT INTO `groups` (`id`, `name`, `level`, `redirect`, `perm_type`, `users_count`, `created`, `modified`) VALUES 569 (1, 'Site Admins', 999, '', 'allow', 0, '2007-03-26 00:00:00', '0000-00-00 00:00:00'), 570 (2, 'Site Editors', 900, '', 'allow', 0, '2007-03-26 00:00:00', '0000-00-00 00:00:00'), 571 (3, 'Registered Members', 500, '', 'allow', 0, '2007-03-26 00:00:00', '0000-00-00 00:00:00'), 572 (4, 'Anonymous Visitor', 0, '', 'allow', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'); 572 573 573 574 -- -------------------------------------------------------- … … 620 621 `modified` datetime default NULL, 621 622 PRIMARY KEY (`id`) 622 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 4;623 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=46 ; 623 624 624 625 -- … … 626 627 -- 627 628 629 INSERT INTO `images` (`id`, `filename`, `dir`, `thumb`, `mimetype`, `alt`, `subject_id`, `copyright_owner`, `copyright_id`, `image_location`, `image_date`, `image_notes`, `filesize`, `tags`, `user_id`, `created`, `modified`) VALUES 630 (45, 'TheHedrons_Group1.jpg', 'files/Image', 'thumb.TheHedrons_Group1.jpg', 'image/jpeg', 'The Hedrons Group', 1, 'The Hedrons', 1, 'None', '2007-06-05', 'The Hedrons', 146539, 'The Hedrons', 1, '2007-06-05 15:47:17', '2007-06-05 15:47:17'); 628 631 629 632 -- -------------------------------------------------------- … … 647 650 (37, 30), 648 651 (38, 29), 649 (38, 30); 652 (38, 30), 653 (45, 4); 650 654 651 655 -- -------------------------------------------------------- … … 820 824 `id` int(8) unsigned NOT NULL auto_increment, 821 825 `title` varchar(255) collate utf8_unicode_ci NOT NULL, 822 PRIMARY KEY (`id`) 823 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; 826 `comments` varchar(255) collate utf8_unicode_ci NOT NULL, 827 PRIMARY KEY (`id`) 828 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=15 ; 824 829 825 830 -- … … 827 832 -- 828 833 829 INSERT INTO `playlists` (`id`, `title`) VALUES 830 (1, 'One More Won''t Kill Us'); 834 INSERT INTO `playlists` (`id`, `title`, `comments`) VALUES 835 (13, 'New Test Playlist', ''), 836 (14, 'New Test Playlist', ''); 831 837 832 838 -- -------------------------------------------------------- … … 838 844 CREATE TABLE `playlists_tracks` ( 839 845 `playlist_id` int(8) unsigned NOT NULL, 840 `track_id` int(8) unsigned NOT NULL 846 `track_id` int(8) unsigned NOT NULL, 847 `position` int(8) unsigned NOT NULL 841 848 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 842 849 … … 845 852 -- 846 853 847 INSERT INTO `playlists_tracks` (`playlist_id`, `track_id`) VALUES 848 (1, 1), 849 (1, 2); 854 INSERT INTO `playlists_tracks` (`playlist_id`, `track_id`, `position`) VALUES 855 (14, 3, 0), 856 (14, 4, 0), 857 (14, 6, 0), 858 (14, 5, 0), 859 (13, 3, 0), 860 (13, 5, 0), 861 (13, 6, 0), 862 (13, 4, 0); 850 863 851 864 -- -------------------------------------------------------- … … 1072 1085 1073 1086 INSERT INTO `subjects` (`id`, `title`, `posts_count`, `pages_count`, `events_count`, `feeds_count`, `images_count`, `galleries_count`, `videos_count`, `created`, `modified`) VALUES 1074 (1, 'Webrocket', 4, 0, 2, 0, 0, 0, 0, '2007-05-01 17:05:55', '2007-05-01 17:05:55');1087 (1, 'Webrocket', 4, 0, 2, 0, 1, 0, 0, '2007-05-01 17:05:55', '2007-05-01 17:05:55'); 1075 1088 1076 1089 -- -------------------------------------------------------- … … 1141 1154 1142 1155 INSERT INTO `tags_tracks` (`tag_id`, `track_id`) VALUES 1143 (4, 1), 1144 (4, 2); 1156 (4, 4), 1157 (4, 3), 1158 (4, 5), 1159 (4, 6); 1160 1161 -- -------------------------------------------------------- 1162 1163 -- 1164 -- Table structure for table `tags_users` 1165 -- 1166 1167 CREATE TABLE `tags_users` ( 1168 `tag_id` int(8) unsigned NOT NULL, 1169 `user_id` int(8) unsigned NOT NULL 1170 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1171 1172 -- 1173 -- Dumping data for table `tags_users` 1174 -- 1175 1145 1176 1146 1177 -- -------------------------------------------------------- … … 1186 1217 `dir` varchar(255) collate utf8_unicode_ci NOT NULL, 1187 1218 `mimetype` varchar(255) collate utf8_unicode_ci NOT NULL, 1219 `filesize` int(8) unsigned NOT NULL, 1220 `trackname` varchar(255) collate utf8_unicode_ci NOT NULL, 1188 1221 `artist` varchar(255) collate utf8_unicode_ci NOT NULL, 1222 `infourl` varchar(255) collate utf8_unicode_ci NOT NULL, 1189 1223 `tags` varchar(255) collate utf8_unicode_ci NOT NULL, 1190 1224 `image_id` int(8) unsigned NOT NULL, … … 1192 1226 `modified` datetime default NULL, 1193 1227 PRIMARY KEY (`id`) 1194 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT= 3;1228 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=7 ; 1195 1229 1196 1230 -- … … 1198 1232 -- 1199 1233 1200 INSERT INTO `tracks` (`id`, `filename`, `dir`, `mimetype`, `artist`, `tags`, `image_id`, `created`, `modified`) VALUES 1201 (1, '01__Heatseeker.mp3', 'files/Media', 'audio/mpeg', 'The Hedrons', 'The Hedrons', 42, '2007-06-04 16:08:34', '2007-06-04 16:08:34'), 1202 (2, '02__Couldnt_Leave_Her_Alone.mp3', 'files/Media', 'audio/mpeg', 'The Hedrons', 'The Hedrons', 42, '2007-06-04 16:42:21', '2007-06-04 16:42:21'); 1234 INSERT INTO `tracks` (`id`, `filename`, `dir`, `mimetype`, `filesize`, `trackname`, `artist`, `infourl`, `tags`, `image_id`, `created`, `modified`) VALUES 1235 (3, '01__Heatseeker.mp3', 'files/Media', 'audio/mpeg', 1399270, 'Heatseeker', 'The Hedrons', 'http://www.7digital.com/stores/productDetail.aspx?shop=34&product=55080&sid=639775', 'The Hedrons', 45, '2007-06-05 15:49:11', '2007-06-05 15:49:11'), 1236 (4, '02__Couldnt_Leave_Her_Alone.mp3', 'files/Media', 'audio/mpeg', 1078158, 'Couldn''t Leave Her Alone', 'The Hedrons', 'http://www.7digital.com/stores/productDetail.aspx?shop=34&product=55080&sid=639775', 'The Hedrons', 45, '2007-06-05 15:51:51', '2007-06-05 15:51:51'), 1237 (5, '03__I_Need_You.mp3', 'files/Media', 'audio/mpeg', 1185184, 'I Need You', 'The Hedrons', 'http://www.7digital.com/stores/productDetail.aspx?shop=34&product=55080&sid=639775', 'The Hedrons', 45, '2007-06-05 15:53:54', '2007-06-05 15:53:54'), 1238 (6, '04__Be_My_Friend.mp3', 'files/Media', 'audio/mpeg', 1054441, 'Be My Friend', 'The Hedrons', 'http://www.7digital.com/stores/productDetail.aspx?shop=34&product=55080&sid=639775', 'The Hedrons', 45, '2007-06-05 15:59:45', '2007-06-05 15:59:45'); 1203 1239 1204 1240 -- -------------------------------------------------------- … … 1241 1277 `comments_count` int(4) NOT NULL, 1242 1278 `videos_count` int(4) NOT NULL, 1279 `tags` varchar(255) NOT NULL, 1243 1280 `active` tinyint(1) unsigned NOT NULL default '0', 1244 1281 `created` datetime NOT NULL default '0000-00-00 00:00:00', … … 1254 1291 -- 1255 1292 1256 INSERT INTO `users` (`id`, `username`, `passwd`, `name`, `email`, `last_visit`, `group_id`, `profile_id`, `posts_count`, `pages_count`, `comments_count`, `videos_count`, ` active`, `created`, `modified`) VALUES1257 (1, 'WebrocketAdmin', 'fdfedc01c66e9ea2817508ca1097df2f', 'Webrocket Admin', 'admin@webrocket.com', '2007-06-0 4 22:52:42', 1, 1, 4, 2, 2, 0, 1, '2007-03-26 00:00:00', '0000-00-00 00:00:00'),1258 (2, 'Editor', '5aee9dbd2a188839105073571bee1b1f', 'Site', 'Editor', '2007-04-27 10:02:45', 2, 0, 0, 0, 0, 0, 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'),1259 (3, 'Member', 'aa08769cdcb26674c6706093503ff0a3', 'Member', 'member@member.com', '2007-04-26 13:43:34', 3, 0, 0, 0, 0, 0, 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'),1260 (4, '', '', '', '', '0000-00-00 00:00:00', 0, 0, 0, 0, 0, 3, 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00');1293 INSERT INTO `users` (`id`, `username`, `passwd`, `name`, `email`, `last_visit`, `group_id`, `profile_id`, `posts_count`, `pages_count`, `comments_count`, `videos_count`, `tags`, `active`, `created`, `modified`) VALUES 1294 (1, 'WebrocketAdmin', 'fdfedc01c66e9ea2817508ca1097df2f', 'Webrocket Admin', 'admin@webrocket.com', '2007-06-07 16:11:33', 1, 1, 4, 2, 2, 0, '', 1, '2007-03-26 00:00:00', '0000-00-00 00:00:00'), 1295 (2, 'Editor', '5aee9dbd2a188839105073571bee1b1f', 'Site', 'Editor', '2007-04-27 10:02:45', 2, 0, 0, 0, 0, 0, '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), 1296 (3, 'Member', 'aa08769cdcb26674c6706093503ff0a3', 'Member', 'member@member.com', '2007-04-26 13:43:34', 3, 0, 0, 0, 0, 0, '', 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00'), 1297 (4, '', '', '', '', '0000-00-00 00:00:00', 0, 0, 0, 0, 0, 3, '', 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00'); 1261 1298 1262 1299 -- -------------------------------------------------------- … … 1290 1327 INSERT INTO `videos` (`id`, `title`, `url`, `video_location`, `video_date`, `body`, `copyright_owner`, `copyright_id`, `published`, `user_id`, `subject_id`, `tags`, `created`, `modified`) VALUES 1291 1328 (20, 'The Hedrons EPK', 'http://www.youtube.com/v/28u-swVWo9Q', 'N/A', '2007-05-17', 'The Hedrons EPK', 'The Hedrons', 1, 0, 0, 1, 'The Hedrons, Video, Epk, Biography, Be My Friend, I Need You, Couldnt Leave Her Alone, Heatseeker', '2007-05-17 16:18:11', '2007-05-17 16:24:36'); 1292