BFD Calendar Posted November 3, 2013 Posted November 3, 2013 Trying to get a list of events that happened 'today' results in nothing.... I have a number of 'events' pages with day, month and year fields. Getting the information from 'day' and 'month' I want to list them, and show the locations on a map. $todayday = date("d"); $todaymonth = date("m"); $features = $pages->find("template=bfd_events, bfd_day=$todayday, bfd_month=$todaymonth, sort=bfd_year"); foreach($features as $feature) echo "<li><a href='{$feature->url}'>{$feature->title} {$feature->bfd_case->title}</a></li>"; $items = $pages->find("template=bfd_events, bfd_day=$todayday, bfd_month=$todaymonth, MapMarker!='', sort=title"); $map = $modules->get('MarkupGoogleMap'); echo $map->render($items, 'MapMarker', array('height' => '400px', 'zoom' => '2', 'lat' => '50.923813', 'lng' => '4.431493')); 'bfd_day' and 'bfd_month' are Page fields while MapMarker is fetched to 'events' with a 'get("template=bfd_places, id=$page->bfd_events_places_id_list")'. Using selector 'title*=November' works.
diogo Posted November 3, 2013 Posted November 3, 2013 And what does $todaymonth echo? echo $todaymonth; I'm guessing it's "11" Edit: I just confirmed that date("m") returns the number of the month. If you want it to return the name of the month use date("F") instead. http://php.net/manual/en/function.date.php
BFD Calendar Posted November 3, 2013 Author Posted November 3, 2013 $todaymonth is 11 indeed. That's what it should be because in my 'bfd_month' pagefield I selected '11' for events happening in november.
diogo Posted November 3, 2013 Posted November 3, 2013 Ok, I was mistaken by this Using selector 'title*=November' works. If bfd_month is a page field bfd_month=11 will search for the page with the id 11. If 11 is the name of the page you should use bfd_month.name=11 instead. 2
BFD Calendar Posted November 3, 2013 Author Posted November 3, 2013 Happiness comes from small things Now find a Good Samaritan who solves the GoogleMaps problem....
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now