Skip to content

Commit

Permalink
add templates for events
Browse files Browse the repository at this point in the history
  • Loading branch information
marpa committed Nov 4, 2013
1 parent f95fed0 commit 77ce0ea
Show file tree
Hide file tree
Showing 2 changed files with 157 additions and 0 deletions.
82 changes: 82 additions & 0 deletions plugins/archive-event.php
@@ -0,0 +1,82 @@
<?php
/**
* The template for displaying Archive pages.
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage 2010_Translucence
* @since 2010 Translucence 1.0
*/

get_header();


$content_width = translucence_get_content_width("archives");
?>

<div id="container">



<?php if ( $translucence_options['archives-sidebar-left-display'] == "show" && $translucence_options['left01-width'] != '0') : ?>
<?php get_sidebar('tertiary'); ?>
<?php endif; ?>



<div id="content" role="main" style="width: <?php print $content_width; ?>px;">

<?php print translucence_toggle_links(); ?>

<h1>Events</h1>

<?php
if( !have_posts() ):

?>
<p>No events found.</p>
<?php

else:

?>
<div class="exchange-events archive">
<?php

global $wp_query;
//echo '<pre>';var_dump($wp_query);echo '</pre>';
//echo '<pre>';var_dump($wp_query->posts);echo '</pre>';
Exchange_Events::print_archive_events( $wp_query );

?>
</div><!-- .exchange-events -->
<?php

endif;
?>

</div><!-- #content -->



<?php if ( $translucence_options['archives-sidebar-right-display'] == "show" && $translucence_options['right01-width'] != '0') : ?>
<?php get_sidebar('primary'); ?>
<?php endif; ?>



<?php if ( $translucence_options['archives-sidebar-right02-display'] == "show" && $translucence_options['right02-width'] != '0') : ?>
<?php get_sidebar('secondary'); ?>
<?php endif; ?>



</div><!-- #container -->



<?php get_footer(); ?>
75 changes: 75 additions & 0 deletions plugins/single-event.php
@@ -0,0 +1,75 @@
<?php
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage 2010_Translucence
* @since Twenty Ten 1.0
*/

get_header();
$content_width = translucence_get_content_width ("post");
if( have_posts() )
{
the_post();
$event = Exchange_Events::populate_event_data( get_post() );
}
else
{
$event = null;
}
?>

<div id="container" class="single-page events">
<?php if ( $translucence_options['post-sidebar-left-display'] == "show" && $translucence_options['left01-width'] != '0') : ?>
<?php get_sidebar('tertiary'); ?>
<?php endif; ?>

<div id="content" role="main" style="width: <?php print $content_width; ?>px;">
<?php print translucence_toggle_links(); ?>

<?php
if( $event == null ):

?>
<h1>Event Not Found</h1>
<div class="event"></div>
<?php

else:

?>
<h1><?php echo $event->post_title; ?></h1>

<div class="event">

<div class="contents">

<div class="event-info">
<div class="datetime"><label>Date/Time: </label><?php echo $event->datetime; ?></div>
<div class="location"><label>Location: </label><?php echo $event->location; ?></div>
</div>

<div class="content"><?php echo $event->post_content; ?></div>

</div><!-- .contents -->

</div><!-- .event -->
<?php

endif;

?>
</div><!-- #content -->



<?php if ( $translucence_options['post-sidebar-right-display'] == "show" && $translucence_options['right01-width'] != '0') : // When to display 1st right sidebar. ?>
<?php get_sidebar('primary'); ?>
<?php endif; ?>
<?php if ( $translucence_options['post-sidebar-right02-display'] == "show" && $translucence_options['right02-width'] != '0') : // When to display 2nd right sidebar. ?>
<?php get_sidebar('secondary'); ?>
<?php endif; ?>

</div><!-- #container -->
<?php get_footer(); ?>

0 comments on commit 77ce0ea

Please sign in to comment.