Plugin Directory

Changeset 2075257


Ignore:
Timestamp:
04/26/2019 10:12:49 AM (7 years ago)
Author:
ajency
Message:

Bug fixes

Location:
event-codes
Files:
8 edited
14 copied

Legend:

Unmodified
Added
Removed
  • event-codes/tags/1.0.5/event-codes.php

    r2075182 r2075257  
    1616 * Plugin URI:        http://wpdwarves.com/event-codes-shortcodes-that-work-with-other-event-plugins
    1717 * Description:       EventCodes plugin provides a shortcode that can be used to display a list of events on home page, sidebar or any other part of the site.
    18  * Version:           1.0.4
     18 * Version:           1.0.5
    1919 * Author:            WPdwarves
    2020 * Author URI:        http://wpdwarves.com
  • event-codes/tags/1.0.5/events/class-event-codes-shortcode-helper.php

    r2075179 r2075257  
    6060       
    6161        ob_start();
    62         include $this->ec_locate_template($template_name, $template_path, $default_path);
     62        include ec_locate_template($template_name, $template_path, $default_path);
    6363        return ob_get_clean();
    6464    }
     
    6767        $shortcode_id = uniqid();
    6868        $template_name = $atts['view'] . '-view.php';
    69         $template_path = 'event-codes/events/views/' . $atts['template'] . '/';
    70         $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/' . $atts['template'] . '/';
    7169       
    7270        ob_start();       
    73         include $this->ec_locate_template($template_name, $template_path, $default_path);
     71        include ec_locate_template($template_name, '', '', $atts);
    7472        return ob_get_clean();
    7573    }
     
    7775    function _return_load_more_events_markup_and_data($event_data,$atts) {
    7876        $template_name = $atts['view'] . '-view-item.php';
    79         $template_path = 'event-codes/events/views/' . $atts['template'] . '/';
    80         $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/' . $atts['template'] . '/';
    8177     
    8278        ob_start();       
    8379        foreach ($event_data->events as $event) {
    84             include $this->ec_locate_template($template_name, $template_path, $default_path);
     80            include ec_locate_template($template_name, '', '', $atts);
    8581        }
    8682        return ob_get_clean();
     
    9692        return 'Event_Codes_Datasource_'.ucfirst($code_name);
    9793    }
    98    
    99    
    100     function ec_locate_template( $template_name, $template_path = '', $default_path = '' ) {
    101 
    102       // Set variable to search in the templates folder of theme.
    103       if ( ! $template_path ) :
    104         $template_path = 'event-codes/';
    105       endif;
    106 
    107       // Set default plugin templates path.
    108       if ( ! $default_path ) :
    109         $default_path = plugin_dir_path( __FILE__ ); // Path to the template folder
    110       endif;
    111 
    112       // Search template file in theme folder.
    113       $template = locate_template( array(
    114         $template_path . $template_name,
    115         $template_name
    116       ));         
    117 
    118       // Get plugins template file.
    119       if ( ! $template ) :
    120         $template = $default_path . $template_name;
    121       endif;
    122 
    123       return apply_filters( 'ec_locate_template', $template, $template_name, $template_path, $default_path );
    124     }
    12594   
    12695}
  • event-codes/tags/1.0.5/events/views/bootstrap/list-view.php

    r2075179 r2075257  
    2828    $atts['style'] = 'complete';
    2929}
     30
     31$template_name = 'list-view-item.php';
    3032?>
    3133<div class="aj">
     
    3335    <div id="data-<?php echo $shortcode_id; ?>" class="aj-list aj-list--<?php echo $atts['style']; ?> <?php echo $atts['description'] ? 'aj--hasdesc':'' ?> <?php echo $atts['showtime'] ? 'aj--hastime':'' ?> aj--hasprice">
    3436        <?php foreach($event_data->events as $event) : ?>
    35             <?php include(dirname( __FILE__ )  . '/list-view-item.php' ); ?>
     37            <?php include ec_locate_template($template_name, '', '', $atts); ?>
    3638        <?php endforeach; ?>
    3739    </div>
  • event-codes/tags/1.0.5/events/views/bootstrap/tabular-view.php

    r2075179 r2075257  
    77    die;
    88}
     9
     10$template_name = 'tabular-view-item.php';
    911?>
    1012<!--
     
    2931        </div>
    3032        <?php foreach($event_data->events as $event) : ?>
    31             <?php include(dirname( __FILE__ )  . '/tabular-view-item.php' ); ?>
     33            <?php include ec_locate_template($template_name, '', '', $atts); ?>
    3234        <?php endforeach; ?>
    3335    </div>
  • event-codes/tags/1.0.5/events/views/normal/list-view.php

    r2075179 r2075257  
    2828    $atts['style'] = 'complete';
    2929}
     30
     31$template_name = 'list-view-item.php';
    3032?>
    3133<div class="aj">
     
    3335    <div id="data-<?php echo $shortcode_id; ?>" class="aj-list aj-list--<?php echo $atts['style']; ?> <?php echo $atts['description'] ? 'aj--hasdesc':'' ?> <?php echo $atts['showtime'] ? 'aj--hastime':'' ?> aj--hasprice">
    3436        <?php foreach($event_data->events as $event) : ?>
    35             <?php include(dirname( __FILE__ )  . '/list-view-item.php' ); ?>
     37            <?php include ec_locate_template($template_name, '', '', $atts); ?>
    3638        <?php endforeach; ?>
    3739    </div>
  • event-codes/tags/1.0.5/events/views/normal/tabular-view.php

    r2075179 r2075257  
    77    die;
    88}
     9
     10$template_name = 'tabular-view-item.php';
    911?>
    1012<!--
     
    2931        </div>
    3032        <?php foreach($event_data->events as $event) : ?>
    31             <?php include(dirname( __FILE__ )  . '/tabular-view-item.php' ); ?>
     33            <?php include ec_locate_template($template_name, '', '', $atts); ?>
    3234        <?php endforeach; ?>
    3335    </div>
  • event-codes/tags/1.0.5/includes/class-event-codes.php

    r2075182 r2075257  
    6969
    7070        $this->plugin_name = 'event-codes';
    71         $this->version = '1.0.4';
     71        $this->version = '1.0.5';
    7272
    7373        $this->load_dependencies();
     
    112112
    113113        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-event-codes-common.php';
     114        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/event-codes-global.php';
    114115
    115116        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-event-codes-admin.php';
  • event-codes/tags/1.0.5/readme.txt

    r2075179 r2075257  
    44Requires at least: 4.1
    55Tested up to: 5.1
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.5
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    188188== Changelog ==
    189189
     190= 1.0.5 =
     191* Feature - bug fixes
     192
    190193= 1.0.4 =
    191194* Feature - added custom template support
  • event-codes/trunk/event-codes.php

    r2075182 r2075257  
    1616 * Plugin URI:        http://wpdwarves.com/event-codes-shortcodes-that-work-with-other-event-plugins
    1717 * Description:       EventCodes plugin provides a shortcode that can be used to display a list of events on home page, sidebar or any other part of the site.
    18  * Version:           1.0.4
     18 * Version:           1.0.5
    1919 * Author:            WPdwarves
    2020 * Author URI:        http://wpdwarves.com
  • event-codes/trunk/events/class-event-codes-shortcode-helper.php

    r2075179 r2075257  
    6060       
    6161        ob_start();
    62         include $this->ec_locate_template($template_name, $template_path, $default_path);
     62        include ec_locate_template($template_name, $template_path, $default_path);
    6363        return ob_get_clean();
    6464    }
     
    6767        $shortcode_id = uniqid();
    6868        $template_name = $atts['view'] . '-view.php';
    69         $template_path = 'event-codes/events/views/' . $atts['template'] . '/';
    70         $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/' . $atts['template'] . '/';
    7169       
    7270        ob_start();       
    73         include $this->ec_locate_template($template_name, $template_path, $default_path);
     71        include ec_locate_template($template_name, '', '', $atts);
    7472        return ob_get_clean();
    7573    }
     
    7775    function _return_load_more_events_markup_and_data($event_data,$atts) {
    7876        $template_name = $atts['view'] . '-view-item.php';
    79         $template_path = 'event-codes/events/views/' . $atts['template'] . '/';
    80         $default_path = plugin_dir_path(dirname(__FILE__)).'events/views/' . $atts['template'] . '/';
    8177     
    8278        ob_start();       
    8379        foreach ($event_data->events as $event) {
    84             include $this->ec_locate_template($template_name, $template_path, $default_path);
     80            include ec_locate_template($template_name, '', '', $atts);
    8581        }
    8682        return ob_get_clean();
     
    9692        return 'Event_Codes_Datasource_'.ucfirst($code_name);
    9793    }
    98    
    99    
    100     function ec_locate_template( $template_name, $template_path = '', $default_path = '' ) {
    101 
    102       // Set variable to search in the templates folder of theme.
    103       if ( ! $template_path ) :
    104         $template_path = 'event-codes/';
    105       endif;
    106 
    107       // Set default plugin templates path.
    108       if ( ! $default_path ) :
    109         $default_path = plugin_dir_path( __FILE__ ); // Path to the template folder
    110       endif;
    111 
    112       // Search template file in theme folder.
    113       $template = locate_template( array(
    114         $template_path . $template_name,
    115         $template_name
    116       ));         
    117 
    118       // Get plugins template file.
    119       if ( ! $template ) :
    120         $template = $default_path . $template_name;
    121       endif;
    122 
    123       return apply_filters( 'ec_locate_template', $template, $template_name, $template_path, $default_path );
    124     }
    12594   
    12695}
  • event-codes/trunk/events/views/bootstrap/list-view.php

    r2075179 r2075257  
    2828    $atts['style'] = 'complete';
    2929}
     30
     31$template_name = 'list-view-item.php';
    3032?>
    3133<div class="aj">
     
    3335    <div id="data-<?php echo $shortcode_id; ?>" class="aj-list aj-list--<?php echo $atts['style']; ?> <?php echo $atts['description'] ? 'aj--hasdesc':'' ?> <?php echo $atts['showtime'] ? 'aj--hastime':'' ?> aj--hasprice">
    3436        <?php foreach($event_data->events as $event) : ?>
    35             <?php include(dirname( __FILE__ )  . '/list-view-item.php' ); ?>
     37            <?php include ec_locate_template($template_name, '', '', $atts); ?>
    3638        <?php endforeach; ?>
    3739    </div>
  • event-codes/trunk/events/views/bootstrap/tabular-view.php

    r2075179 r2075257  
    77    die;
    88}
     9
     10$template_name = 'tabular-view-item.php';
    911?>
    1012<!--
     
    2931        </div>
    3032        <?php foreach($event_data->events as $event) : ?>
    31             <?php include(dirname( __FILE__ )  . '/tabular-view-item.php' ); ?>
     33            <?php include ec_locate_template($template_name, '', '', $atts); ?>
    3234        <?php endforeach; ?>
    3335    </div>
  • event-codes/trunk/events/views/normal/list-view.php

    r2075179 r2075257  
    2828    $atts['style'] = 'complete';
    2929}
     30
     31$template_name = 'list-view-item.php';
    3032?>
    3133<div class="aj">
     
    3335    <div id="data-<?php echo $shortcode_id; ?>" class="aj-list aj-list--<?php echo $atts['style']; ?> <?php echo $atts['description'] ? 'aj--hasdesc':'' ?> <?php echo $atts['showtime'] ? 'aj--hastime':'' ?> aj--hasprice">
    3436        <?php foreach($event_data->events as $event) : ?>
    35             <?php include(dirname( __FILE__ )  . '/list-view-item.php' ); ?>
     37            <?php include ec_locate_template($template_name, '', '', $atts); ?>
    3638        <?php endforeach; ?>
    3739    </div>
  • event-codes/trunk/events/views/normal/tabular-view.php

    r2075179 r2075257  
    77    die;
    88}
     9
     10$template_name = 'tabular-view-item.php';
    911?>
    1012<!--
     
    2931        </div>
    3032        <?php foreach($event_data->events as $event) : ?>
    31             <?php include(dirname( __FILE__ )  . '/tabular-view-item.php' ); ?>
     33            <?php include ec_locate_template($template_name, '', '', $atts); ?>
    3234        <?php endforeach; ?>
    3335    </div>
  • event-codes/trunk/includes/class-event-codes.php

    r2075182 r2075257  
    6969
    7070        $this->plugin_name = 'event-codes';
    71         $this->version = '1.0.4';
     71        $this->version = '1.0.5';
    7272
    7373        $this->load_dependencies();
     
    112112
    113113        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-event-codes-common.php';
     114        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/event-codes-global.php';
    114115
    115116        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-event-codes-admin.php';
  • event-codes/trunk/readme.txt

    r2075179 r2075257  
    44Requires at least: 4.1
    55Tested up to: 5.1
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.5
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    188188== Changelog ==
    189189
     190= 1.0.5 =
     191* Feature - bug fixes
     192
    190193= 1.0.4 =
    191194* Feature - added custom template support
Note: See TracChangeset for help on using the changeset viewer.