Plugin Directory

Changeset 1124626


Ignore:
Timestamp:
03/31/2015 05:05:44 PM (11 years ago)
Author:
xmlteam
Message:
  • Added support for photos from Icon Sportswire
  • Added preview functionality for Sports Widgets
Location:
sportspost/trunk
Files:
16 added
10 edited

Legend:

Unmodified
Added
Removed
  • sportspost/trunk/admin/class-sportspost-admin.php

    r1085665 r1124626  
    44 * The admin-specific functionality of the plugin.
    55 *
    6  * @since      1.0.0
     6 * @since   1.0.0
    77 *
    88 * @package    SportsPost
     
    1414     * The ID of this plugin.
    1515     *
    16      * @since    1.0.0
     16     * @since 1.0.0
    1717     * @access   private
    1818     * @var      string    $plugin_name    The ID of this plugin.
     
    2323     * The version of this plugin.
    2424     *
    25      * @since    1.0.0
     25     * @since 1.0.0
    2626     * @access   private
    2727     * @var      string    $version    The current version of this plugin.
     
    3030
    3131    /**
    32      * The options of this plugin.
    33      *
    34      * @since    1.0.0
     32     * The settings of this plugin.
     33     *
     34     * @since 1.0.0
    3535     * @access   private
    36      * @var      array    $options    The options of this plugin.
    37      */
    38     private $options;
     36     * @var      array    $settings    The settings of this plugin.
     37     */
     38    private $settings;
    3939
    4040    /**
    4141     * The admin pointers of this plugin.
    4242     *
    43      * @since    1.0.0
     43     * @since 1.0.0
    4444     * @access   private
    45      * @var      array    $options    The admin pointers of this plugin.
     45     * @var      array    $pointers    The admin pointers of this plugin.
    4646     */
    4747    private $pointers;
     
    5050     * Initialize the class and set its properties.
    5151     *
    52      * @since    1.0.0
     52     * @since 1.0.0
    5353     * @var      string    $plugin_name       The name of this plugin.
    5454     * @var      string    $version    The version of this plugin.
     
    5858        $this->plugin_name = $plugin_name;
    5959        $this->version = $version;
    60         // Initialize plugin options
    61         $this->options = $this->get_default_options();
    62         $saved_options = get_option( 'sportspost_settings' );
    63         if ( is_array( $saved_options ) ) {
    64             $this->options = array_merge(
    65                 $this->options,
    66                 $saved_options
     60        // Initialize plugin settings
     61        $this->settings = $this->get_default_settings();
     62        $saved_settings = get_option( 'sportspost_settings' );
     63        if ( is_array( $saved_settings ) ) {
     64            $this->settings = array_merge(
     65                $this->settings,
     66                $saved_settings
    6767            );
    6868        }
     
    7272     * Get default settings.
    7373     *
    74      * @since    1.1.0
    75      */
    76     public function get_default_options() {
     74     * @since 1.1.0
     75     */
     76    public function get_default_settings() {
    7777        return array(
    7878            'default_sports_league' => 'mlb',
     
    8888            'id_suffix' => '',
    8989            'output_publishers' => 'sportsforecaster.com',     
    90             'sample_url' => ''         
    91         );
     90            'sample_url' => '',
     91            'content_api_url' => 'http://sportscaster.xmlteam.com/'         ,
     92            'content_api_username' => '',
     93            'content_api_password' => '',
     94            'sources_available' => array(),
     95            'show_connected' => 0
     96        );
     97    }
     98
     99    /**
     100     * Get current settings.
     101     *
     102     * @since 2.0.0
     103     */
     104    public function get_settings() {
     105        return $this->settings;
    92106    }
    93107
     
    95109     * Register the stylesheets for the Dashboard.
    96110     *
    97      * @since    1.0.0
     111     * @since 1.0.0
    98112     */
    99113    public function enqueue_styles() {
     
    104118     * Register the JavaScript for the dashboard.
    105119     *
    106      * @since    1.0.0
     120     * @since 1.0.0
    107121     */
    108122    public function enqueue_scripts() {
     
    118132                'api_endpoint' => SPORTSPOST_API_ENDPOINT,
    119133                'icon_url' => plugins_url( 'admin/img/icon-player.png', dirname( __FILE__ ) ),
    120                 'affiliate_reference_id' => $this->options['affiliate_reference_id'],
    121                 'link_prefix' => $this->options['link_prefix'],
    122                 'league_name_mlb' => $this->options['league_name_mlb'],
    123                 'league_name_nhl' => $this->options['league_name_nhl'],
    124                 'league_name_nfl' => $this->options['league_name_nfl'],
    125                 'league_name_nba' => $this->options['league_name_nba'],
    126                 'id_prefix' => $this->options['id_prefix'],
    127                 'id_suffix' => $this->options['id_suffix'],
    128                 'output_publishers' => $this->options['output_publishers'],
     134                'affiliate_reference_id' => $this->settings['affiliate_reference_id'],
     135                'link_prefix' => $this->settings['link_prefix'],
     136                'league_name_mlb' => $this->settings['league_name_mlb'],
     137                'league_name_nhl' => $this->settings['league_name_nhl'],
     138                'league_name_nfl' => $this->settings['league_name_nfl'],
     139                'league_name_nba' => $this->settings['league_name_nba'],
     140                'id_prefix' => $this->settings['id_prefix'],
     141                'id_suffix' => $this->settings['id_suffix'],
     142                'output_publishers' => $this->settings['output_publishers'],
    129143        ) );
    130144    }
     
    133147     * Register the JavaScript for the settings page.
    134148     *
    135      * @since    1.1.0
     149     * @since 1.1.0
    136150     */
    137151    public function enqueue_settings_scripts() {
     
    142156     * Add the settings page in the Settings menu.
    143157     *
    144      * @since    1.0.0
     158     * @since 1.0.0
    145159     */
    146160    public function add_settings_page() {
     
    151165     * Display the settings page in the menu API.
    152166     *
    153      * @since    1.0.0
     167     * @since 1.0.0
    154168     */
    155169    public function display_settings_page() {
     
    160174     * Initialize the settings API.
    161175     *
    162      * @since    1.0.0
     176     * @since 1.0.0
    163177     */
    164178    public function settings_init() {
     
    296310        );
    297311
     312        add_settings_section(
     313            'sportspost_settings_section_3', // Section ID
     314            '', // Section Title
     315            '', // Section Callback
     316            'sportspost_settings_page' // Page
     317        );
     318
     319        add_settings_field(
     320            'content_api_url', // Field ID
     321            __( 'SportsPost Widget base URL', 'sportspost' ), // Field Title
     322            array( $this, 'setting_text_callback_function' ), // Field Callback
     323            'sportspost_settings_page', // Page
     324            'sportspost_settings_section_3', // Section
     325            array(
     326                'id' => 'content_api_url',
     327                'size' => 50
     328            )
     329        );
     330
     331        add_settings_field(
     332            'content_api_username', // Field ID
     333            __( 'SportsPost Widget username', 'sportspost' ), // Field Title
     334            array( $this, 'setting_text_callback_function' ), // Field Callback
     335            'sportspost_settings_page', // Page
     336            'sportspost_settings_section_3', // Section
     337            array( 'id' => 'content_api_username' )
     338        );
     339
     340        add_settings_field(
     341            'content_api_password', // Field ID
     342            __( 'SportsPost Widget password', 'sportspost' ), // Field Title
     343            array( $this, 'setting_text_callback_function' ), // Field Callback
     344            'sportspost_settings_page', // Page
     345            'sportspost_settings_section_3', // Section
     346            array( 'id' => 'content_api_password' )
     347        );
     348
    298349        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
    299350           
    300351            add_settings_section(
    301                 'sportspost_settings_section_3', // Section ID
     352                'sportspost_settings_section_4', // Section ID
    302353                '', // Section Title
    303354                '', // Section Callback
     
    310361                array( $this, 'setting_checkbox_callback_function' ), // Field Callback
    311362                'sportspost_settings_page', // Page
    312                 'sportspost_settings_section_3', // Section
     363                'sportspost_settings_section_4', // Section
    313364                array(
    314365                    'id' => 'force_wizard',
     
    317368            );
    318369        }
     370       
     371        do_action( 'sportspost_settings' );
    319372
    320373        register_setting(
     
    328381     * Helper function for settings validation.
    329382     *
    330      * @since    1.1.0
     383     * @since 1.1.0
    331384     */
    332385    public function settings_validate( $input ) {
    333386        if ( ! empty( $input['reset'] ) ) {
    334             return $this->get_default_options();
     387            return $this->get_default_settings();
    335388        }
    336389        return $input;
     
    340393     * Helper function to display Sports League dropdown.
    341394     *
    342      * @since    1.0.0
     395     * @since 1.0.0
    343396     */
    344397    public function display_league_dropdown( $name, $id, $selected ) {
     
    354407     * Callback function for Default Sports League setting.
    355408     *
    356      * @since    1.0.0
     409     * @since 1.0.0
    357410     */
    358411    public function setting_default_sports_league_callback_function() {
    359         $this->display_league_dropdown( 'sportspost_settings[default_sports_league]', 'default_sports_league', $this->options['default_sports_league'] );
     412        $this->display_league_dropdown( 'sportspost_settings[default_sports_league]', 'default_sports_league', $this->settings['default_sports_league'] );
    360413    }
    361414
     
    363416     * Callback function for free text settings.
    364417     *
    365      * @since    1.1.0
     418     * @since 1.1.0
    366419     */
    367420    public function setting_text_callback_function( $args ) {
     
    371424            echo 'id="' . $args['id'] . '" ';
    372425            echo 'type="text" ';
    373             echo 'value="' . esc_attr( $this->options[ $args['id'] ] ) . '" ';
     426            echo 'value="' . esc_attr( $this->settings[ $args['id'] ] ) . '" ';
    374427            echo 'class="code" ';
    375428            if ( isset( $args['readonly'] ) && $args['readonly'] ) {
     
    386439     * Callback function for checkbox settings.
    387440     *
    388      * @since    1.1.0
     441     * @since 1.1.0
    389442     */
    390443    public function setting_checkbox_callback_function( $args ) {
    391444        if ( isset( $args['id'] ) ) {
    392             echo '<input name="sportspost_settings[' . $args['id'] . ']" id="' . $args['id'] . '" type="checkbox" value="1" ' . checked( $this->options[ $args['id'] ], 1, false ) . ' class="code" /> <label for="' . $args['id'] . '">' . $args['label'] . '</label>';
     445            echo '<input name="sportspost_settings[' . $args['id'] . ']" id="' . $args['id'] . '" type="checkbox" value="1" ' . checked( $this->settings[ $args['id'] ], 1, false ) . ' class="code" /> <label for="' . $args['id'] . '">' . $args['label'] . '</label>';
    393446        }
    394447    }
     
    397450     * Callback function for Default Sports League setting.
    398451     *
    399      * @since    1.1.0
     452     * @since 1.1.0
    400453     */
    401454    public function setting_output_publishers_callback_function( $args ) {
    402         $selected = $this->options['output_publishers'];
     455        $selected = $this->settings['output_publishers'];
    403456        echo '<select name="sportspost_settings[output_publishers]" id=output_publishers">';
    404457        echo '  <option value="sportsforecaster.com" ' . selected( $selected, 'sportsforecaster.com' ) . '>Sports Forecaster</option>';
     
    418471     * Add TinyMCE toolbar button.
    419472     *
    420      * @since    1.0.0
     473     * @since 1.0.0
    421474     * @var      array    $buttons       Array of TinyMCE buttons.
    422475     */
     
    429482     * Add TinyMCE external plugin.
    430483     *
    431      * @since    1.0.0
     484     * @since 1.0.0
    432485     * @var      array    $plugins       Array of TinyMCE plugins.
    433486     */
     
    451504     * Add Quicktags button.
    452505     *
    453      * @since    1.0.0
     506     * @since 1.0.0
    454507     */
    455508    public function add_quicktags_button() {
    456509?>
    457510    <script type="text/javascript">
    458     QTags.addButton( 'playerlink', 'player', function(){ window.sportsPostPlayerLink.open() }, '', '', 'Insert Player Link', 29 );
    459     </script>
     511        QTags.addButton( 'playerlink', 'player', function(){ window.sportsPostPlayerLink.open() }, '', '', 'Insert Player Link', 29 );
     512    </script>
    460513<?php
    461514    }
     
    464517     * Dialog for palyer links.
    465518     *
    466      * @since    1.0.0
     519     * @since 1.0.0
    467520     */
    468521    public function player_link_dialog() {
     
    474527     * Ajax handler for player linking.
    475528     *
    476      * @since    1.0.0
     529     * @since 1.0.0
    477530     */
    478531    public function player_link_ajax() {
    479532        check_ajax_referer( 'sportpost-player-linking', '_ajax_sportspost_player_link_nonce' );
    480        
    481         // Version A: Queries with multiple keys handled directly by sportscodes.org server
    482533        if ( ! empty( $_POST['league'] ) && ! empty( $_POST['search'] ) ) {
    483534            $url = SPORTSPOST_API_ENDPOINT . '?';
     
    499550     * Load admin pointer(s)
    500551     *
    501      * @since    1.0.0
     552     * @since 1.0.0
    502553     */
    503554    public function load_admin_pointers() {
     
    513564     * Register admin pointer(s)
    514565     *
    515      * @since    1.0.0
     566     * @since 1.0.0
    516567     * @var      mixed[] $pointers
    517568     */
     
    599650     * Remove dismissed admin pointer(s)
    600651     *
    601      * @since    1.0.0
     652     * @since 1.0.0
    602653     * @var      mixed[]  $pointers
    603654     */
    604655    public function filter_dismissed_admin_pointers( $pointers ) {
    605         if ( defined( 'WP_DEBUG' ) && WP_DEBUG && $this->options['force_wizard'] ) return $pointers;
     656        if ( defined( 'WP_DEBUG' ) && WP_DEBUG && $this->settings['force_wizard'] ) return $pointers;
    606657        $valid_pointers = array();
    607658        if ( is_array( $pointers ) ) {
     
    616667    }
    617668
     669    /**
     670     * Customize widget in Page Builder (SiteOrigin Panels)
     671     *
     672     * @since 1.2.0
     673     * @var      mixed[]  $widgets
     674     */
     675    public function siteorigin_panels_widgets( $widgets ) {
     676        if ( ! empty( $widgets['SportsPost_Content_Widget'] ) ) {
     677            $widgets['SportsPost_Content_Widget']['icon'] = 'sportspost-icon';
     678        }
     679        return $widgets;
     680    }
    618681}
  • sportspost/trunk/admin/css/sportspost-admin.css

    r1085665 r1124626  
    1 /* dashicon version
    2 i.mce-i-playerlink:before {
    3     font: normal 20px/1 'dashicons';
    4     content: '\f337';
    5 }
    6 */
     1/* Live Content Widget stuff */
     2
     3#available-widgets [class*="sportspost_content"] .widget-title:before,
     4.so-panels-dialog.so-panels-dialog-add-widget .widget-type-list .widget-type .sportspost-icon {
     5    content: "";
     6    background-image: url(../img/icon-player.png);
     7    background-size: 20px 20px;
     8}
     9
     10/* Player profile Links stuff */
    711
    812.quicktags-toolbar input[value="player"] {
  • sportspost/trunk/admin/partials/sportspost-admin-dialog.php

    r1042327 r1124626  
    11<?php
    2 
    32/**
    43 * The insert/edit player link dialog
    54 *
    6  * @since      1.0.0
     5 * @since   1.0.0
    76 *
    87 * @package    SportsPost
     
    109 */
    1110?>
    12 
    1311        <div id="sportspost-player-link-backdrop" style="display: none"></div>
    1412        <div id="sportspost-player-link-wrap" class="wp-core-ui<?php echo $search_panel_visible; ?>" style="display: none">
     
    3028                </div>
    3129                <div class="link-target">
    32                     <label><span>&nbsp;</span><input type="checkbox" id="player-link-target-checkbox" <?php checked( $this->options['target_blank'], 1) ?> /> <?php _e( 'Open link in a new window/tab' ); ?></label>
     30                    <label><span>&nbsp;</span><input type="checkbox" id="player-link-target-checkbox" <?php checked( $this->settings['target_blank'], 1) ?> /> <?php _e( 'Open link in a new window/tab' ); ?></label>
    3331                </div>
    3432            </div>
     
    4139                    <label>
    4240                        <span class="search-label"><?php _e( 'League', 'sportspost' ); ?></span>
    43                         <?php $this->display_league_dropdown( 'league', 'player-league', $this->options['default_sports_league'] ); ?>
     41                        <?php $this->display_league_dropdown( 'league', 'player-league', $this->settings['default_sports_league'] ); ?>
    4442                    </label>
    4543                    <span class="spinner"></span>
  • sportspost/trunk/admin/partials/sportspost-admin-settings.php

    r1085665 r1124626  
    11<?php
    2 
    32/**
    43 * The settins page for the plugin
    54 *
    6  * @since      1.0.0
     5 * @since   1.0.0
    76 *
    87 * @package    SportsPost
  • sportspost/trunk/includes/class-sportspost-i18n.php

    r1042327 r1124626  
    77 * so that it is ready for translation.
    88 *
    9  * @since      1.0.0
     9 * @since   1.0.0
    1010 * @package    SportsPost
    1111 * @subpackage SportsPost/includes
     
    1616     * The domain specified for this plugin.
    1717     *
    18      * @since    1.0.0
     18     * @since 1.0.0
    1919     * @access   private
    2020     * @var      string    $domain    The domain identifier for this plugin.
     
    2525     * Load the plugin text domain for translation.
    2626     *
    27      * @since    1.0.0
     27     * @since 1.0.0
    2828     */
    2929    public function load_plugin_textdomain() {
     
    4040     * Set the domain equal to that of the specified domain.
    4141     *
    42      * @since    1.0.0
     42     * @since 1.0.0
    4343     * @param    string    $domain    The domain that represents the locale of this plugin.
    4444     */
  • sportspost/trunk/includes/class-sportspost-loader.php

    r1042327 r1124626  
    1616     * The array of actions registered with WordPress.
    1717     *
    18      * @since    1.0.0
     18     * @since 1.0.0
    1919     * @access   protected
    2020     * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
     
    2525     * The array of filters registered with WordPress.
    2626     *
    27      * @since    1.0.0
     27     * @since 1.0.0
    2828     * @access   protected
    2929     * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
     
    3434     * Initialize the collections used to maintain the actions and filters.
    3535     *
    36      * @since    1.0.0
     36     * @since 1.0.0
    3737     */
    3838    public function __construct() {
     
    4444     * Add a new action to the collection to be registered with WordPress.
    4545     *
    46      * @since    1.0.0
     46     * @since 1.0.0
    4747     * @var      string               $hook             The name of the WordPress action that is being registered.
    4848     * @var      object               $component        A reference to the instance of the object on which the action is defined.
     
    5858     * Add a new filter to the collection to be registered with WordPress.
    5959     *
    60      * @since    1.0.0
     60     * @since 1.0.0
    6161     * @var      string               $hook             The name of the WordPress filter that is being registered.
    6262     * @var      object               $component        A reference to the instance of the object on which the filter is defined.
     
    7373     * collection.
    7474     *
    75      * @since    1.0.0
     75     * @since 1.0.0
    7676     * @access   private
    7777     * @var      array                $hooks            The collection of hooks that is being registered (that is, actions or filters).
     
    9797     * Register the filters and actions with WordPress.
    9898     *
    99      * @since    1.0.0
     99     * @since 1.0.0
    100100     */
    101101    public function run() {
  • sportspost/trunk/includes/class-sportspost.php

    r1085665 r1124626  
    1010 * version of the plugin.
    1111 *
    12  * @since      1.0.0
     12 * @since   1.0.0
    1313 * @package    SportsPost
    1414 * @subpackage SportsPost/includes
     
    2020     * the plugin.
    2121     *
    22      * @since    1.0.0
     22     * @since 1.0.0
    2323     * @access   protected
    2424     * @var      SportsPost_Loader    $loader    Maintains and registers all hooks for the plugin.
     
    2929     * The unique identifier of this plugin.
    3030     *
    31      * @since    1.0.0
     31     * @since 1.0.0
    3232     * @access   protected
    3333     * @var      string    $plugin_name    The string used to uniquely identify this plugin.
     
    3838     * The current version of the plugin.
    3939     *
    40      * @since    1.0.0
     40     * @since 1.0.0
    4141     * @access   protected
    4242     * @var      string    $version    The current version of the plugin.
     
    5050     * Load the dependencies, define the locale, and set the hooks for the Dashboard
    5151     *
    52      * @since    1.0.0
     52     * @since 1.0.0
    5353     */
    5454    public function __construct() {
    5555        $this->plugin_name = 'sportspost';
    56         $this->version = '1.1.0';
     56        $this->version = '2.0.0';
    5757        $this->load_dependencies();
     58        $this->loader = new SportsPost_Loader();
    5859        $this->set_locale();
    5960        $this->define_admin_hooks();
     61        $this->define_public_hooks();
    6062    }
    6163
     
    7274     * with WordPress.
    7375     *
    74      * @since    1.0.0
     76     * @since 1.0.0
    7577     * @access   private
    7678     */
     
    8789        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-sportspost-i18n.php';
    8890        /**
     91         * The class responsible for defining the widgets.
     92         */
     93        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-sportspost-content-widget.php';
     94        /**
     95         * The class responsible for defining all actions that occur in the public-facing
     96         * side of the site.
     97         */
     98        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-sportspost-public.php';
     99        /**
     100         * The class responsible for Photo integration integration.
     101         */
     102        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-sportspost-photos-module.php';
     103        /**
    89104         * The class responsible for defining all actions that occur in the Dashboard.
    90105         */
    91106        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-sportspost-admin.php';
    92         $this->loader = new SportsPost_Loader();
    93107    }
    94108
     
    99113     * with WordPress.
    100114     *
    101      * @since    1.0.0
     115     * @since 1.0.0
    102116     * @access   private
    103117     */
     
    112126     * of the plugin.
    113127     *
    114      * @since    1.0.0
     128     * @since 1.0.0
    115129     * @access   private
    116130     */
     
    118132        global $pagenow;
    119133        $plugin_admin = new SportsPost_Admin( $this->get_plugin_name(), $this->get_version() );
     134        $module_photo = new SportsPost_Photos_Module( $this->get_plugin_name(), $this->get_version(), $plugin_admin->get_settings() );
    120135        if ( in_array( $pagenow, array( 'post.php', 'post-new.php', 'widgets.php', 'customize.php', 'admin-ajax.php' ) ) ) {
    121136            $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
     
    128143            $this->loader->add_action( 'after_wp_tiny_mce', $plugin_admin, 'player_link_dialog' );
    129144            $this->loader->add_action( 'wp_ajax_sportspost-player-link-ajax', $plugin_admin, 'player_link_ajax' );
     145            $this->loader->add_action( 'siteorigin_panels_widgets', $plugin_admin, 'siteorigin_panels_widgets' );
    130146        }
    131147        if ( 'options-general.php' == $pagenow && isset( $_GET['page'] ) && 'sportspost_settings_page' == $_GET['page'] ) {
     
    135151        $this->loader->add_action( 'admin_init', $plugin_admin, 'settings_init' );
    136152        $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_settings_page' );
     153        // Photos integration
     154        $this->loader->add_action( 'admin_enqueue_scripts', $module_photo, 'enqueue_scripts' );
     155        $this->loader->add_action( 'admin_enqueue_scripts', $module_photo, 'enqueue_styles' );
     156        $this->loader->add_action( 'print_media_templates', $module_photo, 'print_media_templates', 99);
     157        $this->loader->add_filter( 'media_view_strings', $module_photo, 'custom_media_string', 10, 2);
     158        $this->loader->add_action( 'wp_ajax_sportspost_connect', $module_photo, 'connect_source' );
     159        $this->loader->add_action( 'wp_ajax_sportspost_disconnect', $module_photo, 'disconnect_source' );
     160        $this->loader->add_action( 'wp_ajax_sportspost_check', $module_photo, 'connect_check' );
     161        $this->loader->add_action( 'wp_ajax_sportspost_load_images', $module_photo, 'load_images' );
     162        $this->loader->add_action( 'wp_ajax_sportspost_param_choices', $module_photo, 'param_choices' );
     163        $this->loader->add_action( 'wp_ajax_sportspost_pre_insert', $module_photo, 'pre_insert' );
     164        $this->loader->add_action( 'wp_ajax_sportspost_user_preferences_save', $module_photo, 'user_preferences_save' );
     165        $this->loader->add_action( 'wp_ajax_sportspost_user_preferences_get', $module_photo, 'user_preferences_get' );
     166    }
     167
     168    /**
     169     * Register all of the hooks related to the public-facing functionality
     170     * of the plugin.
     171     *
     172     * @since 1.2.0
     173     * @access   private
     174     */
     175    private function define_public_hooks() {
     176        $plugin_public = new SportsPost_Public( $this->get_plugin_name(), $this->get_version() );
     177        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles', 20 );
     178        $this->loader->add_action( 'init', $plugin_public, 'init_widget', 1 );
     179        $this->loader->add_filter( 'template_include', $plugin_public, 'full_sport_template_include' );
     180        $this->loader->add_filter( 'the_posts', $plugin_public, 'full_sport_content_virtual_page' );
    137181    }
    138182
     
    140184     * Run the loader to execute all of the hooks with WordPress.
    141185     *
    142      * @since    1.0.0
     186     * @since 1.0.0
    143187     */
    144188    public function run() {
     
    150194     * WordPress and to define internationalization functionality.
    151195     *
    152      * @since     1.0.0
     196     * @since  1.0.0
    153197     * @return    string    The name of the plugin.
    154198     */
     
    160204     * The reference to the class that orchestrates the hooks with the plugin.
    161205     *
    162      * @since     1.0.0
     206     * @since  1.0.0
    163207     * @return    SportsPost_Loader    Orchestrates the hooks of the plugin.
    164208     */
     
    170214     * Retrieve the version number of the plugin.
    171215     *
    172      * @since     1.0.0
     216     * @since  1.0.0
    173217     * @return    string    The version number of the plugin.
    174218     */
  • sportspost/trunk/readme.txt

    r1085665 r1124626  
    55Requires at least: 4.0
    66Tested up to: 4.1
    7 Stable tag: 1.1.0
     7Stable tag: 2.0.0
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1515Enhance your sports posts with rich, detailed metadata about games, teams, and players, and with live game photos.
    1616
    17 SportsPost 1.0 allows bloggers to search for player names of athletes in major North American sports leagues, and drop their names directly into their post. These names can then hyperlink to externally hosted Player Profile pages, with expanded news, statistics, and photos of those players.
     17SportsPost 2.0 allows WordPress editors to search for player names of athletes in major North American sports leagues, and drop their names directly into their post. These names can then hyperlink to externally hosted Player Profile pages, with expanded news, statistics, and photos of those players.
    1818
    1919Bloggers can also optionally register at http://SportsForecaster.com/affiliates to generate advertising revenue from their links.
    2020
    21 Future versions will allow bloggers to:
     21SportsPost 2.0 also allows editors to search or browse the over 3 million sports photos from Icon Sportswire -- a leading sports photo wire service. Selected photos can be inserted directly into any post -- without leaving WordPress. Photos can also be imported into WordPress's Media Library.
    2222
    23 * Search, download, and include live, editorially licensed sports photos taken from recent sporting events
    24 * Identify their posts as being Game Previews or Game Recaps for particular sporting events, and include in the metadata of those posts the unique Game ID
     23Photos are for editorial usage only, and editors must register at IconSportswire.com for an account and login credentials. Photos can licensed using prepaid Credits (no long-term contract necessary), or can be downloaded as part of a monthly subscription package.
     24
     25SportsPost 2.0 also includes "preview functionality" that allows WordPress administrators to add Sports Widgets from XML Team onto designated locations of any page. Our forthcoming 3.0 release will make it easy to select widgets and drop them in place. Visit the "Support" tab and drop us a message if you'd like more details.
     26
     27Future versions will allow editors to:
     28
     29* Select Sports Widgets that will automatically update your website with current sports coverage.
     30* Identify posts as being Game Previews or Game Recaps for particular sporting events, and then automatically include supplemental game information.
    2531
    2632== Installation ==
     
    3642== Frequently Asked Questions ==
    3743
    38 None at the moment.
     44Q) Is SportsPost free to use?
     45
     46A) Inserting links to player profiles is free. Inserting photos requires opening an account at IconSportswire.com, and charges do apply there. (After all, we're paying professional and credentialed photographers for the use of their photos.) Our forthcoming Sports Widgets feature will include both free and premium options.
     47
     48Q) Can SportsPost make me money?
     49
     50A) Yes! Just register for an Affiliate ID over at http://SportsForecaster.com/affiliates and you'll generate ad revenue directly into your own Google AdSense account.
     51
     52Q) Are there any photo usage limitations?
     53
     54A) Yes. Photos are for editorial use only. For example, this means you cannot download a photo of your favorite athlete, and then write a post stating that this athlete endorses products or services that you sell.
     55
     56Q) Can I edit the captions and alternate-text that come with the photos?
     57
     58A) Yes, absolutely. But you must maintain the photo credit, which includes the photographer name, and also lists "Icon Sportswire" as the supplier of the photo.
    3959
    4060== Screenshots ==
     
    44643. "Insert/Edit Player Link" button in text editor toolbar
    45654. Settings page
     665. Browse photos from Icon Sportswire. Choose the league, and see photos organized by game.
     676. Search photos by typing in keywords
     687. Photos get loaded into WordPress's Media Library, and can be resized and aligned as per all WordPress photos.
    4669
    4770== Changelog ==
     71
     72= 2.0.0 =
     73* Added support for photos from Icon Sportswire
     74* Added preview functionality for Sports Widgets
    4875
    4976= 1.1.0 =
  • sportspost/trunk/sportspost.php

    r1085665 r1124626  
    1414 * Plugin URI:        https://wordpress.org/plugins/sportspost/
    1515 * Description:       Enhance your sports posts with rich, detailed metadata about games, teams, and players.
    16  * Version:           1.1.0
     16 * Version:           2.0.0
    1717 * Author:            XML Team Solutions
    1818 * Author URI:        http://xmlteam.com/
     
    4747 * not affect the page life cycle.
    4848 *
    49  * @since    1.0.0
     49 * @since 1.0.0
    5050 */
    5151function run_sportspost() {
  • sportspost/trunk/uninstall.php

    r1042327 r1124626  
    44 * Fired when the plugin is uninstalled.
    55 *
    6  * @since      1.0.0
     6 * @since   1.0.0
    77 *
    88 * @package    SportsPost
Note: See TracChangeset for help on using the changeset viewer.