Guest User

Untitled

a guest
Jan 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. /**
  2. * Group videos with albums. Any group you want to create, you create a new album. Albums named "Godwatch" , "Missions", "Featured" and "Other"
  3. * will be yanked out and split out into their own tab. Every other album will fall under the "sermons" category.
  4. */
  5. //get all albums
  6. $albums = $vimeo->call('vimeo.albums.getAll', array('user_id' => 'ridgelife'));
  7.  
  8. $albums_sermons = array();
  9. $albums_featured = array();
  10. $albums_missions = array();
  11. $albums_godwatch = array();
  12. $albums_other = array();
  13.  
  14. //the album titles to pluck, and the array to stick them in
  15. $albums_to_yank = array("featured","missions","godwatch","other");
  16.  
  17. //loop through all the albums and pluck out the ones we want split out...
  18. foreach($albums->albums->album as $album){
  19. //if the album name is in our array above...
  20. if(in_array(strtolower($album->title), $albums_to_yank)){
  21. //add it to it's similiarly-named array...
  22. ${"albums_".strtolower($album->title)}[] = $album;
  23. }else{
  24. //add to the "SERMONS" album
  25. $albums_sermons[] = $album;
  26. }
  27. }
  28.  
  29. ?>
Add Comment
Please, Sign In to add comment