コード例 #1
0
 public function widget($args, $instance)
 {
     //extract($args);
     //$title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Events','eme' ) : $instance['title'], $instance, $this->id_base);
     //$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     $title = apply_filters('widget_title', $instance['title']);
     $limit = isset($instance['limit']) ? intval($instance['limit']) : 5;
     $scope = empty($instance['scope']) ? 'future' : $instance['scope'];
     $showperiod = empty($instance['showperiod']) ? '' : $instance['showperiod'];
     $show_ongoing = isset($instance['show_ongoing']) ? $instance['show_ongoing'] : true;
     $order = empty($instance['order']) ? 'ASC' : $instance['order'];
     $header = empty($instance['header']) ? '<ul>' : $instance['header'];
     $footer = empty($instance['footer']) ? '</ul>' : $instance['footer'];
     $category = empty($instance['category']) ? '' : $instance['category'];
     $notcategory = empty($instance['notcategory']) ? '' : $instance['notcategory'];
     $recurrence_only_once = empty($instance['recurrence_only_once']) ? false : $instance['recurrence_only_once'];
     if (empty($instance['format']) && empty($instance['format_tpl'])) {
         $format = DEFAULT_WIDGET_EVENT_LIST_ITEM_FORMAT;
     } elseif (empty($instance['format'])) {
         $format = eme_get_template_format($instance['format_tpl']);
     } else {
         $format = $instance['format'];
     }
     $format_tpl = $instance['format_tpl'];
     if ($instance['authorid'] == -1) {
         $author = '';
     } else {
         $authinfo = get_userdata($instance['authorid']);
         $author = $authinfo->user_login;
     }
     echo $args['before_widget'];
     if ($title) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     if (is_array($category)) {
         $category = implode(',', $category);
     }
     if (is_array($notcategory)) {
         $notcategory = implode(',', $notcategory);
     }
     $events_list = eme_get_events_list($limit, $scope, $order, $format, '', '', false, $category, $showperiod, 0, $author, '', 0, '', 0, $show_ongoing, 0, $notcategory, $recurrence_only_once, $format_tpl);
     if ($events_list == get_option('eme_no_events_message')) {
         echo $events_list;
     } else {
         echo $header . $events_list . $footer;
     }
     echo $args['after_widget'];
 }
コード例 #2
0
ファイル: eventos.php プロジェクト: unait/mozilla-hispano.org
        the_content('<p class="serif">Leer el resto de esta página &raquo;</p>');
        ?>
				
				<?php 
        if ($url == "www.mozilla-hispano.org/difusion/eventos/") {
            ?>
				<p class="evento-rss"><a href="<?php 
            eme_rss_link(justurl);
            ?>
">Canal RSS de eventos</a></p>
					<p>Esta página muestra información sobre los próximos eventos de la comunidad de Mozilla en español.</p>
						<p>Si tienes información sobre cualquier evento que se vaya a realizar y quiere que sea añadido al calendario, <a href="/documentacion/Organizaci%C3%B3n_de_Mozilla_Hispano#Difusi.C3.B3n">ponte en contacto con nosotros</a> e infórmanos.</p>
						<h3>Próximos eventos</h3>
						
							<?php 
            eme_get_events_list("limit=5&scope=future&order=ASC");
            ?>
 
						
				<?php 
        }
        ?>
				
				<?php 
        wp_reset_query();
        //Reseteo del query
        ?>

				<?php 
        wp_link_pages(array('before' => '<p><strong>Páginas:</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));
        ?>
コード例 #3
0
ファイル: eme_events.php プロジェクト: johnmanlove/Bridgeland
function eme_get_events_list_shortcode($atts)
{
    $eme_event_list_number_events = get_option('eme_event_list_number_items');
    extract(shortcode_atts(array('limit' => $eme_event_list_number_events, 'scope' => 'future', 'order' => 'ASC', 'format' => '', 'category' => '', 'showperiod' => '', 'author' => '', 'contact_person' => '', 'paging' => 0, 'long_events' => 0, 'location_id' => 0, 'user_registered_only' => 0, 'show_ongoing' => 1, 'link_showperiod' => 0, 'notcategory' => '', 'show_recurrent_events_once' => 0, 'template_id' => 0, 'template_id_header' => 0, 'template_id_footer' => 0, 'no_events_message' => ''), $atts));
    // the filter list overrides the settings
    if (isset($_REQUEST['eme_eventAction']) && $_REQUEST['eme_eventAction'] == 'filter') {
        if (isset($_REQUEST['eme_scope_filter']) && !empty($_REQUEST['eme_scope_filter'])) {
            $scope = eme_sanitize_request($_REQUEST['eme_scope_filter']);
        }
        if (isset($_REQUEST['eme_loc_filter']) && !empty($_REQUEST['eme_loc_filter'])) {
            if (is_array($_REQUEST['eme_loc_filter'])) {
                $location_id = join(',', eme_sanitize_request($_REQUEST['eme_loc_filter']));
            } else {
                $location_id = eme_sanitize_request($_REQUEST['eme_loc_filter']);
            }
        }
        if (isset($_REQUEST['eme_town_filter']) && !empty($_REQUEST['eme_town_filter'])) {
            $towns = eme_sanitize_request($_REQUEST['eme_town_filter']);
            if (empty($location_id)) {
                $location_id = join(',', eme_get_town_location_ids($towns));
            } else {
                $location_id .= "," . join(',', eme_get_town_location_ids($towns));
            }
        }
        if (isset($_REQUEST['eme_cat_filter']) && !empty($_REQUEST['eme_cat_filter'])) {
            if (is_array($_REQUEST['eme_cat_filter'])) {
                $category = join(',', eme_sanitize_request($_REQUEST['eme_cat_filter']));
            } else {
                $category = eme_sanitize_request($_REQUEST['eme_cat_filter']);
            }
        }
    }
    // if format is given as argument, sometimes people need url-encoded strings inside so wordpress doesn't get confused, so we decode them here again
    $format = urldecode($format);
    // for format: sometimes people want to give placeholders as options, but when using the shortcode inside
    // another (e.g. when putting[eme_events format="#_EVENTNAME"] inside the "display single event" setting,
    // the replacement of the placeholders happens too soon (placeholders get replaced first, before any other
    // shortcode is interpreted). So we add the option that people can use "#OTHER_", and we replace this with
    // "#_" here
    $format = preg_replace('/#OTHER/', "#", $format);
    $result = eme_get_events_list($limit, $scope, $order, $format, '', '', 0, $category, $showperiod, $long_events, $author, $contact_person, $paging, $location_id, $user_registered_only, $show_ongoing, $link_showperiod, $notcategory, $show_recurrent_events_once, $template_id, $template_id_header, $template_id_footer, $no_events_message);
    return $result;
}
コード例 #4
0
ファイル: front-page.php プロジェクト: KrissieV/LBC-multisite
<div class="divider dots"></div>

<?php 
if (get_field('form')) {
    ?>
<h1 class="block sec_bkgd"><span>E-Newsletter Sign-up</span></h1>
<?php 
    $form_object = get_field('form');
    echo do_shortcode('[gravityform id="' . $form_object['id'] . '" title="false" description="false" ajax="true"]');
}
?>
</div><!-- end .col.span_6_of_12 -->
<div class="col span_6_of_12">
	<h1 class="dots"><span>Upcoming Events / <a href="/all-church-events/">view all</a></span></h1>
	<?php 
eme_get_events_list("limit=4&category=2&long_events=1&template_id=2");
?>
	<a class="button styleA alignright" href="/all-church-events/">View Full Calendar</a>
	<div class="divider dots"></div>
</div>

		</div>
		
		</div>
		<div class="bar main_bkgd"></div>
			<?php 
while (have_posts()) {
    the_post();
    ?>

				
コード例 #5
0
	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">
		<div class="container">
		<div class="section">
		<div class="col span_12_of_12 remove-bot-marg">
		<h1><?php 
    the_title();
    ?>
</h1>
		</div>
		</div>
		<div class="section">
		<div class="col span_8_of_12 remove-top-marg calendar">
			<ul class="pill-nav"><li><a href="/all-church-events/monthly/" class="main_border">Monthly View</a></li></ul>
		<?php 
    eme_get_events_list("paging=1&limit=0&template_id=2&scope=this_week&show_recurrent_events_once=1");
    ?>
		</div>
		<div class="col span_4_of_12 remove-top-marg">
		<?php 
    if (have_rows('sidebar_item')) {
        // loop through the rows of data
        while (have_rows('sidebar_item')) {
            the_row();
            // display a sub field value
            echo '<div class="sidebar-item main_border"><h6>';
            the_sub_field('heading');
            echo '</h6>';
            the_sub_field('text');
            echo '<div class="clear"></div></div>';
        }
コード例 #6
0
ファイル: eventsTab.php プロジェクト: KrissieV/LBC-multisite
<?php

if (isset($_POST['i'])) {
    $i = $_POST['i'];
}
include "../../../../wp-load.php";
global $wpdb;
?>
	<?php 
$test = eme_get_events_list("limit=10&category=" . $i . "&long_events=1&template_id=3&echo=false&show_recurrent_events_once=1");
$count = strlen($test);
if ($count == 33) {
    echo '<p>There are no events for this ministry currently scheduled. Check back soon for updates.</p>';
} else {
    eme_get_events_list("limit=10&category=" . $i . "&long_events=1&template_id=3&show_recurrent_events_once=1");
}
?>

	
<?php 
die;