Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Template function. Call this from your template to insert posts of
- * forthcoming events.
- */
- function ec3_get_events_posts()
- {
- if(!ec3_check_installed(__('Upcoming Events','ec3')))
- return;
- global $ec3,$wpdb,$wp_version, $post;
- // Find the upcoming events.
- $querystring =
- "SELECT DISTINCT wposts.*, s.*
- FROM $wpdb->posts wposts, $ec3->schedule s
- WHERE wposts.id=s.post_id
- AND wposts.post_status='publish'
- AND s.end>='$ec3->today'
- ORDER BY start";
- $calendar_entries = $wpdb->get_results($querystring);
- echo "<!-- Generated by Event Calendar v$ec3->version -->\n";
- if($calendar_entries)
- {
- foreach ($calendar_entries as $post):
- $post->ec3_schedule[]=$post;
- setup_postdata($post); ?>
- <div class="post" id="post-<?php the_ID(); ?>">
- <h2 class="title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
- <div class="entry">
- <?php the_content('Read the rest of this entry »'); ?>
- </div>
- <div class="btm"><p class="meta">Posted by <?php the_author() ?> under <?php the_category(', ') ?>
- <?php the_tags('Tags: ', ', ', ''); ?>
- •
- <?php edit_post_link('Edit', '', ' • '); ?>
- <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p>
- </div>
- </div>
- <?php endforeach;
- }
- else
- {
- echo "<p>".__('No upcomming events.','ec3')."</p>\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement