예제 #1
0
/**
 * Instantiate class and get the party started!
 *
 * @since 1.0
 */
function Tribe_CE_Load()
{
    add_filter('tribe_tec_addons', array('TribeCommunityEvents', 'init_addon'));
    if (class_exists('TribeEvents') && defined('TribeEvents::VERSION') && version_compare(TribeEvents::VERSION, TribeCommunityEvents::REQUIRED_TEC_VERSION, '>=')) {
        TribeCommunityEvents::instance();
        TribeCommunityEventsTemplates::instance();
        require_once 'lib/tribe-community-events-schema.class.php';
        add_action('admin_init', array('TribeCommunityEvents_Schema', 'init'));
    } elseif (!class_exists('TribeEvents')) {
        add_action('admin_notices', 'tribe_ce_show_fail_message');
    }
}
 /**
  * Filter template paths to add the community plugin to the queue
  *
  * @param array $paths
  * @return array $paths
  * @author Peter Chester
  * @since 3.1
  */
 public function add_community_template_paths($paths)
 {
     $paths['community'] = TribeCommunityEvents::instance()->pluginPath;
     return $paths;
 }
예제 #3
0
if (!empty($event_cats)) {
    // only display categories if there are any.
    ?>
	<!-- Event Categories -->
	<?php 
    do_action('tribe_events_community_before_the_categories');
    ?>
	<div class="tribe-events-community-details eventForm bubble" id="event_taxonomy">
		<table class="tribe-community-event-info" cellspacing="0" cellpadding="0">
			<tr>
				<td colspan="2" class="tribe_sectionheader">
					<h4 class="event-time"><?php 
    _e('Event Categories:', 'tribe-events-community');
    ?>
</h4>
				</td>
			</tr>
			<tr>
				<td><?php 
    TribeCommunityEvents::instance()->formCategoryDropdown(null, $currently_selected_category_ids);
    ?>
</td>
			</tr>
		</table><!-- .tribe-community-event-info -->
	</div><!-- .tribe-events-community-details -->
	<?php 
    do_action('tribe_events_community_after_the_categories');
    ?>

<?php 
}
예제 #4
0
	<?php 
tribe_get_template_part('community/modules/website');
?>

	<?php 
tribe_get_template_part('community/modules/custom');
?>

	<?php 
tribe_get_template_part('community/modules/cost');
?>

	<!-- Spam Control -->
	<?php 
TribeCommunityEvents::instance()->formSpamControl();
?>

	<!-- Form Submit -->
	<?php 
do_action('tribe_events_community_before_form_submit');
?>
	<div class="tribe-events-community-footer">
		<input type="submit" id="post" class="button submit events-community-submit" value="<?php 
if (isset($post_id) && $post_id) {
    echo apply_filters('tribe_ce_event_update_button_text', __('Update Event', 'tribe-events-community'));
} else {
    echo apply_filters('tribe_ce_event_submit_button_text', __('Submit Event', 'tribe-events-community'));
}
?>
" name="community-event" />
예제 #5
0
 /**
  * If a removed organizer is being used as a default, change the default to
  * its replacement.
  *
  * @param int $keep
  * @param array $replace
  *
  * @return void
  */
 private function update_default_organizers($keep, array $replace)
 {
     if ($this->default_organizer && in_array($this->default_organizer, $replace)) {
         $events = TribeEvents::instance();
         $events->setOption('eventsDefaultOrganizerID', $keep);
     }
     if ($this->default_community_organizer && in_array($this->default_community_organizer, $replace)) {
         $community = TribeCommunityEvents::instance();
         $community->setOption('defaultCommunityOrganizerID', $keep);
     }
 }
예제 #6
0
							</td>
						<?php 
        }
        ?>

						<td>
						<?php 
        $start_date = strtotime($post->EventStartDate);
        echo tribe_event_format_date($start_date, false, TribeCommunityEvents::instance()->eventListDateFormat);
        ?>
						</td>

						<td>
						<?php 
        $end_date = strtotime($post->EventEndDate);
        echo tribe_event_format_date($end_date, false, TribeCommunityEvents::instance()->eventListDateFormat);
        ?>
						</td>

					</tr>

				<?php 
    }
    // end list loop
    $post = $old_post;
    ?>

			</tbody><!-- #the-list -->

			<?php 
    do_action('tribe_ce_after_event_list_table');
예제 #7
0
        /**
         * displays the saved organizer dropdown in the event metabox
         * Used to be a PRO only feature, but as of 3.0, it is part of Core.
         *
         * @param int $postId the event ID for which to create the dropdown
         * @return void
         */
        public function displayEventOrganizerDropdown($postId)
        {
            $curOrg = get_post_meta($postId, '_EventOrganizerID', true);
            // override pro default with community on add page
            if (!$curOrg && class_exists('TribeCommunityEvents')) {
                if (TribeCommunityEvents::instance()->isEditPage) {
                    $curOrg = TribeCommunityEvents::getOption('defaultCommunityOrganizerID');
                }
            }
            $defaultsEnabled = class_exists('TribeEventsPro') ? tribe_get_option('defaultValueReplace') : false;
            if ((!$postId || get_post_status($postId) == 'auto-draft') && !$curOrg && $defaultsEnabled && (is_admin() && get_current_screen()->action == 'add' || !is_admin())) {
                $curOrg = tribe_get_option('eventsDefaultOrganizerID');
            }
            $curOrg = apply_filters('tribe_display_event_organizer_dropdown_id', $curOrg);
            ?>
			<tr class="" >
				<td style="width:170px"><?php 
            _e('Use Saved Organizer:', 'tribe-events-calendar');
            ?>
</td>
				<td><?php 
            $this->saved_organizers_dropdown($curOrg);
            ?>
</td>
			</tr>
			<?php 
        }
 /**
  * Singleton instance method.
  *
  * @return TribeCommunityEvents The instance
  * @author Nick Ciske
  * @since 1.0
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         $className = __CLASS__;
         self::$instance = new $className();
     }
     return self::$instance;
 }
/**
 * Get the logout URL
 *
 * @return string The logout URL with appropriate redirect for the current user
 * @since 3.1
 */
function tribe_community_events_logout_url()
{
    $community = TribeCommunityEvents::instance();
    return $community->logout_url();
}
예제 #10
0
	</div><!-- .events-community-post-title -->

	<!-- Venue Description -->
	<div class="events-community-post-content">

		<label for="post_content">
			<?php 
_e('Venue Description:', 'tribe-events-community');
?>
			<small class="req"></small>
		</label>

		<?php 
// if admin wants rich editor (and using WP 3.3+) show the WYSIWYG, otherwise default to a textarea
$content = tribe_community_events_get_venue_description();
if (TribeCommunityEvents::instance()->useVisualEditor && function_exists('wp_editor')) {
    $settings = array('wpautop' => true, 'media_buttons' => false, 'editor_class' => 'frontend', 'textarea_rows' => 5);
    echo wp_editor($content, 'tcepostcontent', $settings);
} else {
    echo '<textarea name="tcepostcontent">' . esc_textarea($content) . '</textarea>';
}
?>

	</div><!-- .events-community-post-content -->

	<?php 
tribe_get_template_part('community/modules/venue');
?>

	<!-- Form Submit -->
	<div class="tribe-events-community-footer">
예제 #11
0
function tribe_display_current_community_events_slug()
{
    echo '<p class="tribe-field-indent tribe-field-description description"><code>' . tribe_get_events_link() . TribeCommunityEvents::instance()->getOption('communityRewriteSlug', 'community', true) . '/add</code><br /><code>' . tribe_get_events_link() . TribeCommunityEvents::instance()->getOption('communityRewriteSlug', 'community', true) . '/list</code></p>';
}
예제 #12
0
        /**
         * displays the saved organizer dropdown in the event metabox
         *
         * @param int $postID the event ID for which to create the dropdown
         * @return void
         */
        public function displayEventOrganizerDropdown($postId)
        {
            $curOrg = get_post_meta($postId, '_EventOrganizerID', true);
            // override pro default with community on add page
            if (!$curOrg && class_exists('TribeCommunityEvents')) {
                if (TribeCommunityEvents::instance()->isEditPage) {
                    $curOrg = TribeCommunityEvents::getOption('defaultCommunityOrganizerID');
                }
            }
            $defaultsEnabled = tribe_get_option('defaultValueReplace');
            if (!$curOrg && $defaultsEnabled) {
                $curOrg = tribe_get_option('eventsDefaultOrganizerID');
            }
            $curOrg = apply_filters('tribe_display_event_organizer_dropdown_id', $curOrg);
            ?>
			<tr class="" >
				<td style="width:170px"><?php 
            _e('Use Saved Organizer:', 'tribe-events-calendar-pro');
            ?>
</td>
				<td><?php 
            $this->saved_organizers_dropdown($curOrg);
            ?>
</td>
			</tr>
			<?php 
        }