Advertisement
Guest User

plugin:Events-Manager Daily Events php call (defined vars)

a guest
Mar 23rd, 2012
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //  CREATE EVENT HEADER, FOOTER, AND CONTENT AREA
  2. $featuredEvtHeader = '
  3.    <!-- START HEADER -->
  4.            <table>
  5.                <thead>
  6.                    <tr>
  7.                        <td>
  8.                            Date
  9.                        </td>
  10.                        <td>
  11.                            Activity
  12.                        </td>
  13.                        <td>
  14.                            Location
  15.                        </td>
  16.                    </tr>
  17.                </thead>
  18.                <tbody>
  19.    <!-- END HEADER -->
  20. ';
  21. $featuredEvtFormat = '
  22.    <!-- START SINGLE FORMAT -->
  23.        <tr>
  24.            <td>
  25.                #_{d/m/Y} #@_{- d/m/Y}<br/>
  26.                #H:#i -#@H:#@i
  27.            </td>
  28.            <td>
  29.                <a href="#_EVENTPAGEURL">#_EVENTNAME</a><br />
  30.                #_CATEGORY
  31.            </td>
  32.            <td>
  33.                #_LOCATIONLINK<br />
  34.                <!--#_EXCERPT <a href="#_EVENTPAGEURL">Read more ...</a>-->
  35.            </td>
  36.        </tr>            
  37.    <!-- END SINGLE FORMAT -->
  38. ';
  39. $featuredEvtFooter = '
  40.    <!-- START FOOTER -->
  41.            </tbody>
  42.        </table>
  43.    <!-- END FOOTER -->
  44. ';
  45.  
  46.  
  47.  
  48.  
  49. if (class_exists('EM_Events')) {
  50.  
  51.     //  Get link to the main calendar of events
  52.     $event_page_link = trailingslashit(get_permalink(get_option("dbem_events_page")));
  53.  
  54.     //  Echo a page title called "DAILY EVENTS"
  55.     //  (we're sorting by days but could sort by weeks or months or years)
  56.     echo '<h2 class="entry-title" class="header"><a href="'.$event_page_link.'">Daily Events</a></h2>';
  57.  
  58.     //  START IGNORE - but if you need this code I'd be happy to provide it)
  59.     //  ADD "featured-image" from the page admin
  60.     $my_featured_image = my_postimage_picker($myimagetype='post-thumbnails', 0, $myimageclass='header-image');
  61.     echo $my_featured_image;
  62.     //  END IGNORE
  63.  
  64.     //  place any CMS copy / text below the heading and main photo
  65.     the_content();
  66.  
  67.  
  68.     //  This is the default php to echo the events
  69.     //  NOTICE it is commented out as we are calling a separate funciton
  70.     //echo EM_Events::output( array(
  71.    
  72.     //  echo the grouped events so we can have headers above each group
  73.     //      echo GROUPED events (I'm chosing 'daily' to get a DATE header,
  74.         //  this way I don't have to repeat the date for each entry under the same date)
  75.     //  This will accept all of the same arguments as EM_Events
  76.     echo em_events_list_grouped( array(
  77.         'orderby'=>'event_start_date',
  78.         'pagination'=>1,
  79.         'limit'=>10,
  80.         //  the header above each content grouping (immediately following the DATE HEADER)
  81.         'format_header' => $featuredEvtHeader,
  82.         //  format each event's display
  83.         'format'=>$featuredEvtFormat,
  84.         //  the footer below each content grouping (what closes each content group)
  85.         'format_footer' => $featuredEvtFooter,
  86.         //  determines how to group the events.
  87.             //  choices are 'daily', 'weekly', 'monthly', 'yearly'
  88.             //  each of those will place a header above that group
  89.             //  so 'daily' will put the date, then list all events under that date
  90.         'mode'=>'daily',
  91.     ) );
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement