• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP eventorganiser_get_option函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中eventorganiser_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP eventorganiser_get_option函数的具体用法?PHP eventorganiser_get_option怎么用?PHP eventorganiser_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了eventorganiser_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: register

 /**
  * Registers the widget with the WordPress Widget API.
  *
  * @return void.
  */
 public static function register()
 {
     $supports = eventorganiser_get_option('supports');
     if (in_array('event-venue', $supports)) {
         register_widget(__CLASS__);
     }
 }
开发者ID:Borgoroth,项目名称:Event-Organiser,代码行数:12,代码来源:class-eo-widget-venues.php


示例2: page_scripts

 /**
  * Enqueues the page's scripts and styles, and localises them.
  */
 function page_scripts()
 {
     global $wp_locale;
     wp_enqueue_script('eo_calendar');
     //wp_enqueue_script( 'eo_event' );
     wp_localize_script('eo_event', 'EO_Ajax_Event', array('ajaxurl' => admin_url('admin-ajax.php'), 'startday' => intval(get_option('start_of_week')), 'format' => eventorganiser_php2jquerydate(eventorganiser_get_option('dateformat'))));
     wp_localize_script('eo_calendar', 'EO_Ajax', array('ajaxurl' => admin_url('admin-ajax.php'), 'startday' => intval(get_option('start_of_week')), 'format' => eventorganiser_php2jquerydate(eventorganiser_get_option('dateformat')), 'timeFormat' => get_current_screen()->get_option('eofc_time_format', 'value') ? 'h:mmtt' : 'HH:mm', 'perm_edit' => current_user_can('edit_events'), 'categories' => get_terms('event-category', array('hide_empty' => 0)), 'venues' => get_terms('event-venue', array('hide_empty' => 0)), 'locale' => array('isrtl' => $wp_locale->is_rtl(), 'monthNames' => array_values($wp_locale->month), 'monthAbbrev' => array_values($wp_locale->month_abbrev), 'dayNames' => array_values($wp_locale->weekday), 'dayAbbrev' => array_values($wp_locale->weekday_abbrev), 'today' => __('today', 'eventorganiser'), 'day' => __('day', 'eventorganiser'), 'week' => __('week', 'eventorganiser'), 'month' => __('month', 'eventorganiser'), 'gotodate' => __('go to date', 'eventorganiser'), 'cat' => __('View all categories', 'eventorganiser'), 'venue' => __('View all venues', 'eventorganiser'))));
 }
开发者ID:windyjonas,项目名称:fredrika,代码行数:11,代码来源:event-organiser-calendar.php


示例3: testOndateSlug

 public function testOndateSlug()
 {
     global $wp_rewrite;
     update_option('permalink_structure', '/%year%/%monthnum%/%day%/%postname%/');
     $options = eventorganiser_get_option(false);
     $options['url_on'] = 'events-on';
     update_option('eventorganiser_options', $options);
     eventorganiser_cpt_register();
     $GLOBALS['wp_rewrite']->init();
     flush_rewrite_rules();
     $this->go_to(eo_get_event_archive_link(2014, 03));
     $this->assertTrue(eo_is_event_archive('month'));
     $this->assertEquals('2014-03-01', eo_get_event_archive_date('Y-m-d'));
     $this->assertEquals('http://example.org/events/event/events-on/2014/03', eo_get_event_archive_link(2014, 03));
 }
开发者ID:Borgoroth,项目名称:Event-Organiser,代码行数:15,代码来源:templateTest.php


示例4: __construct

 public function __construct()
 {
     global $pagenow, $EO_Errors;
     if (!isset($EO_Errors)) {
         $EO_Errors = new WP_Error();
     }
     if (is_feed('eo-events') && eventorganiser_get_option('feed')) {
         $this->get_export_file();
     }
     //If importing / exporting events make sure we a logged in and check nonces.
     if (is_admin() && !empty($_POST['eventorganiser_download_events']) && check_admin_referer('eventorganiser_download_events') && current_user_can('manage_options')) {
         //Exporting events
         //mmm... maybe finally a legitimate use of query_posts
         query_posts(array('post_type' => 'event', 'showpastevents' => true, 'group_events_by' => 'series', 'posts_per_page' => -1));
         $this->get_export_file();
     } elseif (is_admin() && !empty($_POST['eventorganiser_import_events']) && check_admin_referer('eventorganiser_import_events') && current_user_can('manage_options')) {
         //Importing events
         //Perform checks on file:
         if (in_array($_FILES["ics"]["type"], array("text/calendar", "application/octet-stream")) && $_FILES["ics"]["size"] < 2097152) {
             if ($_FILES["ics"]["error"] > 0) {
                 $EO_Errors = new WP_Error('eo_error', sprintf(__("File Error encountered: %d", 'eventorganiser'), $_FILES["ics"]["error"]));
             } else {
                 //Import file
                 $this->import_file($_FILES['ics']['tmp_name']);
             }
         } elseif (!isset($_FILES) || empty($_FILES['ics']['name'])) {
             $EO_Errors = new WP_Error('eo_error', __("No file detected.", 'eventorganiser'));
         } else {
             $EO_Errors = new WP_Error('eo_error', __("Invalid file uploaded. The file must be a ics calendar file of type 'text/calendar', no larger than 2MB.", 'eventorganiser'));
             $size = size_format($_FILES["ics"]["size"], 2);
             $details = sprintf(__('File size: %s. File type: %s', 'eventorganiser'), $size, $_FILES["ics"]["type"]);
             $EO_Errors->add('eo_error', $details);
         }
     }
     add_action('eventorganiser_event_settings_imexport', array($this, 'get_im_export_markup'));
 }
开发者ID:Borgoroth,项目名称:Event-Organiser,代码行数:36,代码来源:class-event-organiser-im-export.php


示例5: eventorganiser_menu_link

/**
 * If a menu isn't being used the above won't work. They're using wp_list_pages, so the
 * best we can do is append a link to the end of the list.
 * Hooked onto wp_list_pages
 *
 * @ignore
 * @access private
 * @since 1.0
 */
function eventorganiser_menu_link($items)
{
    if (eventorganiser_get_option('addtomenu') != '1') {
        return $items;
    }
    $class = 'menu-item menu-item-type-event';
    if (is_post_type_archive('event') || is_singular('event') || eo_is_event_taxonomy()) {
        $class = 'current_page_item';
    }
    $items .= sprintf('<li class="%s"><a href="%s" > %s </a></li>', $class, get_post_type_archive_link('event'), esc_html(eventorganiser_get_option('navtitle')));
    return $items;
}
开发者ID:windyjonas,项目名称:fredrika,代码行数:21,代码来源:event-organiser-cpt.php


示例6: display

    function display()
    {
        $plugins = get_plugins();
        $plugin = $plugins['event-organiser/event-organiser.php'];
        ?>
		<div class="wrap">  
			
			<h2> <?php 
        esc_html_e('Event Organiser Extensions', 'eventorganiser');
        ?>
</h2>

			<div class="eo-addon-text">
				<?php 
        echo '<p>' . __('Event Organiser offers a range of extension which add additional features to the plug-in.', 'eventorganiser') . '</p>';
        $settings_link = esc_url(admin_url('options-general.php?page=event-settings'));
        ?>
				<label><input type="checkbox" id="eo-submenu-toggle" <?php 
        checked(eventorganiser_get_option('hide_addon_page'), 1);
        ?>
/>
					<small>Hide this page from the admin menu. You can still access it from <a href="<?php 
        echo $settings_link;
        ?>
"><em><small>Settings > Event Organiser</small></em></a>.</small> 
				</label>
			</div>

			<hr style="color:#CCC;background-color:#CCC;border:0;border-bottom:1px solid #CCC;">
			<?php 
        $addons = self::get_addons();
        if ($addons && !is_wp_error($addons)) {
            echo '<div id="eo-addons-wrap">';
            foreach ($addons as $addon) {
                if (!isset($addon['status']) || !in_array($addon['status'], array('available', 'coming-soon'))) {
                    continue;
                }
                self::print_addon($addon);
            }
            echo '</div>';
        } else {
            ?>
				<div class="error"><p>There was an error retrieving the add-on list from the server. Please try again later.</p></div>
				<?php 
        }
        ?>
			
			<div style="clear:both"></div>

			<p>
			<strong><a href="http://wp-event-organiser.com/extensions?aid=7"><?php 
        _e('Find out more &hellip;', 'eventorganiser');
        ?>
</a></strong>
			</p>
			
		</div><!-- .wrap -->
<?php 
    }
开发者ID:windyjonas,项目名称:fredrika,代码行数:59,代码来源:event-organiser-add-ons.php


示例7: eventorganiser_pre_get_posts

/**
 * Parses event queries and alters the WP_Query object appropriately
 *
 * Parse's the query, and sets date range and other event specific query variables.
 * If query is for 'event' post type - the posts_* filters are added.
 *
 * Hooked onto pre_get_posts
 * @since 1.0.0
 * @access private
 * @ignore
 *
 * @param WP_Query $query The query
 */
function eventorganiser_pre_get_posts($query)
{
    //Deprecated, use event-venue instead.
    if (!empty($query->query_vars['venue'])) {
        $venue = $query->get('venue');
        $query->set('event-venue', $venue);
        $query->set('post_type', 'event');
    }
    //If the query is for eo-events feed, set post type
    if ($query->is_feed('eo-events')) {
        $query->set('post_type', 'event');
    }
    //If querying for all events starting on given date, set the date parameters
    if (!empty($query->query_vars['ondate'])) {
        $ondate_start = str_replace('/', '-', $query->query_vars['ondate']);
        $ondate_end = str_replace('/', '-', $query->query_vars['ondate']);
        $parts = count(explode('-', $ondate_start));
        if ($parts == 1 && is_numeric($ondate_start)) {
            //Numeric - interpret as year
            $ondate_start .= '-01-01';
            $ondate_end .= '-12-31';
        } elseif ($parts == 2) {
            // 2012-01 format: interpret as month
            $ondate_start .= '-01';
            try {
                $end = new DateTime($ondate_start);
                $ondate_end = $end->format('Y-m-t');
            } catch (Exception $e) {
                $query->set('ondate', false);
                break;
            }
        }
        $query->set('post_type', 'event');
        $query->set('event_start_before', $ondate_end);
        $query->set('event_end_after', $ondate_start);
    }
    //If not on event, stop here.
    if (!eventorganiser_is_event_query($query, true)) {
        return $query;
    }
    $blog_now = new DateTime(null, eo_get_blog_timezone());
    //Determine whether or not to show past events and each occurrence. //If not set, use options
    if (!is_admin() && !is_single() && !$query->is_feed('eo-events') && !isset($query->query_vars['showpastevents'])) {
        //If showpastevents is not set - use options (except for admin / single pages.
        $query->set('showpastevents', eventorganiser_get_option('showpast'));
    }
    //Deprecated: showrepeats - use group_events_by instead
    if (isset($query->query_vars['showrepeats']) && !isset($query->query_vars['group_events_by'])) {
        if (!$query->query_vars['showrepeats']) {
            $query->set('group_events_by', 'series');
        }
    }
    //Determine how to group events: by series or show each occurrence
    if (!isset($query->query_vars['group_events_by'])) {
        //Group by isn't set - default depends on context:
        if ($query->is_main_query() && (is_admin() || is_single() || $query->is_feed('eo-events'))) {
            //If in admin or single page - we probably don't want to see duplicates of (recurrent) events - unless specified otherwise.
            $query->set('group_events_by', 'series');
        } elseif (eventorganiser_get_option('group_events') == 'series') {
            //In other instances (archives, shortcode listing) if showrepeats option is false display only the next event.
            $query->set('group_events_by', 'series');
        } else {
            $query->set('group_events_by', 'occurrence');
        }
    }
    //Parse user input as date-time objects
    $date_objs = array('event_start_after' => '', 'event_start_before' => '', 'event_end_after' => '', 'event_end_before' => '');
    foreach ($date_objs as $prop => $value) {
        $date = $query->get($prop);
        try {
            $date = empty($date) ? false : new DateTime($date, eo_get_blog_timezone());
        } catch (Exception $e) {
            $date = false;
        }
        $date_objs[$prop] = $date;
        $query->set($prop, $date);
    }
    //If eo_interval is set, determine date ranges
    if (!empty($query->query_vars['eo_interval'])) {
        switch ($query->get('eo_interval')) {
            case 'expired':
                $meta_query = (array) $query->get('meta_query');
                $meta_query[] = array('key' => '_eventorganiser_schedule_last_finish', 'value' => $blog_now->format('Y-m-d H:i:s'), 'compare' => '<=');
                $query->set('meta_query', $meta_query);
                break;
            case 'future':
                $meta_query = $query->get('meta_query');
//.........这里部分代码省略.........
开发者ID:windyjonas,项目名称:fredrika,代码行数:101,代码来源:event-organiser-archives.php


示例8: download_debug_info

 public function download_debug_info()
 {
     global $wpdb;
     $installed = get_plugins();
     $active_plugins = array();
     foreach ($installed as $plugin_slug => $plugin_data) {
         if (!is_plugin_active($plugin_slug)) {
             continue;
         }
         $active_plugins[] = $plugin_slug;
     }
     $theme = wp_get_theme();
     $db_tables = array();
     if ($this->db_tables) {
         foreach ($this->db_tables as $db_table) {
             if ($this->table_exists($db_table)) {
                 $db_table = "**" . $db_table . "**";
             }
             $db_tables[] = $db_table;
         }
     }
     $options = array();
     $options['event-organiser'] = eventorganiser_get_option(false);
     /**
      * Settings to include in an export.
      * 
      * These options are included in both the settings export on the settings
      * page and the also printed in the system information file. By default
      * they inlude Event Organiser's options, but others can be added.
      * 
      * The filtered value should be a (2+ dimensional) array, indexed by plugin/
      * extension name.
      * 
      * @param array $options Array of user settings, indexed by plug-in/extension.
      */
     $options = apply_filters('eventorganiser_export_settings', $options);
     $filename = 'event-organiser-system-info-' . get_bloginfo('name') . '.md';
     $filename = sanitize_file_name($filename);
     header("Content-type: text/plain");
     header('Content-disposition: attachment; filename=' . $filename);
     echo '## Event Organiser Sytem Informaton ##' . "\n";
     echo "\n";
     echo "\n";
     echo '### Site Information ###' . "\n";
     echo "\n";
     echo 'Site url' . "\t\t\t" . site_url() . "\n";
     echo 'Home url' . "\t\t\t" . home_url() . "\n";
     echo 'Multisite' . "\t\t\t" . (is_multisite() ? 'Yes' : 'No') . "\n";
     echo 'Permalink' . "\t\t\t" . get_option('permalink_structure') . "\n";
     echo "\n";
     echo "\n";
     echo '### Versions ###' . "\n";
     echo "\n";
     echo 'Event Organiser' . "\t\t" . EVENT_ORGANISER_VER . "\n";
     if ($this->jquery_version) {
         echo 'jQuery Version' . "\t\t" . $this->jquery_version . "\n";
     }
     echo 'WordPress' . "\t\t\t" . get_bloginfo('version') . "\n";
     echo 'PHP Version' . "\t\t\t" . PHP_VERSION . "\n";
     global $wpdb;
     $ver = empty($wpdb->use_mysqli) ? mysql_get_server_info() : mysqli_get_server_info($wpdb->dbh);
     echo 'MySQL Version' . "\t\t" . $ver . "\n";
     echo "\n";
     echo "\n";
     echo '### Server Information ###' . "\n";
     echo "\n";
     echo 'Web Server' . "\t\t\t" . $_SERVER['SERVER_SOFTWARE'] . "\n";
     echo 'PHP Memory Usage' . "\t" . $this->get_memory_usage('percent') . '%' . "\n";
     echo 'PHP Memory Limit' . "\t" . ini_get('memory_limit') . "\n";
     echo 'PHP Upload Max Size' . "\t" . ini_get('post_max_size') . "\n";
     echo 'PHP FSOCKOPEN support' . "\t" . (function_exists('fsockopen') ? 'Yes' : 'No') . "\n";
     echo 'PHP cURL support' . "\t" . (function_exists('curl_init') ? 'Yes' : 'No') . "\n";
     echo 'PHP openSSL support' . "\t" . (function_exists('openssl_verify') ? 'Yes' : 'No') . "\n";
     echo "\n";
     echo "\n";
     echo '### Plug-ins & Themes ###' . "\n";
     echo "\n";
     echo 'Active Plug-ins' . "\n\t-\t" . implode("\n\t-\t", $active_plugins) . "\n";
     echo 'Theme' . "\n\t-\t" . $theme->get('Name') . ' (' . $theme->get('Version') . ')' . "\n";
     echo "\n";
     echo "\n";
     echo '### Database ###' . "\n";
     echo "\n";
     echo "Database Prefix" . "\t\t\t" . $wpdb->prefix . "\n";
     echo "Database tables" . "\t\t\t" . implode(', ', $db_tables) . "\n";
     echo "Database character set" . "\t" . ($this->database_charset_check() ? DB_CHARSET : "**" . DB_CHARSET . "**") . "\n";
     echo "\n";
     echo "\n";
     echo '### Site Settings ###' . "\n";
     echo 'Timezone' . "\t\t\t" . eo_get_blog_timezone()->getName() . sprintf(' ( %s / %s ) ', get_option('gmt_offset'), get_option('timezone_string')) . "\n";
     echo 'WP Cron' . "\t\t\t" . ($this->get_cron_status() == 0 ? 'Disabled' : ($this->get_cron_status() == 1 ? 'Enabled' : 'Alternative ')) . "\n";
     echo 'WP Lang' . "\t\t\t" . (defined('WP_LANG') && WP_LANG ? WP_LANG : 'en_us') . "\n";
     echo 'Date format' . "\t\t" . get_option('date_format') . "\n";
     echo 'Time format' . "\t\t" . get_option('time_format');
     echo "\n";
     echo "\n";
     echo '### Event Organiser Settings ###' . "\n";
     foreach ($options['event-organiser'] as $option => $value) {
         if (is_array($value)) {
             $value = implode(', ', $value);
//.........这里部分代码省略.........
开发者ID:hmorv,项目名称:Event-Organiser,代码行数:101,代码来源:event-organiser-debug.php


示例9: _eventorganiser_details_metabox

/**
* Sets up the event data metabox
* This allows user to enter date / time, reoccurrence and venue data for the event
* @ignore
* @since 1.0.0
*/
function _eventorganiser_details_metabox($post)
{
    global $wp_locale;
    //Sets the format as php understands it, and textual.
    $phpFormat = eventorganiser_get_option('dateformat');
    if ('d-m-Y' == $phpFormat) {
        $format = 'dd-mm-yyyy';
        //Human form
    } elseif ('Y-m-d' == $phpFormat) {
        $format = 'yyyy-mm-dd';
        //Human form
    } else {
        $format = 'mm-dd-yyyy';
        //Human form
    }
    $is24 = eventorganiser_blog_is_24();
    $time_format = $is24 ? 'H:i' : 'g:ia';
    //Get the starting day of the week
    $start_day = intval(get_option('start_of_week'));
    $ical_days = array('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA');
    //Retrieve event details
    extract(eo_get_event_schedule($post->ID));
    $venues = eo_get_venues();
    $venue_id = (int) eo_get_venue($post->ID);
    //$sche_once is used to disable date editing unless the user specifically requests it.
    //But a new event might be recurring (via filter), and we don't want to 'lock' new events.
    //See http://wordpress.org/support/topic/wrong-default-in-input-element
    $sche_once = $schedule == 'once' || !empty(get_current_screen()->action);
    if (!$sche_once) {
        $notices = '<strong>' . __('This is a reoccurring event', 'eventorganiser') . '</strong>. ' . __('Check to edit this event and its reoccurrences', 'eventorganiser') . ' <input type="checkbox" id="HWSEvent_rec" name="eo_input[AlterRe]" value="yes">';
    } else {
        $notices = '';
    }
    //Start of meta box
    if ($notices = apply_filters('eventorganiser_event_metabox_notice', $notices, $post)) {
        echo '<div class="updated below-h2"><p>' . $notices . '</p></div>';
    }
    ?>
	<div class="<?php 
    echo $sche_once ? 'onetime' : 'reoccurence';
    ?>
">
		<p><?php 
    printf(__('Ensure dates are entered in %1$s format and times in %2$s (24 hour) format', 'eventorganiser'), '<strong>' . $format . '</strong>', ' <strong>hh:mm</strong>');
    ?>
 </p>

		<table id="eventorganiser_event_detail" class="form-table">
				<tr valign="top"  class="event-date">
					<td class="eo-label"><?php 
    echo __('Start Date/Time', 'eventorganiser') . ':';
    ?>
 </td>
					<td> 
						<input class="ui-widget-content ui-corner-all" name="eo_input[StartDate]" size="10" maxlength="10" id="from_date" <?php 
    disabled(!$sche_once);
    ?>
 value="<?php 
    echo $start->format($phpFormat);
    ?>
"/>
						<?php 
    printf('<input name="eo_input[StartTime]" class="eo_time ui-widget-content ui-corner-all" size="6" maxlength="8" id="HWSEvent_time" %s value="%s"/>', disabled(!$sche_once || $all_day, true, false), eo_format_datetime($start, $time_format));
    ?>
						

					</td>
				</tr>

				<tr valign="top"  class="event-date">
					<td class="eo-label"><?php 
    echo __('End Date/Time', 'eventorganiser') . ':';
    ?>
 </td>
					<td> 
						<input class="ui-widget-content ui-corner-all" name="eo_input[EndDate]" size="10" maxlength="10" id="to_date" <?php 
    disabled(!$sche_once);
    ?>
  value="<?php 
    echo $end->format($phpFormat);
    ?>
"/>
					
						<?php 
    printf('<input name="eo_input[FinishTime]" class="eo_time ui-widget-content ui-corner-all" size="6" maxlength="8" id="HWSEvent_time2" %s value="%s"/>', disabled(!$sche_once || $all_day, true, false), eo_format_datetime($end, $time_format));
    ?>
	

					<label>
					<input type="checkbox" id="eo_allday"  <?php 
    checked($all_day);
    ?>
 name="eo_input[allday]"  <?php 
    disabled(!$sche_once);
//.........这里部分代码省略.........
开发者ID:windyjonas,项目名称:fredrika,代码行数:101,代码来源:event-organiser-edit.php


示例10: eo_get_event_classes

/**
* Returns an array of classes associated with an event. Adds the following classes
* 
*  * `eo-event-venue-[venue slug]` - if the event has a venue
*  * `eo-event-cat-[category slug]` - for each event category the event belongs to. 
*  * `eo-event-[future|past|running]` - depending on occurrence
* 
* Applies filter {@see `eventorganiser_event_classes`} so you can add/remove classes.
* 
* @since 1.6
* @param int $post_id The event (post) ID. Uses current event if empty.
* @param int $occurrence_id The occurrence ID. Uses current event if empty.
* @return array Array of classes
*/
function eo_get_event_classes($post_id = 0, $occurrence_id = 0)
{
    global $post;
    $post_id = (int) (empty($post_id) ? get_the_ID() : $post_id);
    $occurrence_id = (int) (empty($occurrence_id) && isset($post->occurrence_id) ? $post->occurrence_id : $occurrence_id);
    $event_classes = array();
    //Add venue class
    if ($venue_slug = eo_get_venue_slug($post_id)) {
        $event_classes[] = 'eo-event-venue-' . $venue_slug;
    }
    //Add category classes
    $cats = get_the_terms($post_id, 'event-category');
    if ($cats && !is_wp_error($cats)) {
        foreach ($cats as $cat) {
            $event_classes[] = 'eo-event-cat-' . $cat->slug;
        }
    }
    //Event tags
    if (eventorganiser_get_option('eventtag')) {
        $terms = get_the_terms($post_id, 'event-tag');
        if ($terms && !is_wp_error($terms)) {
            foreach ($terms as $term) {
                $event_classes[] = 'eo-event-tag-' . $term->slug;
            }
        }
    }
    //Add 'time' class
    $start = eo_get_the_start(DATETIMEOBJ, $post_id, null, $occurrence_id);
    $end = eo_get_the_end(DATETIMEOBJ, $post_id, null, $occurrence_id);
    $now = new DateTime('now', eo_get_blog_timezone());
    if ($start > $now) {
        $event_classes[] = 'eo-event-future';
    } elseif ($end < $now) {
        $event_classes[] = 'eo-event-past';
    } else {
        $event_classes[] = 'eo-event-running';
    }
    //Add class if event starts and ends on different days
    if ($start instanceof DateTime && $end instanceof DateTime) {
        if ($start->format('Y-m-d') != $end->format('Y-m-d')) {
            $event_classes[] = 'eo-multi-day';
        }
    }
    if (eo_is_all_day($post_id)) {
        $event_classes[] = 'eo-all-day';
    }
    /**
     * Filters an array of classes for specified event (occurrence) 
     *
     * @param array $event_classes An array of class pertaining to this occurrence
     * @param int $post_id The ID of the event
     * @param into $occurrence_id The ID of the occurrence
     */
    $event_classes = apply_filters('eventorganiser_event_classes', $event_classes, $post_id, $occurrence_id);
    $event_classes = array_unique($event_classes);
    $event_classes = array_map('sanitize_html_class', $event_classes);
    $event_classes = array_filter($event_classes);
    return $event_classes;
}
开发者ID:Borgoroth,项目名称:Event-Organiser,代码行数:73,代码来源:event-organiser-event-functions.php


示例11: eventorganiser_add_admin_scripts

/**
 * Queues up the javascript / style scripts for Events custom page type 
 * Hooked onto admin_enqueue_scripts
 *
 * @since 1.0.0
 * @ignore
 * @access private
 */
function eventorganiser_add_admin_scripts($hook)
{
    global $post, $current_screen, $wp_locale;
    if ($hook == 'post-new.php' || $hook == 'post.php') {
        if ($post->post_type == 'event') {
            wp_enqueue_script('eo-edit-event-controller');
            wp_localize_script('eo_event', 'EO_Ajax_Event', array('ajaxurl' => admin_url('admin-ajax.php'), 'wpversion' => get_bloginfo('version'), 'startday' => intval(get_option('start_of_week')), 'format' => eventorganiser_php2jquerydate(eventorganiser_get_option('dateformat')), 'current_user_can' => array('manage_venues' => current_user_can('manage_venues')), 'is24hour' => eventorganiser_blog_is_24(), 'location' => get_option('timezone_string'), 'locale' => array('isrtl' => $wp_locale->is_rtl(), 'monthNames' => array_values($wp_locale->month), 'monthAbbrev' => array_values($wp_locale->month_abbrev), 'dayAbbrev' => array_values($wp_locale->weekday_abbrev), 'showDates' => __('Show dates', 'eventorganiser'), 'hideDates' => __('Hide dates', 'eventorganiser'), 'weekDay' => $wp_locale->weekday, 'meridian' => array($wp_locale->get_meridiem('am'), $wp_locale->get_meridiem('pm')), 'hour' => __('Hour', 'eventorganiser'), 'minute' => __('Minute', 'eventorganiser'), 'day' => __('day', 'eventorganiser'), 'days' => __('days', 'eventorganiser'), 'week' => __('week', 'eventorganiser'), 'weeks' => __('weeks', 'eventorganiser'), 'month' => __('month', 'eventorganiser'), 'months' => __('months', 'eventorganiser'), 'year' => __('year', 'eventorganiser'), 'years' => __('years', 'eventorganiser'), 'daySingle' => __('every day', 'eventorganiser'), 'dayPlural' => __('every %d days', 'eventorganiser'), 'weekSingle' => __('every week on', 'eventorganiser'), 'weekPlural' => __('every %d weeks on', 'eventorganiser'), 'monthSingle' => __('every month on the', 'eventorganiser'), 'monthPlural' => __('every %d months on the', 'eventorganiser'), 'yearSingle' => __('every year on the', 'eventorganiser'), 'yearPlural' => __('every %d years on the', 'eventorganiser'), 'summary' => __('This event will repeat', 'eventorganiser'), 'until' => __('until', 'eventorganiser'), 'occurrence' => array(__('first', 'eventorganiser'), __('second', 'eventorganiser'), __('third', 'eventorganiser'), __('fourth', 'eventorganiser'), __('last', 'eventorganiser')))));
            wp_enqueue_script('eo_venue');
            wp_enqueue_style('eventorganiser-style');
        }
    } elseif ($current_screen->id == 'edit-event') {
        wp_enqueue_style('eventorganiser-style');
    }
}
开发者ID:windyjonas,项目名称:fredrika,代码行数:22,代码来源:event-organiser-register.php


示例12: widget

    function widget($args, $instance)
    {
        global $wp_locale;
        wp_enqueue_script('eo_front');
        if (!eventorganiser_get_option('disable_css')) {
            wp_enqueue_style('eo_front');
        }
        extract($args, EXTR_SKIP);
        add_action('wp_footer', array(__CLASS__, 'add_options_to_script'));
        $id = esc_attr($args['widget_id']) . '_container';
        self::$agendas[$id] = array('id' => esc_attr($args['widget_id']), 'number' => $this->number, 'mode' => isset($instance['mode']) ? $instance['mode'] : 'day', 'add_to_google' => $instance['add_to_google']);
        //Echo widget
        echo $before_widget;
        $widget_title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
        if ($widget_title) {
            echo $before_title . esc_html($widget_title) . $after_title;
        }
        echo "<div style='width:100%' id='{$id}' class='eo-agenda-widget'>";
        ?>
	<div class='agenda-nav'>
		<span class="next button ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" role="button" title="">
			<span class="ui-button-icon-primary ui-icon ui-icon-carat-1-e"></span><span class="ui-button-text"></span>
		</span>
		<span class="prev button ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only" role="button" title="">
			<span class="ui-button-icon-primary ui-icon ui-icon-carat-1-w"></span><span class="ui-button-text"></span>
		</span>
	</div>
<?php 
        echo "<ul class='dates'>";
        echo '</ul>';
        //End dates
        echo "</div>";
        echo $after_widget;
    }
开发者ID:Borgoroth,项目名称:Event-Organiser,代码行数:34,代码来源:class-eo-agenda-widget.php


示例13: menu_option

    function menu_option()
    {
        $menus = get_terms('nav_menu');
        ?>
			<select  name="eventorganiser_options[addtomenu]">
				<option  <?php 
        selected(0, eventorganiser_get_option('addtomenu'));
        ?>
 value="0"><?php 
        _e('Do not add to menu', 'eventorganiser');
        ?>
 </option>
			<?php 
        foreach ($menus as $menu) {
            ?>
				<option  <?php 
            selected($menu->slug, eventorganiser_get_option('addtomenu'));
            ?>
 value="<?php 
            echo $menu->slug;
            ?>
"><?php 
            echo $menu->name;
            ?>
 </option>
			<?php 
        }
        ?>
				<option  <?php 
        selected(1, eventorganiser_get_option('addtomenu'));
        ?>
 value="1"><?php 
        _e('Page list (fallback)', 'eventorganiser');
        ?>
</option>
			</select>

			<?php 
        printf('<input type="hidden" name ="eventorganiser_options[menu_item_db_id]" value="%d" />', eventorganiser_get_option('menu_item_db_id'));
        ?>
			<?php 
        printf('<input type="text" name="eventorganiser_options[navtitle]" value="%s" />', eventorganiser_get_option('navtitle'));
    }
开发者ID:Borgoroth,项目名称:Event-Organiser,代码行数:43,代码来源:event-organiser-settings.php


示例14: eventorganiser_set_template

/**
 * Checks to see if appropriate templates are present in active template directory.
 * Otherwises uses templates present in plugin's template directory.
 * Hooked onto template_include'
 *
 * @ignore
 * @since 1.0.0
 * @param string $template Absolute path to template
 * @return string Absolute path to template
 */
function eventorganiser_set_template($template)
{
    //Has EO template handling been turned off?
    if (!eventorganiser_get_option('templates') || get_theme_support('event-organiser')) {
        return $template;
    }
    //If WordPress couldn't find an 'event' template use plug-in instead:
    if (is_post_type_archive('event') && !eventorganiser_is_event_template($template, 'archive')) {
        $template = EVENT_ORGANISER_DIR . 'templates/archive-event.php';
    }
    if ((is_tax('event-venue') || eo_is_venue()) && !eventorganiser_is_event_template($template, 'event-venue')) {
        $template = EVENT_ORGANISER_DIR . 'templates/taxonomy-event-venue.php';
    }
    if (is_tax('event-category') && !eventorganiser_is_event_template($template, 'event-category')) {
        $template = EVENT_ORGANISER_DIR . 'templates/taxonomy-event-category.php';
    }
    if (is_tax('event-tag') && eventorganiser_get_option('eventtag') && !eventorganiser_is_event_template($template, 'event-tag')) {
        $template = EVENT_ORGANISER_DIR . 'templates/taxonomy-event-tag.php';
    }
    /*
     * In view of theme compatibility, if an event template isn't found
     * rather than using our own single-event.php, we use ordinary single.php and
     * add content in via the_content
     */
    if (is_singular('event') && !eventorganiser_is_event_template($template, 'event')) {
        //Viewing a single event
        //Hide next/previous post link
        add_filter("next_post_link", '__return_false');
        add_filter("previous_post_link", '__return_false');
        //Prepend our event details
        add_filter('the_content', '_eventorganiser_single_event_content');
    }
    return $template;
}
开发者ID:Borgoroth,项目名称:Event-Organiser,代码行数:44,代码来源:event-organiser-templates.php


示例15: print_script

 static function print_script()
 {
     if (!self::$add_script) {
         return;
     }
     $terms = get_terms('event-category', array('hide_empty' => 0));
     $fullcal = empty(self::$calendars) ? array() : array('firstDay' => intval(get_option('start_of_week')), 'venues' => get_terms('event-venue', array('hide_empty' => 0)), 'categories' => $terms, 'tags' => get_terms('event-tag', array('hide_empty' => 1)));
     eo_localize_script('eo_front', array('ajaxurl' => admin_url('admin-ajax.php'), 'calendars' => self::$calendars, 'widget_calendars' => self::$widget_calendars, 'fullcal' => $fullcal, 'map' => self::$map));
     if (!empty(self::$calendars) || !empty(self::$map) || !empty(self::$widget_calendars)) {
         wp_enqueue_script('eo_qtip2');
         wp_enqueue_script('eo_front');
         if (!eventorganiser_get_option('disable_css')) {
             wp_enqueue_style('eo_front');
             wp_enqueue_style('eo_calendar-style');
         }
     }
     if (!empty(self::$map)) {
         wp_enqueue_script('eo_GoogleMap');
     }
 }
开发者ID:hmorv,项目名称:Event-Organiser,代码行数:20,代码来源:class-eventorganiser-shortcodes.php



注:本文中的eventorganiser_get_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP eventosInputText函数代码示例发布时间:2022-05-15
下一篇:
PHP eventon_get_custom_language函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap