Skip to content

Commit

Permalink
Merge pull request #50 from moderntribe/release/G20.04
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark authored Apr 28, 2020
2 parents 95362fe + 79893ed commit 81b808f
Show file tree
Hide file tree
Showing 8 changed files with 469 additions and 336 deletions.
10 changes: 6 additions & 4 deletions admin/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
global $gp_db;
$gp_db = array();

// Note that the following columns are deprectated as of DB version 1.4,
// but cannot be dropped due to the neccessities of the upgrade process:
// Note that the following columns are deprecated as of DB version 1.4,
// but cannot be dropped due to the necessities of the upgrade process:
// show_address, show_locale, show_country, show_venue, show_venue_url, show_venue_phone

$gp_db[] = "CREATE TABLE " . GIGPRESS_SHOWS . " (
Expand Down Expand Up @@ -98,6 +98,8 @@
'disable_js' => 0,
'display_subscriptions' => 1,
'display_country' => 1,
'export_link_google' => 1,
'export_link_ical' => 1,
'external_link_label' => 'More information',
'load_jquery' => 1,
'nopast' => 'No shows in the archive yet.',
Expand Down Expand Up @@ -314,7 +316,7 @@ function gigpress_db_upgrade_160() {
}
}

// Try our darndest to extract states from cities and put them in their own column
// Try our hardest to extract states from cities and put them in their own column
$venues = $wpdb->get_results(
"SELECT * FROM " . GIGPRESS_VENUES
);
Expand Down Expand Up @@ -346,4 +348,4 @@ function gigpress_uninstall() {
. GIGPRESS_VENUES . ', '
. GIGPRESS_ARTISTS);

}
}
2 changes: 1 addition & 1 deletion admin/handlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ function gigpress_undo($type) {
$show_ids = explode(',', $_REQUEST['show_id']);

if(count($show_ids) > 1) {
// We're restoring multiple shows, so we santiize each show_id individually
// We're restoring multiple shows, so we sanitize each show_id individually
$shows = array();
foreach($show_ids as $show) {
$shows[] = $wpdb->prepare('%d', $show);
Expand Down
16 changes: 13 additions & 3 deletions admin/new.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,18 @@ function gigpress_add() {

$related_posts_sql .= " ORDER BY p.post_date DESC LIMIT 500";

$entries = $wpdb->get_results($related_posts_sql, ARRAY_A);
if($entries != FALSE) {
$entries = $wpdb->get_results( $related_posts_sql, ARRAY_A );

/**
* Provides an opportunity to specify in details what's available as related posts.
*
* @since 2.3.24
*
* @param array $entries List of entries.
*/
$entries = (array) apply_filters( 'gigpress_related_post_entries', $entries );

if ( $entries !== false ) {
foreach($entries as $entry) { ?>
<option value="<?php echo $entry['ID']; ?>"<?php if(isset($show_related) && $entry['ID'] == $show_related) { echo(' selected="selected"'); $found_related = TRUE; } ?>><?php echo gigpress_db_out($entry['post_title']); ?></option>
<?php }
Expand Down Expand Up @@ -625,4 +635,4 @@ function gigpress_add() {
</form>
</div>
<?php unset($result);
}
}
544 changes: 316 additions & 228 deletions admin/settings.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions gigpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: GigPress
* Plugin URI: http://m.tri.be/1aca
* Description: GigPress is a live performance listing and management plugin built for musicians and performers.
* Version: 2.3.23
* Version: 2.3.24
* Author: Modern Tribe, Inc.
* Author URI: https://tri.be
* Text Domain: gigpress
Expand Down Expand Up @@ -616,7 +616,7 @@ function gigpress_export() {
if ( $shows) {
$export_shows = array();
foreach ( $shows as $show ) {
$show['show_time'] = ( $show['show_time']{7} == 1 ) ? '' : $show['show_time'];
$show['show_time'] = ( $show['show_time'][7] == 1 ) ? '' : $show['show_time'];
$show['show_expire'] = ( $show['show_date'] == $show['show_expire'] ) ? '' : $show['show_expire'];
$show['show_related_url'] = ( $show['show_related'] ) ? gigpress_related_link( $show['show_related'], 'url' ) : '';
$export_shows[] = $show;
Expand Down
21 changes: 14 additions & 7 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: ModernTribe, brianjessee, camwynsp, sc0ttkclark, aguseo, barry.hughes, bordoni, borkweb, brook-tribe, cliffpaulick, courane01, GeoffBel, geoffgraham, ggwicz, leahkoerper, neillmcshea, nicosantos, peterchester, reid.peifer, shane.pearlman, shelbelliott, tribecari, vicskf, zbtirrell
Tags: concerts, bands, tours, shows, record labels, music, musicians, performers, artists
Requires at least: 4.5
Tested up to: 5.1
Stable tag: 2.3.23
Tested up to: 5.4
Stable tag: 2.3.24

GigPress is a live performance listing and management plugin that's been serving musicians and performers since 2007.

Expand Down Expand Up @@ -36,6 +36,13 @@ If you want to go beyond GigPress, we also have other plugins that could work gr

== Changelog ==

= 2.3.24 [2020-04-22] =

* Fix - Clean up typos in readme and code comments. (props @passoniate) [GP-4]
* Fix - Resolve deprecated PHP notices in PHP 7.4 when accessing array offsets. (props @leecollings) [GP-3]
* Tweak - Added options to show / hide the Google Calendar and iCalendar export links [GP-2]
* Tweak - Added `gigpress_related_post_entries` filter to allow customizing the related post entries (props @thomasdebruin) [GP-5]

= 2.3.23 [2019-02-28] =

* Tweak - Update plugin header [90398]
Expand Down Expand Up @@ -304,7 +311,7 @@ If you want to go beyond GigPress, we also have other plugins that could work gr

* Added `$showdata['related_id']` to the list of available template variables, containing the ID of the show's related post
* Removed CDATA block from the title element of the GigPress RSS feed, as it was preventing character entities from being properly displayed in some readers
* Now assuming a "year" paremeter of "current" when only a "month" parameter is passed to the shortcode
* Now assuming a "year" parameter of "current" when only a "month" parameter is passed to the shortcode
* Added "past" and "all" as valid values for the "scope" argument to the `gigpress_sidebar()` function
* Corrected file name of the Swedish translation
* Small bug fix for the CSV import routine
Expand Down Expand Up @@ -341,7 +348,7 @@ If you want to go beyond GigPress, we also have other plugins that could work gr
* Overhauled the GigPress widget to use the new WordPress widget class for multiple-widget capability - **existing widgets will have their settings reset**
* Added options to restrict widget listing to a single artist, tour, or venue
* Made changes to the `gigpress_sidebar()` function to behave more like the `gigpress_shows()` function (arguments are now passed as an array, and the function must be echoed). **If you call `gigpress_sidebar()` from your template you must update your code - please see the docs for details**
* New template variables `$link` and `$show_feeds` for the *sidebar-list-footer* template - **update your customized template if neccessary** (see default template for example use)
* New template variables `$link` and `$show_feeds` for the *sidebar-list-footer* template - **update your customized template if necessary** (see default template for example use)
* New `[gigpress_menu]` shortcode/function for displaying a monthly or yearly dropdown menu independent of the `[gigpress_shows]` shortcode
* New `show_menu` parameter for `[gigpress_shows]` shortcode to display a monthly or yearly dropdown menu for filtering the shows specified by the shortcode
* New `year` and `month` parameters for `[gigpress_shows]` shortcode for filtering shows by date
Expand Down Expand Up @@ -446,7 +453,7 @@ If you want to go beyond GigPress, we also have other plugins that could work gr

* Fixed a typo in the database upgrade check that was leading to about 30 extra queries being performed on every page load throughout WordPress. Oops?
* Added the missing "notes" field to the show listings on Related Post entries and in the RSS feed
* Added an "Add a show" link to the WordPress 2.7 favourites menu
* Added an "Add a show" link to the WordPress 2.7 favorites menu
* Added a new shortcode parameter "limit" that will display only a chosen number of shows (only works when *not* segmenting by tour, or when used in conjunction with displaying a specific tour using the "tour" shortcode parameter)
* Added Bulgarian (thanks to Ivo Minchev) and Danish (thanks to Michael Tysk-Andersen) translations

Expand Down Expand Up @@ -512,7 +519,7 @@ If you want to go beyond GigPress, we also have other plugins that could work gr
* Add visual cues for required fields on the "Add a show" screen
* GigPress will now look for a style sheet called gigpress.css in your current theme folder in order to load custom styles
* More styling fixes for visual compatibility with WordPress 2.5
* Dropped official support for Wordpress 2.1.3
* Dropped official support for WordPress 2.1.3

= 1.2.7 =

Expand Down Expand Up @@ -553,7 +560,7 @@ If you want to go beyond GigPress, we also have other plugins that could work gr
* Fixed various issues in the countries list
* Display of the Country column can now be disabled
* Added element IDs to the header row of each tour in shows table (eg. #tour-2)
* Updated Options page to refelect new features
* Updated Options page to reflect new features
* Added a `<link>` element to each item in the RSS feed, linked to the page set on the options page

= 1.1.1 =
Expand Down
174 changes: 95 additions & 79 deletions templates/related.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

// STOP! DO NOT MODIFY THIS FILE!
// If you wish to customize the output, you can safely do so by COPYING this file
// into a new folder called 'gigpress-templates' in your 'wp-content' directory
Expand All @@ -17,94 +17,110 @@

?>

<?php if ($gpo['related_heading'] && $count == 1) : ?>
<h3 class="gigpress-related-heading"><?php echo wptexturize($gpo['related_heading']); ?></h3>
<?php if ( $gpo['related_heading'] && $count == 1 ) : ?>
<h3 class="gigpress-related-heading"><?php echo wptexturize( $gpo['related_heading'] ); ?></h3>
<?php endif; ?>

<ul class="gigpress-related-show <?php echo $showdata['status']; ?>">
<li>
<span class="gigpress-related-label"><?php echo wptexturize($gpo['artist_label']); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['artist']; ?></span>
</li>
<?php if($showdata['tour']) : ?>
<li>
<?php if($gpo['tour_label'] != '') : ?><span class="gigpress-related-label"><?php echo wptexturize($gpo['tour_label']); ?>:</span> <?php endif; ?>
<span class="gigpress-related-item"><?php echo $showdata['tour']; ?></span>
</li>
<?php endif; ?>
<li>
<span class="gigpress-related-label"><?php _e("Date", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['date']; ?><?php if($showdata['end_date']) : ?> - <?php echo $showdata['end_date']; ?><?php endif; ?>
<li>
<span class="gigpress-related-label"><?php echo wptexturize( $gpo['artist_label'] ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['artist']; ?></span>
</li>
<?php if ( $showdata['tour'] ) : ?>
<li>
<?php if ( $gpo['tour_label'] != '' ) : ?>
<span class="gigpress-related-label"><?php echo wptexturize( $gpo['tour_label'] ); ?>:</span> <?php endif; ?>
<span class="gigpress-related-item"><?php echo $showdata['tour']; ?></span>
</li>
<?php endif; ?>
<li>
<span class="gigpress-related-label"><?php _e( "Date", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['date']; ?><?php if ( $showdata['end_date'] ) : ?> - <?php echo $showdata['end_date']; ?><?php endif; ?>
</span>
</li>
<?php if($showdata['time']) : ?>
<li>
<span class="gigpress-related-label"><?php _e("Time", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['time']; ?></span>
</li>
<?php endif; ?>
<li>
<span class="gigpress-related-label"><?php _e("Venue", "gigpress"); ?>:</span>
<span class="gigpress-show-related"><?php echo $showdata['venue']; ?></span>
</li>
<li>
<span class="gigpress-related-label"><?php _e("City", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['city']; ?><?php if(!empty($showdata['state'])) : ?> , <?php echo $showdata['state']; ?><?php endif; ?>
</li>
<?php if ( $showdata['time'] ) : ?>
<li>
<span class="gigpress-related-label"><?php _e( "Time", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['time']; ?></span>
</li>
<?php endif; ?>

<li>
<span class="gigpress-related-label"><?php _e( "Venue", "gigpress" ); ?>:</span>
<span class="gigpress-show-related"><?php echo $showdata['venue']; ?></span>
</li>

<li>
<span class="gigpress-related-label"><?php _e( "City", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['city']; ?><?php if ( ! empty( $showdata['state'] ) ) : ?> , <?php echo $showdata['state']; ?><?php endif; ?>
</span>
</li>
<?php if($showdata['address']) : ?>
<li>
<span class="gigpress-related-label"><?php _e("Address", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['address']; ?></span>
</li>
</li>
<?php if ( $showdata['address'] ) : ?>
<li>
<span class="gigpress-related-label"><?php _e( "Address", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['address']; ?></span>
</li>
<?php endif; ?>
<?php if ( $showdata['venue_phone'] ) : ?>
<li>
<span class="gigpress-related-label"><?php _e( "Venue phone", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['venue_phone']; ?></span>
</li>
<?php endif; ?>
<?php if($showdata['venue_phone']) : ?>
<li>
<span class="gigpress-related-label"><?php _e("Venue phone", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['venue_phone']; ?></span>
</li>
<li>
<span class="gigpress-related-label"><?php _e( "Country", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['country']; ?></span>
</li>
<?php if ( $showdata['price'] ) : ?>
<li>
<span class="gigpress-related-label"><?php _e( "Admission", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['price']; ?></span>
</li>
<?php endif; ?>
<li>
<span class="gigpress-related-label"><?php _e("Country", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['country']; ?></span>
</li>
<?php if($showdata['price']) : ?>
<li>
<span class="gigpress-related-label"><?php _e("Admission", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['price']; ?></span>
</li>
<?php endif; ?>
<?php if($showdata['admittance']) : ?>
<li>
<span class="gigpress-related-label"><?php _e("Age restrictions", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['admittance']; ?></span>
</li>
<?php if ( $showdata['admittance'] ) : ?>
<li>
<span class="gigpress-related-label"><?php _e( "Age restrictions", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['admittance']; ?></span>
</li>
<?php endif; ?>
<?php if($showdata['ticket_phone']) : ?>
<li>
<span class="gigpress-related-label"><?php _e("Box office", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['ticket_phone']; ?></span>
</li>

<?php if ( $showdata['ticket_phone'] ) : ?>
<li>
<span class="gigpress-related-label"><?php _e( "Box office", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['ticket_phone']; ?></span>
</li>
<?php endif; ?>
<?php if($showdata['ticket_link']) : ?>
<li><?php echo $showdata['ticket_link']; ?></li>

<?php if ( $showdata['ticket_link'] ) : ?>
<li><?php echo $showdata['ticket_link']; ?></li>
<?php endif; ?>
<?php if($showdata['external_link']) : ?>
<li><?php echo $showdata['external_link']; ?></li>

<?php if ( $showdata['external_link'] ) : ?>
<li><?php echo $showdata['external_link']; ?></li>
<?php endif; ?>

<?php if($showdata['notes']) : ?>
<li>
<span class="gigpress-related-label"><?php _e("Notes", "gigpress"); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['notes']; ?></span>
</li>

<?php if ( $showdata['notes'] ) : ?>
<li>
<span class="gigpress-related-label"><?php _e( "Notes", "gigpress" ); ?>:</span>
<span class="gigpress-related-item"><?php echo $showdata['notes']; ?></span>
</li>
<?php endif;
// Show export links only when at least one of them is enabled
if ( ! empty( $gpo['export_link_google'] ) || ! empty( $gpo['export_link_ical'] ) ) :
?>
<li>
<?php
if ( ! empty( $gpo['export_link_google'] ) ) :
echo $showdata['gcal'];
endif;
// Show divider only if both export links are shown
if ( ! empty( $gpo['export_link_google'] ) && ! empty( $gpo['export_link_ical'] ) ) :
echo "|";
endif;
if ( ! empty( $gpo['export_link_ical'] ) ) :
echo $showdata['ical'];
endif;
?>
</li>
<?php endif; ?>
<li>
<?php echo $showdata['gcal']; ?> | <?php echo $showdata['ical']; ?>
</li>
</ul>
Loading

0 comments on commit 81b808f

Please sign in to comment.