Advertisement
FlyFX

Mix Data

Jan 17th, 2013
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2.             global $wp_query;
  3.             $postid = $wp_query->post->ID;
  4.             $mix_venue = get_post_meta($postid, 'mix_venue', true);
  5.             $mix_url = get_post_meta($postid, 'mix_url', true);
  6.             $mix_date = get_post_meta($postid, 'mix_date', true);  
  7.            
  8.             // Set mix date to Unix timestamp format
  9.            
  10.             if (!empty($mix_date)){
  11.                    
  12.                 $mix_day = substr($mix_date, 1,2 );
  13.                 $mix_month = substr ($mix_date, 4,5);
  14.                 $mix_year = substr($mix_date, 6,10);
  15.                 $timestamp = mktime(0,0,0,$mix_month,$mix_day,$mix_year);
  16.                 $formateddate = date("l, F jS Y" ,$timestamp);
  17.                 }
  18.                
  19.                 // Display Soundcloud mixer with autoplay
  20.                
  21.                 if ((!empty($mix_url))){
  22.                
  23.                     echo do_shortcode('[soundcloud url="' . $mix_url .'" params="color=020202" width=" 100%" iframe="true" /]');
  24.                 } else
  25.                     echo '';
  26.                
  27.                 // Only display mix info if any has actually been set!
  28.                
  29.                 if ((!empty($mix_date)) && (!empty($mix_venue))){
  30.                     echo '<img src="../../wp-content/themes/DJRyan2013/images/icon-venue.png" class="icon"><span class="venuestamp">' . $mix_venue . '</span> &nbsp;<img src="../../wp-content/themes/DJRyan2013/images/icon-calendar.png" class="icon">&nbsp;<span class="venuestamp">' . $formateddate . '</span>';
  31.                 } else
  32.                     echo '';
  33.                
  34.                 if ((!empty($mix_url))){
  35.                     echo '&nbsp;&nbsp;<img src="../../wp-content/themes/DJRyan2013/images/icon-clock.png" class="icon"><span class="venuestamp">' . $mix_url;
  36.                 } else
  37.                     echo '';
  38.                
  39.  
  40.             ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement