. ************************************************************************** To-Do List * Get time and date jquery previews working * * http://core.trac.wordpress.org/browser/trunk/wp-admin/options-general.php - see add_js * Add additional layouts * Add additional layouts for widgets * Check out admin_notices: http://www.instantshift.com/2012/03/06/21-most-useful-wordpress-admin-page-hacks/ * Auto-blog a post the day of a show with the details of that show * Add support for feeds from Sonicbids and Reverbnation - any others? */ if ( !class_exists( "ArtistDataPress_Plugin" ) ) { //Start Class class ArtistDataPress_Plugin { public static $instance; private $settings_tabs = array(); function __construct() { self::$instance = $this; // Runs when plugin is activated register_activation_hook( __FILE__, array( $this, 'create_options' ) ); add_action( 'init', array( &$this, 'load_settings' ) ); // Queues the included stylesheet add_action( 'wp_enqueue_scripts', array( $this, 'add_styles' ) ); // Queues the layout stylesheets for the admin page add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ) ); // Adds the ArtistDataPress option menu to the Settings menu add_action( 'admin_menu', array( $this, 'add_menu' ) ); // Add "Settings" link to plugin page add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ) , array( $this, 'settings_link' ) ); // Create shortcode [artistdatapress] add_shortcode( 'artistdatapress', array( $this, 'shortcode' ) ); // Include other files add_action( 'init', array( $this, 'file_includer' ) ); // Options tabs add_action( 'admin_init', array( &$this, 'register_general_settings' ) ); add_action( 'admin_init', array( &$this, 'register_layout_settings' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'example_js' ) ); } // End of __construct() function create_options() { if ( get_option( 'slushman_adp_options' ) ) { $options = get_option( 'slushman_adp_options' ); $general['xml_url'] = $options['slushman_adp_xml_url']; $general['adpage_url'] = $options['slushman_adp_adpage_url']; $general['display_name'] = $options['slushman_adp_display_name']; $general['display_time'] = $options['slushman_adp_display_time']; $general['display_tickets'] = $options['slushman_adp_display_tickets']; $general['display_age'] = $options['slushman_adp_display_age']; $general['display_artist'] = $options['slushman_adp_display_artist']; $general['display_country'] = $options['slushman_adp_display_country']; $general['max_shows'] = $options['slushman_adp_max_shows']; $general['no_shows_msg'] = $options['slushman_adp_no_shows']; $general['display_stage'] = $general['adp_time_format'] = $general['adp_date_format'] = ''; $layout['adp_layout'] = 'Classic Style'; delete_option( 'slushman_adp_options' ); } else { $general['xml_url'] = $general['adpage_url'] = $general['display_name'] = $general['display_time'] = $general['display_tickets'] = $general['display_age'] = $general['display_artist'] = $general['display_country'] = $general['display_stage'] = $general['adp_time_format'] = $general['adp_date_format'] = $general['max_shows'] = ''; $general['no_shows_msg'] = 'There are no shows currently scheduled.'; $layout['adp_layout'] = 'Classic Style'; } // End of previous options check update_option( 'slushman_adp_general_settings', $general ); update_option( 'slushman_adp_layout_settings', $layout ); } // End of create_options() function load_settings() { $this->gensets = (array) get_option( 'slushman_adp_general_settings' ); $this->laysets = (array) get_option( 'slushman_adp_layout_settings' ); $genset['xml_url'] = $genset['adpage_url'] = $genset['display_name'] = $genset['display_time'] = $genset['display_tickets'] = $genset['display_age'] = $genset['display_artist'] = $genset['display_country'] = $genset['display_stage'] = $genset['adp_time_format'] = $genset['adp_date_format'] = $genset['max_shows'] = ''; $genset['no_shows_msg'] = 'There are no shows currently scheduled.'; $layset['adp_layout'] = 'Classic Style'; // Merge with defaults $this->gensets = array_merge( $genset, $this->gensets ); $this->laysets = array_merge( $layset, $this->laysets ); } // End of load_settings() // Options Page function add_menu() { add_options_page( 'ArtistDataPress Options', 'ArtistDataPress', 'manage_options', 'slushman-adp', array( $this, 'options_page' ) ); } // End of add_menu() function settings_link( $links ) { $slushman_adp_settings_link = sprintf( '%s', admin_url( 'options-general.php?page=slushman-adp' ), __( 'Settings' ) ); array_unshift( $links, $slushman_adp_settings_link ); return $links; } // End of settings_link() function options_page() { $obd = ini_get( 'open_basedir' ); $safe = ini_get( 'safe_mode' ); if ( $obd != '' || $safe == '1' ) { if ( $obd != '' ) { echo '
Your PHP settings are incompatible with ArtistDataPress. The PHP setting, open_basedir is currently ' . $odb . '. Please change the setting on your server to empty.
'; echo ''; } if ( $safe == '1' ) { echo 'Your PHP settings are incompatible with ArtistDataPress. PHP\'s Safe Mode is currently turned on, and it needs to be off. Please turn off Safe Mode on your server.
'; echo ''; } } else { $tab = ( isset( $_GET['tab'] ) ? $_GET['tab'] : 'slushman_adp_general_settings' ); ?>The ArtistData XML feed URL can be found on your ArtistData account by going to Tools > Data Feeds.
'; } // End of url_section() function xml_url_field() { ?> Choose what information you want displayed on your calendar.'; } function max_shows_field() { $max = ( empty( $this->gensets['max_shows'] ) ? 'All' : $this->gensets['max_shows'] ); ?> gensets['display_name'], 'on' ); ?> /> gensets['display_stage'], 'on' ); ?> /> gensets['display_artist'], 'on' ); ?> /> gensets['display_tickets'], 'on' ); ?> /> gensets['display_age'], 'on' ); ?> /> gensets['display_country'], 'on' ); ?> /> Choose how you want to format your times and dates.'; } function display_time_field() { ?> gensets['display_time'], 'on' ); ?> />
gensets['adp_time_format'] ); ?>
|
|
gensets['adp_date_format'] ); ?>
|
|
Please note: These settings do not apply to the iCal layout. |
| Please see the documentation on date and time formatting for additional formats.' ); ?> | ||
The %s field is either invalid or empty.
This %s is already used by another user.
The %s is not set.
Could not %s the %s.
%s %s successfully.
%s has already received credit for this seminar.
%s has been marked as enrolled.
This student is not currently registered for the seminar course.
%s
Attendance at %s for %s was added successfully.
%s updated, but %s did not.