show[0]->recordKey = 'NTVD-CJ-3N67231831062008'; $shows->show[0]->name = 'The Vibe Dials CD Release'; $shows->show[0]->city = 'Nashville'; $shows->show[0]->venueName = 'Ryman Auditorium'; $shows->show[0]->venueNameExt = 'Mother Church'; $shows->show[0]->showType = 'Club/Casino/Arena Show'; $shows->show[0]->venueZip = '37219'; $shows->show[0]->venuePhone = '615-889-3060'; $shows->show[0]->venueAddress = '116 5th Ave North'; $shows->show[0]->ticketURI = 'http://thevibedials.com'; $shows->show[0]->description = 'You\'ve made it when you\'re playing the Ryman.'; $shows->show[0]->ageLimit = 'All Ages'; $shows->show[0]->venueURI = 'http://www.ryman.com/'; $shows->show[0]->ticketPrice = '$10'; $shows->show[0]->date = date( $date_format ); $shows->show[0]->timeSet = date( $time_format, time() ); $shows->show[0]->gmtDate = gmdate( $date_format ); $shows->show[0]->showtimeZone = 'America/Chicago'; $shows->show[0]->timeDoors = date( $time_format, time() ); $shows->show[0]->directLink = ''; $shows->show[0]->posterImage = ''; $shows->show[0]->lastUpdate = date( $time_format, time() ); $shows->show[0]->stateAbbreviation = 'TN'; $shows->show[0]->state = 'Tennessee'; $shows->show[0]->countryAbbreviation = 'US'; $shows->show[0]->country = 'United States'; $shows->show[0]->timeZone = 'America/Chicago'; $shows->show[0]->deposit = '$100'; $shows->show[0]->depositReceived = date( $date_format ); $shows->show[0]->otherArtists->name = ''; $shows->show[0]->otherArtists->uri = ''; $shows->show[0]->otherArtists->timeSet = ''; $shows->show[0]->artistname = 'The Vibe Dials'; $shows->show[0]->artistKey = 'AR-8FAD4948ACC579CB'; $shows->show[1]->recordKey = 'NTVD-CJ-3N67231831062009'; $shows->show[1]->name = 'Bonnaroo Music Festival'; $shows->show[1]->city = 'Manchester'; $shows->show[1]->venueName = 'Bonnaroo Centeroo'; $shows->show[1]->venueNameExt = 'The Other Tent'; $shows->show[1]->showType = 'Festival / Fair'; $shows->show[1]->venueZip = '37355'; $shows->show[1]->venuePhone = '1-800Ð594-8499'; $shows->show[1]->venueAddress = 'New Bushy Branch Road'; $shows->show[1]->ticketURI = 'http://thevibedials.com'; $shows->show[1]->description = 'Bonnaroooooo!'; $shows->show[1]->ageLimit = 'All Ages'; $shows->show[1]->venueURI = 'http://www.bonnaroo.com/'; $shows->show[1]->ticketPrice = '$150'; $shows->show[1]->date = date( $date_format ); $shows->show[1]->timeSet = date( $time_format, time() ); $shows->show[1]->gmtDate = gmdate( $date_format ); $shows->show[1]->showtimeZone = 'America/Chicago'; $shows->show[1]->timeDoors = date( $time_format, time() ); $shows->show[1]->directLink = ''; $shows->show[1]->posterImage = ''; $shows->show[1]->lastUpdate = date( $time_format, time() ); $shows->show[1]->stateAbbreviation = 'TN'; $shows->show[1]->state = 'Tennessee'; $shows->show[1]->countryAbbreviation = 'US'; $shows->show[1]->country = 'United States'; $shows->show[1]->timeZone = 'America/Chicago'; $shows->show[1]->deposit = '$1000'; $shows->show[1]->depositReceived = date( $date_format ); $shows->show[1]->otherArtists->name = ''; $shows->show[1]->otherArtists->uri = ''; $shows->show[1]->otherArtists->timeSet = ''; $shows->show[1]->artistname = 'The Vibe Dials'; $shows->show[1]->artistKey = 'AR-8FAD4948ACC579CB'; $shows->show[2]->recordKey = 'NTVD-CJ-3N67231831062010'; $shows->show[2]->name = 'South by SouthWest Music Festival'; $shows->show[2]->city = 'Austin'; $shows->show[2]->venueName = 'The White Horse'; $shows->show[2]->venueNameExt = 'Main'; $shows->show[2]->showType = 'Festival / Fair'; $shows->show[2]->venueZip = '78702'; $shows->show[2]->venuePhone = ''; $shows->show[2]->venueAddress = '500 Comal St'; $shows->show[2]->ticketURI = 'http://thevibedials.com'; $shows->show[2]->description = ''; $shows->show[2]->ageLimit = '21+'; $shows->show[2]->venueURI = 'http://www.sxsw.com/'; $shows->show[2]->ticketPrice = '$595'; $shows->show[2]->date = date( $date_format ); $shows->show[2]->timeSet = date( $time_format, time() ); $shows->show[2]->gmtDate = gmdate( $date_format ); $shows->show[2]->showtimeZone = 'America/Chicago'; $shows->show[2]->timeDoors = date( $time_format, time() ); $shows->show[2]->directLink = ''; $shows->show[2]->posterImage = ''; $shows->show[2]->lastUpdate = date( $time_format, time() ); $shows->show[2]->stateAbbreviation = 'TX'; $shows->show[2]->state = 'Texas'; $shows->show[2]->countryAbbreviation = 'US'; $shows->show[2]->country = 'United States'; $shows->show[2]->timeZone = 'America/Chicago'; $shows->show[2]->deposit = '$100'; $shows->show[2]->depositReceived = date( $date_format ); $shows->show[2]->otherArtists->name = ''; $shows->show[2]->otherArtists->uri = ''; $shows->show[2]->otherArtists->timeSet = ''; $shows->show[2]->artistname = 'The Vibe Dials'; $shows->show[2]->artistKey = 'AR-8FAD4948ACC579CB'; return $shows; } // End of get_widget_layout() /* ========================================================================== Get Layouts ========================================================================== */ /** * Displays the user's chosen layout * * Gets the options, then registers and enqueues the correct CSS and calls the correct function to * display that layout's HTML. * * @since 0.4 * * @params array $params Includes data: layout, limit, source * * @uses classic_layout * @uses ical_layout */ function get_layout( $params ) { if( !empty( $params ) ) { extract( $params ); } switch ( $layout ) { case 'iCal Style' : wp_enqueue_style( 'slushman-adp-layout-ical' ); $this->ical_layout( array( 'limit' => $limit, 'source' => $source ) ); break; case 'Classic Style': default : wp_enqueue_style( 'slushman-adp-layout-classic' ); $this->classic_layout( array( 'limit' => $limit, 'source' => $source ) ); break; } // End of $layout switch } // End of get_layout() /** * Displays the user's chosen layout for the widget * * Gets the options, then registers and enqueues the correct CSS and calls the correct function to * display that layout's HTML. * * @since 0.4 * * @params string $layout The option name of the user's preferred widget layout * * @uses classic_widget_layout * @uses ical_widget_layout */ function get_widget_layout( $layout, $limit = '', $args, $instance ) { switch ( $layout ) { case 'iCal Style' : wp_enqueue_style( 'slushman-adp-layout-ical' ); $this->ical_widget_layout( $limit, $args, $instance ); break; case 'Classic Style': default : wp_enqueue_style( 'slushman-adp-layout-classic' ); $this->classic_widget_layout( $limit, $args, $instance ); break; } // End of $layout switch } // End of get_widget_layout() /* ========================================================================== Layout Section Functions ========================================================================== */ /** * Formats the age line * * If the Show Age Lmiit option is selected, the age limit is showno, therwise, it's blank. * * @since 0.4 * * @params array $params Includes data: css, $show Object * * @return mixed $return Formatted age/tix line */ function get_age( $css, $show, $instance = '' ) { extract( get_option( 'slushman_adp_general_settings' ) ); $display = ( !empty( $instance ) ? $instance['showage'] : $display_age ); $return = ( $display == 'on' && $show->ageLimit != '' ? 'Age Limit: ' . $show->ageLimit . '' : '' ); return $return; } // End of get_age() /** * Formats the artist line * * If the the Show Artist Name option is selected, the artist's name is shown, otherwise, it's blank. * * @since 0.4 * * @params array $params Includes data: css, $show Object * * @return mixed $return Formatted artist line */ function get_artist( $css, $show, $instance = '' ) { extract( get_option( 'slushman_adp_general_settings' ) ); $display = ( !empty( $instance ) ? $instance['showartist'] : $display_artist ); $return = ( $display == 'on' && $show->artistname != '' ? '' . $show->artistname . '' : '' ); return $return; } // End of get_artist() /** * Formats the date according to the user's preference * * Gets the options, the gets the user's preference for the date format. Grabs the show's date * and formats it according to the user's preference * * @since 0.4 * * @uses get_option * * @params string $showdate The date of the show * * @return string $return Formatted date */ function get_date( $showdate ) { extract( get_option( 'slushman_adp_general_settings' ) ); $date_format = ( isset( $adp_date_format ) ? $adp_date_format : get_option( 'date_format' ) ); return date_i18n( $date_format, strtotime( $showdate ) ); } // End of get_date() /** * Formats the description line * * If the the Show Description option is selected, it's displayed, otherwise, it's blank. * * @since 0.4 * * @params array $params Includes data: css, $show Object * * @return mixed $return Formatted name line */ function get_description( $css, $show, $instance = '' ) { extract( get_option( 'slushman_adp_general_settings' ) ); $display = ( !empty( $instance ) ? $instance['showdesc'] : $display_name ); if ( $display == 'on' && $show->name != '' ) { $return = '' . $show->name . ''; } else { $return = ''; } // End of $display_name and $name checks return $return; } // End of get_description() /** * Takes show data and converts into the ISO format * * ISO date format for rich snippets support * * @since 0.4 * * @uses DateTime() * @uses DateTimeZone() * * @params array $params Includes data: $show Object * * @return string $return Formatted time and date */ function get_iso( $show ) { if ( $show->showtimeZone == '' ) { $return = ''; } elseif ( $show->showtimeZone != 'System/Localtime' && !empty( $show->showtimeZone ) ) { $convert = date_create( $show->date . ' ' . $show->timeSet, timezone_open( $show->showtimeZone ) ); $return = date_format( $convert, DATE_ATOM ); } else { // get diff between GMT time and show time $atom = $show->date . 'T' . substr( $show->timeSet, 0, 12 ); $difftemp = strtotime( $show->gmtDate ) - strtotime( $atom ); $hours = $difftemp / 60 / 60; $hour = $hours < 9 ? '0' . $hours : $hours; $diff = $hour . ':00'; $porm = $diff > 0 ? '-' : '+'; $return = $show->date . 'T' . substr( $show->timeSet, 0, 12 ) . $porm . $diff; } // End of time zone check return $return; } // End of get_iso() /** * Formats the location line * * If the state equals "No state", then the location line is just the city and country. If the show * country option is checked, then the line becomes city, state abbreviation, country abbreviation. * Otherwise, the line is city, state abbreviation. * * @since 0.4 * * @uses get_option * * @params array $params Includes data: css, $show Object * * @return mixed $return Formatted location line */ function get_location( $css, $show, $instance = '' ) { extract( get_option( 'slushman_adp_general_settings' ) ); $display = ( !empty( $instance ) ? $instance['showcountry'] : $display_country ); if ( $show->stateAbbreviation == 'No State' ) { $loc = '' . $show->city . ', ' . $show->country . ''; } elseif ( $display == 'on' ) { $loc = '' . $show->city . ', ' . $show->stateAbbreviation . ', ' . $show->countryAbbreviation . ''; } else { $loc = '' . $show->city . ', ' . $show->stateAbbreviation . ''; } // End of stateAbbreviation check // Make the city & state a Google Map link, else just show city & state if ( $show->venueAddress && $show->venueAddress != '' ) { $return = '' . $loc . ' - map'; /* '; */ } else { $return = '' . $loc . ''; } // End of if ( !empty( $show->venueAddress ) ) return $return; } // End of get_location() /** * Gets the appropriate separator * * @since 0.4 * * @params array $params Includes data: $which, $option1, $option2 = '', $data1 = '', $data2 = '' * * @return string $return Either ' at ' or blank */ function get_separator( $params ) { extract( get_option( 'slushman_adp_general_settings' ) ); if ( $params[0] == 'at' && $params[1] == 'on' && $params[2] != '' ) { $return = ' at '; } elseif ( $params[0] == 'at2' && $params[1] == 'on' && $params[2] != '' && $params[3] == 'on' && $params[4] != '' ) { $return = ' at '; } elseif ( $params[0] == 'dash' && $params[1] == 'on' && $params[2] != '' && $params[3] == 'on' && $params[4] != '' ) { $return = ' - '; } elseif ( $params[0] == 'onthe' && $params[1] == 'on' && $params[2] != '' && $params[3] == 'on' && $params[4] != '' ) { $return = ' on the '; } elseif ( $params[0] == 'onthe2' && $params[1] == 'on' && $params[2] != '' && $params[4] != '' ) { $return = ' on the '; } elseif ( $params[0] == 'vbar' && $params[1] == 'on' && $params[2] != '' && $params[3] == 'on' && $params[4] != '' ) { $return = ' | '; } else { $return = ''; } // End of separator checks return $return; } // End of get_separator() /** * Formats the time according to the user's preference * * Gets the options, the gets the user's preference for the time format. Grabs the show's time * and formats it according to the user's preference * * @since 0.4 * * @uses get_option * * @params array $params Includes the data: css, $show Object * * @return string $return Formatted time */ function get_stage( $css, $show, $instance = '' ) { extract( get_option( 'slushman_adp_general_settings' ) ); $display = ( !empty( $instance ) ? $instance['showstage'] : $display_stage ); $return = ( $display == 'on' && $show->venueNameExt != '' ? ' on the ' . $show->venueNameExt . ' stage' : '' ); return $return; } // End of get_time() /** * Formats the time according to the user's preference * * Gets the options, the gets the user's preference for the time format. Grabs the show's time * and formats it according to the user's preference * * @since 0.4 * * @uses get_option * * @params array $params Date includes: css, $show Object * * @return string $return Formatted time */ function get_time( $css, $show, $instance = '' ) { extract( get_option( 'slushman_adp_general_settings' ) ); $display = ( !empty( $instance ) ? $instance['showtime'] : $display_time ); $format = ( isset( $adp_time_format ) ? $adp_time_format : get_option( 'time_format' ) ); $return = ( $display == 'on' ? '' . date_i18n( $format, strtotime( $show->timeSet ) ) . '' : '' ); return $return; } // End of get_time() /** * Formats the tickets line * * If the the Show Artist Name option is selected, the artist's name is shown first, followed by * the event name. Otherwise, it's just the event name. * * @since 0.4 * * @params array $params Includes data: css, $show Object * * @return mixed $return Formatted age/tix line */ function get_tix( $css, $show, $instance = '' ) { extract( get_option( 'slushman_adp_general_settings' ) ); $display = ( !empty( $instance ) ? $instance['showtix'] : $display_tickets ); if ( $display == 'on' && $show->ticketURI != '' && $show->ticketPrice != '' ) { $return = 'Tickets: ' . $show->ticketPrice . ''; } elseif ( $display == 'on' && $show->ticketPrice != '' ) { $return = 'Tickets: ' . $show->ticketPrice . ''; } else { $return = ''; } // End of ticket and ticketurl return $return; } // End of get_tix() /** * Formats the venue line * * If the venueURL is not empty, the name of the venue becomes a link to the venue's site, otherwise * just the venue name is displayed. * * @since 0.4 * * @params array $params Includes data: css, $show Object * * @return mixed $return Formatted venue line */ function get_venue( $css, $show, $widget = '' ) { if ( $show->venueURI != '' || $widget == 'yes' && $show->venueURI != '' ) { $return = '' . $show->venueName . ''; } elseif( $show->venueURI == '' || $widget == 'yes' && $show->venueURI == '' ) { $return = '' . $show->venueName . ''; } else { $return = 'blag'; } // End of $venueurl check return $return; } // End of get_venue() /* ========================================================================== Layouts ========================================================================== */ /** * Displays the ArtistData XML feed for use on a page * * Gets all the plugins options, gets the XML data as an array, * then outputs an HTML table based on the user-selected options. * * @since 0.4 * * @params mixed $params Includes data: limit, source * * Limit is for only showing x-many on the layout options page * * Source is for specifying that the request is from the layout options page * * @return mixed $output HTML-formatted table showing shows from an ArtistData feed */ function classic_layout( $params ) { if( !empty( $params ) ) { extract( $params ); } extract( get_option( 'slushman_adp_general_settings' ) ); $adp = new ArtistDataPress_plugin(); $feed = $adp->get_xml(); $showfeed = ( $feed[0] == 'Error' && $source == 'layout' || $feed == FALSE && $source == 'layout' ? $this->get_example_data() : $feed ); $maxshows = ( !empty( $limit ) ? $limit : $max_shows ); ?>