northside

Untitled

Oct 31st, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. <?php /**
  2. * This is the template for the output of the events list widget.
  3. * All the items are turned on and off through the widget admin.
  4. * There is currently no default styling, which is highly needed.
  5. *
  6. * You can customize this view by putting a replacement file of the same name (events-list-load-widget-display.php) in the events/ directory of your theme.
  7. *
  8. * When the template is loaded, the following vars are set: $start, $end, $venue, $address, $city, $state, $province'], $zip, $country, $phone, $cost
  9. * @return string
  10. */
  11.  
  12. //Vars set:
  13. // '$event->AllDay',
  14. // '$event->StartDate',
  15. // '$event->EndDate',
  16. // '$event->ShowMapLink',
  17. // '$event->ShowMap',
  18. // '$event->Cost',
  19. // '$event->Phone',
  20.  
  21. $event = array();
  22. global $sp_ecp;
  23. reset($sp_ecp->metaTags); // Move pointer to beginning of array.
  24. foreach($sp_ecp->metaTags as $tag){
  25. $var_name = str_replace('_Event','',$tag);
  26. $event[$var_name] = getEventMeta( $post->ID, $tag, true );
  27. }
  28.  
  29. $event = (object) $event; //Easier to work with.
  30.  
  31. ob_start();
  32. post_class($alt_text,$post->ID);
  33. $class = ob_get_contents();
  34. ob_end_clean();
  35. ?>
  36. <li <?php echo $class ?>>
  37. <div class="when">
  38. <?php
  39. $space = false;
  40. $output = '';
  41. echo sp_get_start_date( $post->ID, $start );
  42.  
  43. if($event->AllDay && $start) {
  44. echo ' <small>('.__('All Day',$this->pluginDomain).')</small>';
  45. } else {
  46. if ( $end && $event->EndDate != '') {
  47. echo "<br/>" . __('Ends ', $this->pluginDomain);
  48. echo sp_get_end_date($post->ID);
  49. }
  50. }
  51. ?>
  52. </div>
  53. <div class="event">
  54. <a href="<?php echo get_permalink($post->ID) ?>"><?php echo $post->post_title ?></a>
  55. </div>
  56. <div class="loc"><?php
  57. if ( $venue && sp_get_venue() != '') {
  58. $output .= ( $space ) ? '<br />' : '';
  59. $output .= sp_get_venue();
  60. $space = true;
  61. }
  62.  
  63. if ( $address && sp_get_address()) {
  64. $output .= ( $space ) ? '<br />' : '';
  65. $output .= sp_get_address();
  66. $space = true;
  67. }
  68.  
  69. if ( $city && sp_get_city() != '' ) {
  70. $output .= ( $space ) ? '<br />' : '';
  71. $output .= sp_get_city() . ', ';
  72. $space = true;
  73. }
  74. if ( $region && sp_get_region()) {
  75. $output .= ( !$city ) ? '<br />' : '';
  76. $space = true;
  77. $output .= sp_get_region();
  78. } else {
  79. $output = rtrim( $output, ', ' );
  80. }
  81.  
  82. if ( $zip && sp_get_zip() != '') {
  83. $output .= ( $space ) ? '<br />' : '';
  84. $output .= sp_get_zip();
  85. $space = true;
  86. }
  87.  
  88. if ( $country && sp_get_country() != '') {
  89. $output .= ( $space ) ? '<br />' : ' ';
  90. $output .= sp_get_country();
  91. }
  92.  
  93. if ( $phone && sp_get_phone() != '') {
  94. if($output)
  95. $output .= '<br/>';
  96.  
  97. $output .= sp_get_phone();
  98. }
  99. if ( $cost && sp_get_cost() != '') {
  100. if($output)
  101. $output .= '<br/>';
  102. $output .= sp_get_cost();
  103. }
  104.  
  105. echo $output;
  106. ?>
  107. </div>
  108. </li>
  109. <?php $alt_text = ( empty( $alt_text ) ) ? 'alt' : '';
Advertisement
Add Comment
Please, Sign In to add comment