Jump to content

BFD Calendar

Members
  • Posts

    400
  • Joined

  • Last visited

Everything posted by BFD Calendar

  1. Any progress with this module so far? I'm looking for something to send out a daily newsletter with MailChimp that has a list of events for the day. $todayday = date("d"); $todaymonth = date("m"); $features = $pages->find("parent=/events/, bfd_day.name=$todayday, bfd_month.name=$todaymonth, sort=bfd_year"); I tried linking the ProcessWire RSS module and MailChimp RSS newsletter function but they don't seem to match....
  2. Would it be possible to set this up from an RSS feed as well? I want to send an RSS feed with posts matching criteria every day. It works fine with a feed from Blogger but I can't manage it to work from ProcessWire. The integrated RSS module is set up properly and feed readers get it, Mailchimp doesn't....
  3. I have an rss feed that searches for pages with today's date (day and month). $todayday = date("d"); $todaymonth = date("m"); $features = $pages->find("parent=/events/, bfd_day.name=$todayday, bfd_month.name=$todaymonth, sort=bfd_year"); Is there a way to have the feed go out once every day, say at 2.00 am? And, can someone direct me towards formatting the feed, or is this dependent on the reader used? $feedtxt = "<li> <table><tr><td width='200' valign='bottom'> <div style='max-width:200px'> <img src='{$webimage}' align='right' style='width:100%; height:100%'> </div></td><td width='15'></td><td valign='bottom'> <span class='nobelbold_32px'>{$feature->bfd_case->title}</span><span class='nobelbold_24px_grey'><br>{$yearsago}<p style='line-height: 18px; margin: 0 !important;'></span><span class='nobelregular_18px_grey'><a href='{$feature->url}'>{$datetxt}</a><br><br>{$sanitizer->textarea($feature->bfd_text_before, $options = array('allowableTags' => '<a>, <em>, <strong>'))} {$ageoldtxt}{$nametxt} {$eventtxt}{$atagetxt} in {$placetxt}.<br>{$extratxt}</span></p></li></td></tr></table><hr>"; For instance, in Firefox the images don't scale, in Vienna RSS reader they do but none does any formatting except <em> , <b>, etc. The css url points to the CSS stylesheet used for other templates on the site.
  4. I have the same issue when entering a location and saving a page, the location is gone. Usually it works to enter the location again and save once more.
  5. That helped. Thanks! It still needs some polishing to get 'Monday 7th of December 0043bc' show up as 43bc but I'll figure that out. In case anybody's interested, calculating people's age in bc times results in negative numbers, my solution is: $atagetxt = str_replace('-', '', ' at the age of ' . ($eventyear - $birthyear));
  6. I click on the field, then type the numbers I want and hit return. Same for text, type the first few letters and the field moves to what I want, hit return.... On a MacBook Pro.
  7. I'm using three fields to calculate the date of an event, bfd_day, bfd_month and bfd_year. All are 'integer' fields. When 'bfd_year' is less than 100 the date turns into the 2000s. Cicero, died in 43bc suddenly died in 2043bc.... Would it make a difference if 'bfd_year' is a text or float field? And if so, will I keep all my data if I change the field from integer to text? Here's what I use to calculate the date: $day = $page->bfd_day->title; $month = $page->bfd_month->title; $year = $page->bfd_year; $fulldate = new DateTime("$year-$month-$day"); echo "{$fulldate->format("l jS \of F Y")}"; if(trim($page->bfd_date_bc->title)=='bc') { echo "bc"; }; $thisyear = date("Y"); if(trim($page->bfd_date_bc->title)=='bc') { echo $thisyear + $page->bfd_year . " years ago"; } else { echo $thisyear - $page->bfd_year . " years ago"; }; The 'years ago' calculation works fine, it says Cicero died 2056 years ago today.
  8. $features = $pages->find("parent=/events/, bfd_month.name=$month, bfd_day.name=$day, sort=bfd_day, sort=bfd_year, sort=name"); $markers = new PageArray(); foreach($features as $feature) { $markers->add($feature->bfd_events_places_id_list); } if ($markers && $feature->bfd_day) { $map = $modules->get('MarkupGoogleMap'); $options = array('width' => '100%', 'height' => '500px', 'zoom' => '4'); echo $map->render($markers, 'MapMarker', $options); } else { echo ""; }; When there are two identical markers (two events happening on the same day in the same place in above example), the map is not rendered.
  9. There appears to be a small bug with an AsmSelect input field. I have a list with numbers 01 to 31 as a 'day' field. Instead of scrolling down to numbers > 19 I type the number and hit return. Works fine with any number except '22'. Typing '22' results in '21' getting entered. To enter '22' I need to type '222'. A Catch 22 or an Easter egg?
  10. To pick this up again, I'm using twitterfeed.com to get a feed from a Blogger page and then send it to Twitter and several Facebook pages. I also get the feed with mailchimp.com and send it out as a daily mail to subscribers. All automatically as soon as a new post is added to Blogger. The posts at Blogger are scheduled to publish every day between 1.00 and 2.00 am to make sure everybody wakes up with suggestions for some celebrations of the day. I'm hoping to do this from ProcessWire from 1 January 2014 onwards, if possible also send the feed to Blogger as well.
  11. This doesn't change anything. The status of 'events' is 'on', months are off and days is 'on'. Same with all three solutions, my original one, yours and Diogo's. As soon as I've completed some more coding I'll start adding more content, including more BKK pictures into 'the eyes'.
  12. Huh, less is more I guess. Anyway, it works. Thank you! One more (additional) question: how do I keep the 'class' 'on' for months when events are shown? $class = $child === $page ? " class='on'" : ''; Keeps the parent 'on' but it should keep the parent of parent 'on' as well to have a better idea of the navigation. ps @ gebeer -> http://www.birthfactdeathcalendar.net/bfd_processwire/the-eyes/1-january-2000-bangkok-thailand/
  13. When I'm on '/events/months/january/january-02/' $page->parent->name=january I added a bit of code on the page to make it visible: <?php echo "<br><br>page name = {$page->name} / parent name = {$page->parent->name}<br>"; if ($page->parent->name==months) { echo "parent=/months/<br>"; } elseif ($page->parent->name==january) { echo "parent=/january/"; } else { echo "nope"; }; ?>
  14. In the same line of thought.... I have a menu with months and a submenu with days for every month. The idea is to click on a month's name, then a day's number and see a list of pages that have a matching 'month' and 'day' field. 'months' is a parent with 12 children (january, february,....), every month is a parent with 29, 30 or 31 children (january_01, january_02,....). When I'm on the 'months' page I see the '12-months' menu, when I click on a month I see the 'days menu'. But when I click on a day, the 'days menu' disappears. While the list of items for that month and day shows up correct. In the code below, where is my 'days menu' disappearing? <!-- NAVIGATION FOR MONTHS --> <div> <ul id='topnavmonths'> <?php $monthpage = $pages->get("/events/months/"); $children = $monthpage->children; foreach($children as $child) { $class = $child === $page ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; }; ?> </ul> </div> <br> <!-- NAVIGATION FOR DAYS --> <div> <ul id='topnavmonths'> <?php if ($page->parent->name==months) { $daypage = $pages->get("/events/months/$page->name/"); } else { $daypage = $pages->get("/events/months/$page->parent->name/"); }; $children = $daypage->children; foreach($children as $child) { $class = $child === $page ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->bfd_day->title}</a></li>"; }; ?> </ul> </div> For a (not) working example: http://www.birthfactdeathcalendar.net/bfd_processwire/events/
  15. YES! Thank you very much. I would never have thought of anything like this. Any idea where/how I can pimp by low/moderate php skills to handle such situations?
  16. When passing $features there is no map at all.... The MapMarker field is called into 'events' by a matching id, 'bfd_events_places_id_list' is the page id of a 'place' page. A 'place' page can be used for more than one event. When the id matches the fields from the 'place' page (name, street, city, state, country, MapMarker) are shown on the 'event' page, with the correct map. echo "{$placepage->MapMarker}"; shows the individual 'MapMarker' data in the foreach list but I can't find how to enter it in the $map->render(), except that it only shows the last marker.
  17. Trying to get multiple markers on a map. All found MapMarker entries show up in the list, but only the last one from the list shows up on the map. How do I get them all to show up on the map? $features = $pages->find("parent=/events/, bfd_day.name=$todayday, bfd_month.name=$todaymonth, sort=bfd_year"); foreach($features as $feature) { $placepage = $feature->bfd_events_places_id_list; echo "{$placepage->MapMarker}"; }; $map = $modules->get('MarkupGoogleMap'); $options = array('width' => '100%', 'height' => '400px'); echo $map->render($placepage, 'MapMarker', $options);
  18. Morning has broken - 'if( ) { }' followed by 'else { }' did the trick.
  19. Still wrestling with this.... $features = $pages->find("parent=/events/, bfd_day.name=$todayday, bfd_month.name=$todaymonth, sort=bfd_year"); foreach($features as $feature) { $namepage = $feature->bfd_events_people_id_list; if($namepage->bfd_people_occupation->title) { $occupation = ucfirst($namepage->bfd_people_occupation->title); }; if($namepage->bfd_people_original) { $originally = ", originally " . $namepage->bfd_people_original; }; if($namepage->bfd_people_alias) { $alias = " aka " . $namepage->bfd_people_alias; }; echo "{$occupation}<b><a href='{$namepage->url}'> {$namepage->bfd_people_name}</a>{$originally}{$alias}</b>"; results in: occupation1 name1 originally1 (= ok because there is no alias) occupation2 name2 originally1 alias2 (= not ok because it repeats originally1 while there is no originally) occupation2 name3 originally1 alias2 (= not ok because it repeats originally1 while there is no originally and it repeats alias2 while there is no alias) What am I doing wrong?
  20. Impressive site for an impressive offer of courses and events at the art center.
  21. Thank you. Some group permissions were not writable. Strange because I've been uploading pictures and creating lots of pages that will hold pictures in the near future. It all started with adding one module, if I remember right it might have been 'AutoUpgrade'. It kept showing a message that there was a new version of ProcessWire while there wasn't. Anyway, with 'ModuleManager' I presume the FTP errors will no longer occur.
  22. That works fine. This is the variable on 'bfd_events_births': $namepage = $pages->get("template=bfd_people, id=$page->bfd_events_people_id_list"); $occupation = ucfirst($namepage->bfd_people_occupation->title); if($namepage->bfd_people_original) { $originally = ", originally " . $namepage->bfd_people_original; }; if($namepage->bfd_people_alias) { $alias = " aka " . $namepage->bfd_people_alias; }; $page->namecalc = array('<b><a href=', $namepage->url, '>', $occupation, ' ', $namepage->bfd_people_name_first, ' ', $namepage->bfd_people_name_last, $originally, $alias, '</a></b> is born '); foreach($page->namecalc as $f) { echo "$f"; }; This is more complicated. The variable should show up in a list on the home page. That list gets information from any child page/template from parent '/events/'. So, what should I understand from '345'? And can I assume that 'namecalc' is the varname in my example? And in general where can one find/learn more about this, preferably in plain language?
  23. I have an 'events_births' template that has a date field and then calls a name and place from a 'people' and 'places' page. Both 'name' and 'place' require some calculation from their respective pages, some people have original names or aliases, some places have a name and street address, while others haven't. They are calculated in '$namecalc' and '$placecalc'. Now I want to use the '$namecalc' and '$placecalc' show up in a list of events. I manage to list the date field, but find no way for the other information. Secondly I'd like the '$placecalc' items show up on a map.... My code on the 'events_births' template: // NAME FROM PEOPLE PAGE $namepage = $pages->get("template=bfd_people, id=$page->bfd_events_people_id_list"); $occupation = ucfirst($namepage->bfd_people_occupation->title); if($namepage->bfd_people_original) { $originally = ", originally " . $namepage->bfd_people_original; }; if($namepage->bfd_people_alias) { $alias = " aka " . $namepage->bfd_people_alias; }; $namecalc = "<b><a href='{$namepage->url}'>{$occupation} {$namepage->bfd_people_name_first} {$namepage->bfd_people_name_middle} {$namepage->bfd_people_name_last}{$originally}{$alias} </a></b> is born "; echo $namecalc; // LOCATION FROM PLACES PAGE $placepage = $pages->get("template=bfd_places, id=$page->bfd_events_places_id_list"); if($placepage->bfd_places_name) { $name = $placepage->bfd_places_name . ", "; }; if($placepage->bfd_places_street) { $street = $placepage->bfd_places_street . ", "; }; if($placepage->bfd_places_district) { $district = $placepage->bfd_places_district . ", "; }; if($placepage->bfd_places_state) { $state = $placepage->bfd_places_state->title . ", "; }; $placecalc = "in <b><a href='{$placepage->url}'>{$name}{$street}{$district}{$placepage->bfd_places_city->title}, {$placepage->bfd_places_state->title}{$placepage->bfd_places_country->title}</a></b>."; echo $placecalc; On the list page: echo "<span class='nobelbold_32px'>" . date("j") . " " . date ("F") . "</span><br><br>"; $todayday = date("d"); $todaymonth = date("m"); $features = $pages->find("parent=/events/, bfd_day.name=$todayday, bfd_month.name=$todaymonth, sort=bfd_year"); foreach($features as $feature) $name = $feature->get("$nameresult"); echo "<li><span class='nobelbold_24px_grey'><a href='{$feature->url}'>{$feature->bfd_year}</a> {$feature->bfd_case->title} {$name}</span></li>"; $mapitems = $pages->find("parent=/events/, bfd_day.name=$todayday, bfd_month.name=$todaymonth, MapMarker=' ', sort=bfd_year"); $map = $modules->get('MarkupGoogleMap'); echo "<br>{$map->render($mapitems, 'MapMarker', array('height' => '400px', 'zoom' => '2', 'lat' => '50.923813', 'lng' => '4.431493'))}"; Needless to say that my PHP knowledge is limited compared to most here.... thanks anyway.
  24. There are two files 'Modules.23ca944d3100b563ecd52f1f9374d4c3.cache' and 'Modules.93208021ee90fbcf7e364f5ed7d1b95d.cache'. The first one has a list of 110 module names, the second one a list of 6. Removing them results in 'The server encountered an internal error or misconfiguration and was unable to complete your request'. Any chance of editing the cache files in a text editor and solve the problem? Or delete them all and re-install, starting with the Modules Manager perhaps.... Edit. I manually edited 'Modules.93208021ee90fbcf7e364f5ed7d1b95d.cache' with the missing module names, and they are all back! Yay.
×
×
  • Create New...