Beispiel #1
0
    /**
     * Home section - Events Without Calendar
     *
     * Output contents for the section on the homepage.
     */
    function dd_home_section_events_no_cal($atts)
    {
        global $dd_sn;
        $wrapper_class = '';
        $container_class = '';
        // Wrapper classes
        if ($atts['parity'] == 'even') {
            $wrapper_class .= 'even ';
        } else {
            $wrapper_class .= 'odd ';
        }
        // Container class
        if ($atts['type'] == 'carousel') {
            $container_class .= 'carousel ';
        }
        $args = array('post_type' => 'dd_events', 'posts_per_page' => $atts['amount'], 'post_status' => array('future'), 'order' => 'ASC');
        $dd_query = new WP_Query($args);
        if ($dd_query->have_posts()) {
            $start_at = true;
            $count = 0;
            ?>

			<div class="events-no-cal-wrapper home-section <?php 
            echo $wrapper_class;
            ?>
">

				<div class="container clearfix">

					<h2 class="section-title">
						<?php 
            if (!empty($atts['title'])) {
                ?>
							<span class="dd-button medium blue"><?php 
                echo $atts['title'];
                ?>
</span>
						<?php 
            }
            ?>
						<a href="<?php 
            echo get_permalink(dd_get_post_id('template', 'template-dd_events.php'));
            ?>
" class="dd-button medium orange-light"><?php 
            _e('VIEW ALL', 'dd_string');
            ?>
</a>
						
						<?php 
            if ($atts['type'] == 'carousel') {
                ?>

							<span class="carousel-nav fr">
								<span class="carousel-nav-inner">
									<a href="#" class="carousel-prev"></a>
									<a href="#" class="carousel-next"></a>
								</span>
							</span><!-- .carousel-nav -->

						<?php 
            }
            ?>

					</h2>

					<div class="events carousel clearfix" data-autoplay="<?php 
            echo $atts['autoplay'];
            ?>
">

						<?php 
            if ($atts['type'] == 'carousel') {
                ?>

						<div class="flexslider">

							<ul class="slides">

						<?php 
            }
            ?>

								 <?php 
            $start_at = true;
            while ($dd_query->have_posts()) {
                $dd_query->the_post();
                $count++;
                ?>

								 	<?php 
                if (has_post_thumbnail()) {
                    $post_class_append = 'has-thumb ';
                } else {
                    $post_class_append = '';
                }
                if ($atts['post_width'] == 'one_fourth') {
                    $post_width_class = 'four columns ';
                    $thumb_id = 'dd-home-events';
                    $max_count = 4;
                } elseif ($atts['post_width'] == 'one_third') {
                    $post_width_class = 'one-third column ';
                    $thumb_id = 'dd-one-third';
                    $max_count = 3;
                } elseif ($atts['post_width'] == 'one_half') {
                    $post_width_class = 'eight columns ';
                    $thumb_id = 'dd-one-half';
                    $max_count = 2;
                }
                // Calculate last classes
                $last_class = '';
                if ($count == $max_count) {
                    $last_class = ' last';
                    $count = 0;
                } else {
                    if ($count == 1) {
                        $last_class = 'clear';
                    }
                }
                // If carousel clear the last classes
                if ($atts['type'] == 'carousel') {
                    $last_class = '';
                }
                $fb_link = get_post_meta(get_the_ID(), $dd_sn . 'event_facebook_link', true);
                // Date of event
                $event_date = get_post_meta(get_the_ID(), $dd_sn . 'event_date', true);
                if (!$event_date) {
                    $event_date = get_the_time(get_option('date_format'));
                }
                $start_at_class = '';
                if ($start_at && get_post_status(get_the_ID()) == 'future') {
                    $start_at = false;
                    $start_at_class = 'start-at';
                }
                ?>

									<li class="event <?php 
                echo $post_width_class . $post_class_append . $start_at_class . ' ' . $last_class;
                ?>
" data-day="<?php 
                the_time('j m Y');
                ?>
">

										<div class="event-inner">

											<div class="event-thumb">

												<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_post_thumbnail($thumb_id);
                ?>
</a>

												<div class="event-date"><span class="icon-calendar"></span><?php 
                echo $event_date;
                ?>
</div>

											</div><!-- .event-thumb -->

											<div class="event-main">

												<h2 class="event-title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
													
												<div class="event-excerpt">
													<?php 
                the_excerpt();
                ?>
												</div><!-- .event-excerpt -->

											</div><!-- .event-main -->

											<div class="event-info">
												
												<a href="<?php 
                the_permalink();
                ?>
" class="dd-button small orange-light"><?php 
                _e('MORE DETAILS', 'dd_string');
                ?>
</a>
												
												<?php 
                if ($fb_link != '') {
                    ?>
													<em><?php 
                    _e('or', 'dd_string');
                    ?>
</em>
													<a href="<?php 
                    echo $fb_link;
                    ?>
" target="_blank" class="dd-button small blue-light"><?php 
                    _e('VIEW FACEBOOK PAGE', 'dd_string');
                    ?>
</a>
												<?php 
                }
                ?>

											</div><!-- event-info -->

										</div><!-- .event-inner -->

									</li><!-- .event -->

								<?php 
            }
            ?>

							<?php 
            if ($atts['type'] == 'carousel') {
                ?>

							</ul><!-- .slides -->

						</div><!-- .flexslider -->

						<?php 
            }
            ?>

					</div><!-- .blog-posts -->

				</div><!-- .container -->

			</div><!-- .events-wrapper -->
			
		<?php 
        }
        wp_reset_postdata();
    }
Beispiel #2
0
            $dd_max_count = 3;
        } elseif ($parent_listing_post_width == 'one_fourth') {
            $dd_post_class = 'four columns ';
            $dd_thumb_size = 'dd-one-fourth';
            $dd_max_count = 4;
        } else {
            $dd_post_class = 'four columns ';
            $dd_thumb_size = 'dd-one-fourth';
        }
        $dd_style = '1';
    }
} elseif (get_post_type() == 'post') {
    /**
     * Blog - Options based on the parent listing options
     */
    $parent_listing_id = dd_get_post_id('template', 'template-blog.php');
    $parent_listing_layout = get_post_meta($parent_listing_id, $dd_sn . 'layout', true);
    $parent_listing_post_width = get_post_meta($parent_listing_id, $dd_sn . 'post_width', true);
    if ($parent_listing_layout == 'cs') {
        // In page vars
        $content_class = 'two-thirds column ';
        $blog_posts_class = 'blog-posts blog-posts-listing blog-listing-style-2';
        $has_sidebar = true;
        // Template vars (globals)
        $dd_post_class = '';
        $dd_thumb_size = 'dd-one-fourth';
        $dd_style = '2';
    } else {
        // In page vars
        $content_class = '';
        $blog_posts_class = 'blog-posts blog-posts-listing';
Beispiel #3
0
if (strcmp($res, "VERIFIED") == 0) {
    //// check whether the payment_status is Completed
    //// check that receiver_email is your Primary PayPal email
    //// check that payment_amount/payment_currency are correct
    //// process payment
    // assign posted variables to local variables
    $item_name = $_POST['item_name'];
    $item_number = $_POST['item_number'];
    $payment_status = $_POST['payment_status'];
    $payment_amount = $_POST['mc_gross'];
    $payment_currency = $_POST['mc_currency'];
    $txn_id = $_POST['txn_id'];
    $receiver_email = $_POST['receiver_email'];
    $payer_email = $_POST['payer_email'];
    // Get regular donate page id
    $donate_page_id = dd_get_post_id('template', 'template-donate.php');
    // Donation splitting
    $donate_split = ot_get_option($dd_sn . 'regular_donation_spread', 'enabled');
    if ($donate_split == 'enabled') {
        $donate_split = true;
    } else {
        $donate_split = false;
    }
    // If the payment was from regular donate page
    if ($item_number == $donate_page_id) {
        if ($donate_split) {
            $args = array('paged' => $paged, 'post_type' => 'dd_causes', 'posts_per_page' => $posts_per_page, 'meta_key' => '_dd_cause_percentage', 'order_by' => 'meta_value_num', 'order' => 'DESC', 'meta_query' => array('relation' => 'AND', array('key' => '_dd_cause_status', 'value' => 'funded', 'compare' => '!=')));
            // Do the Query
            $dd_query = new WP_Query($args);
            // Loop
            if ($dd_query->have_posts()) {
Beispiel #4
0
            ?>

							</div><!-- #sub-header-staff -->

						<?php 
        }
        ?>

					<?php 
    } elseif (is_category()) {
        ?>

						<div class="sub-header">

							<a href="<?php 
        echo get_permalink(dd_get_post_id('template', 'template-blog.php'));
        ?>
" class="fl"><?php 
        _e('ALL', 'dd_string');
        ?>
</a>

							<ul class="sub-header-cats-listing fl">
								<?php 
        wp_list_categories(array('title_li' => ''));
        ?>
							</ul>

						</div>

					<?php