Jump to content
joshuag

Recurme – Processwire Recurring Dates Field & Custom Calendar Module.

Recommended Posts

On September 8, 2017 at 0:14 PM, SoccerGuy3 said:

Working on the detail page now and having a problem getting the date/time of the event to show on the page. If my page array contains this:


[calev_datetime] => {"startDate":1504821600,"endDate":false,"dates":["W36/07/Thu/Sep/2017",...,"W19/07/Wed/May/2025"],"excluded":[],"active":false,"showResults":false,"rrule":"WKST=MO;FREQ=DAILY;DTSTART=20170907T150000Z;INTERVAL=1"}

How can I get the date to output to the page like: 09/07/2017 3:00 pm? I've tried various bits and pieces to get at the startDate or the DTSTART, but always end up with a nothing on screen (in that area).

$event = $recurme->event($page); then use $event->orig_date

Page/$event
	->template
	->orig_date
	->original
		->getDates()
	->start_date
	->dates_count
	->end_date
	->rrule
	->title
	->timestamp
	->time
	->date
	->day
	->month
	->year
	->hour
	->minute
	->second
	->ampm

Share this post


Link to post
Share on other sites
On September 7, 2017 at 5:50 PM, SoccerGuy3 said:

Love the promise of this module. Should save me a bunch of time on this project.

what was the problem? Maybe other people have seen this error? 

Share this post


Link to post
Share on other sites

Answer was actually in the FAQ! :) 

Ajax is not working.

Please make sure that your site contains a hidden page home/recurme-ajax/ using the template "recurme-ajax" and that you have a matching file in your site/templates/ folder. IF for some reason this file is missing, you can copy the template file from the InputfieldRecur/templates/recurme-ajax.php.

Share this post


Link to post
Share on other sites
2 hours ago, joshuag said:

$event = $recurme->event($page); then use $event->orig_date


Page/$event
	->template
	->orig_date
	->original
		->getDates()
	->start_date
	->dates_count
	->end_date
	->rrule
	->title
	->timestamp
	->time
	->date
	->day
	->month
	->year
	->hour
	->minute
	->second
	->ampm

I tried that:

                        $event = $recurme->event($page);
                        echo $event->orig_date . 'x';


But all that outputs to the screen is the "X".

I "solved" it temporarily with:

                        $dates = $page->getDates();
                        foreach($dates as $key=>$date){
                            $evDate = date('F j, Y \a\t g:i A', $date);
                            }

Which isn't going to work I suspect long term.

Share this post


Link to post
Share on other sites
1 hour ago, SoccerGuy3 said:

No. Tried: template, original, rrule, month. All with the same result, that is nothing was output.

sent you a private message to hunt this down. :)

  • Like 1

Share this post


Link to post
Share on other sites
On 08/09/2017 at 9:27 AM, joshuag said:

I am trying to solve this problem. I cannot reproduce the error. Making it a bit hard to debug.  I tried removing the circular reference to what modules each file installs. Made no difference to me. 

@Robin S any other ideas? 

@joshuag, I think I have fixed the uninstallation issue. I found a few other issues in the module code too - I will PM you with the details.

  • Like 2

Share this post


Link to post
Share on other sites
16 hours ago, Robin S said:

@joshuag, I think I have fixed the uninstallation issue. I found a few other issues in the module code too - I will PM you with the details.

Amazing! Thank you. 

Share this post


Link to post
Share on other sites
8 minutes ago, SoccerGuy3 said:

@joshuag - Sent you a PM followup to the open issue and an additional question...

sent you a revisions. fingers crossed. 

Share this post


Link to post
Share on other sites
6 minutes ago, SoccerGuy3 said:

My client wants to print the page with the Calendar Grid. When you print, the grid prints, but not the individual items. Anyone run across this?

Update: Appears to be browser specific. 

Mac Chrome: Grid only, no details

Mac FF: Everything prints.

Share this post


Link to post
Share on other sites

I was working on a development site (ProcessWire 3.0.75 and PHP 7.0) and downloaded a copy of Recurme to use.  Once I got the module installed, I was confronted with a non-working site.  I SFTP'd to the site and removed the Recurme module.  I was still confronted with the following error:

rm-error1.thumb.png.ee544e65d1d429c996e99df58629164e.png

I was able to revert to a previous version of ProcessWire (3.0.62), which allowed me administrative access to the site again.

rm-error2.png.d8bd2c6928cfe3cc5b651027068dc5b1.png

I haven't had this occur before, so I was a little surprised when I lost all access to the site.  I had good backups, however I was glad I was able to downgrade the ProcessWire version to regain access.  It took awhile to remove all traces of Recurme from the site, however things seem to be back to normal.

Anything information that you could provide on how to get Recurme working or where I possibly went wrong, would be greatly appreciated.

Best Regards,

Charles

Share this post


Link to post
Share on other sites
6 minutes ago, cstevensjr said:

I was still confronted with the following error:

rm-error1.thumb.png.ee544e65d1d429c996e99df58629164e.png

That error from the Repeater module looks like the same thing I raised a GitHub issue for recently, so there's a good chance it relates to PW's caching of module data rather than Recurme specifically. Ryan has pushed a fix for the issue to the dev branch.

  • Like 2

Share this post


Link to post
Share on other sites
6 minutes ago, Robin S said:

hat error from the Repeater module looks like the same thing I raised a GitHub issue for recently, so there's a good chance it relates to PW's caching of module data rather than Recurme specifically. Ryan has pushed a fix for the issue to the dev branch.

Thanks for speaking up about this.

Share this post


Link to post
Share on other sites

I could not find a way to get the value of the "all day" checkbox and found out that its state is hard-coded (checked) in InputfieldRecurme.module. I need to differentiate between "all day" and "normal" events and output them differently on a clients website. Could you please implement something like a $event->allDay property?

Thanks!

Share this post


Link to post
Share on other sites

@joshuag Early on in the thread you mentioned a work-in-progress fix for the 2800 event limit, and also about a more elegant update feature when adding exclusions. Any update on this? I've scanned the posts in the rest of the thread but might have missed it. Have these issues been addressed in the current version?

Share this post


Link to post
Share on other sites

I'm having a similar problem to SoccerGuy above.
All I'm trying to do is display the start date of an event on the event's page, and I can't help feeling this shouldn't be this hard. What have I missed?

Experiment 1 -

$content .= $recurme->renderEvent($page); 

This returns 

<li><a href="?date=" title="Test Event 1">Test Event 1</a></li>

where Test Event 1 is the title of the current page. 

Experiment 2 - 

$rcoptions = ['timeFormat'	=> 'g:i a',
'dateFormat' 	=> 'M d, Y @ g:i a',
'dayFormat'		=> 'd',
'monthFormat'	=> 'M',
'yearFormat'	=> 'Y',
'hourFormat'	=> 'g',
'minuteFormat'	=> 'i',
'secondFormat'	=> 's',
'ampmFormat'	=> 'a',
'xBefore' 		=> 'TEST',
'xItem'			=> '{time} &bull; <a href="{link}" title="{timestamp}">ABCDEF{timestamp}</a>',
'xAfter'		=> ''];
$content .= $recurme->renderEvent($page, $rcoptions); 

This returns the same thing as the first experiment, apparently ignoring the $rcoptions object I passed in. Note that I attempted to change the xItem element, but no joy.

Experiment 3

$event = $recurme->event($page);
$content .= "Event: " . $event;
$content .= "Orig Date: " . $event->orig_date;

This outputs Event: and Orig Date: strings, but nothing else.

Clearly I have no idea what I'm doing - any guidance appreciated.

Share this post


Link to post
Share on other sites
On 19/12/2017 at 10:56 PM, netcarver said:

@joshuag Early on in the thread you mentioned a work-in-progress fix for the 2800 event limit, and also about a more elegant update feature when adding exclusions. Any update on this? I've scanned the posts in the rest of the thread but might have missed it. Have these issues been addressed in the current version?

+1

I would be interested as well.

Share this post


Link to post
Share on other sites
On 1/3/2018 at 5:34 PM, Smoo said:

I'm having a similar problem to SoccerGuy above.
All I'm trying to do is display the start date of an event on the event's page, and I can't help feeling this shouldn't be this hard. What have I missed?

Experiment 1 -


$content .= $recurme->renderEvent($page); 

This returns 


<li><a href="?date=" title="Test Event 1">Test Event 1</a></li>

where Test Event 1 is the title of the current page. 

Experiment 2 - 


$rcoptions = ['timeFormat'	=> 'g:i a',
'dateFormat' 	=> 'M d, Y @ g:i a',
'dayFormat'		=> 'd',
'monthFormat'	=> 'M',
'yearFormat'	=> 'Y',
'hourFormat'	=> 'g',
'minuteFormat'	=> 'i',
'secondFormat'	=> 's',
'ampmFormat'	=> 'a',
'xBefore' 		=> 'TEST',
'xItem'			=> '{time} &bull; <a href="{link}" title="{timestamp}">ABCDEF{timestamp}</a>',
'xAfter'		=> ''];
$content .= $recurme->renderEvent($page, $rcoptions); 

This returns the same thing as the first experiment, apparently ignoring the $rcoptions object I passed in. Note that I attempted to change the xItem element, but no joy.

Experiment 3

On 1/3/2018 at 5:34 PM, Smoo said:

I'm having a similar problem to SoccerGuy above.
All I'm trying to do is display the start date of an event on the event's page, and I can't help feeling this shouldn't be this hard. What have I missed?

Experiment 1 -



$content .= $recurme->renderEvent($page); 

This returns 



<li><a href="?date=" title="Test Event 1">Test Event 1</a></li>

where Test Event 1 is the title of the current page. 

Experiment 2 - 



$rcoptions = ['timeFormat'	=> 'g:i a',
'dateFormat' 	=> 'M d, Y @ g:i a',
'dayFormat'		=> 'd',
'monthFormat'	=> 'M',
'yearFormat'	=> 'Y',
'hourFormat'	=> 'g',
'minuteFormat'	=> 'i',
'secondFormat'	=> 's',
'ampmFormat'	=> 'a',
'xBefore' 		=> 'TEST',
'xItem'			=> '{time} &bull; <a href="{link}" title="{timestamp}">ABCDEF{timestamp}</a>',
'xAfter'		=> ''];
$content .= $recurme->renderEvent($page, $rcoptions); 

This returns the same thing as the first experiment, apparently ignoring the $rcoptions object I passed in. Note that I attempted to change the xItem element, but no joy.

Experiment 3



$event = $recurme->event($page);
$content .= "Event: " . $event;
$content .= "Orig Date: " . $event->orig_date;

This outputs Event: and Orig Date: strings, but nothing else.

Clearly I have no idea what I'm doing - any guidance appreciated.

This outputs Event: and Orig Date: strings, but nothing else.

Clearly I have no idea what I'm doing - any guidance appreciated.

I must not be the only one. I've tried all of the above and emailed. Any help would be appreciated

$event = $recurme->event($page);

I try to output any thing and it's blank.

 

Share this post


Link to post
Share on other sites

Seems to be broken when looking for dates in Feb 2018, April 2018, June 2018 etc no show up event though there should be.

Share this post


Link to post
Share on other sites
19 hours ago, SC24 said:

I must not be the only one. I've tried all of the above and emailed. Any help would be appreciated

$event = $recurme->event($page);

I try to output any thing and it's blank.

 

$event = $recurme->event($page); is 100% correct way to get the event. However, you must have a recurme field with an event for it to return anything. After that, you can access all your fields for that $page as 

$event->orignal->title (or whatever field you have)

Hope this helps,

- Joshua

Share this post


Link to post
Share on other sites
2 hours ago, joshuag said:

$event = $recurme->event($page); is 100% correct way to get the event. However, you must have a recurme field with an event for it to return anything. After that, you can access all your fields for that $page as 

$event->orignal->title (or whatever field you have)

Hope this helps,

- Joshua

My admin side looks like the attached image.

On the front end I am calling:

doman/events/library/ready-to-learn-story-time-multi/?date=1517514600

$event = $recurme->event($page);

The following outputs nothing:

echo $event->title;

echo $event->original->title;

...etc.

Capture.PNG

Share this post


Link to post
Share on other sites

OK - I have found a temporary solution...I have found that if I set the event to recurring, then the data is output as normal. If I leave it as a single event, that is when my data comes back blank.

I replaced my code with the module file that Josh added on page 2, however, that made all my events recurring regardless if it was active or not(but fields were showing values).

So, now I am using the default code that came with the module(not page 2 code). Except on my event detail page, I am using the $page object. From there I am using json_decode($page->Recurme_Field), then outputting my fields from there.

 

detail page sample:

$o = json_decode($page->Recurme_Field);
echo $page->title ."<br/>";
echo date('M d, Y g:i A', $o->startDate) . "<br/>";
echo date('M d, Y g:i A', strtotime($page->Recurme_End_Date_Time)) . "<br/>";
echo $page->Recurme_Location . "<br/>";
echo $page->Recurme_Details;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      A community member raised a question and I thought a new sanitizer method for the purpose would be useful, hence...
      Sanitizer Transliterate
      Adds a transliterate method to $sanitizer that performs character replacements as defined in the module config. The default character replacements are based on the defaults from InputfieldPageName, but with uppercase characters included too.
      Usage
      Install the Sanitizer Transliterate module.
      Customise the character replacements in the module config as needed.
      Use the sanitizer on strings like so:
      $transliterated_string = $sanitizer->transliterate($string);
       
      https://github.com/Toutouwai/SanitizerTransliterate
      https://modules.processwire.com/modules/sanitizer-transliterate/
       
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version to 2.10, add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "http://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


    • By thomasaull
      I created a little helper module to trigger a CI pipeline when your website has been changed. It's quite simple and works like this: As soon as you save a page the module sets a Boolean via a pages save after hook. Once a day via LazyCron the module checks if the Boolean is set and sends a POST Request to a configurable Webhook URL.
      Some ideas to extend this:
      make request type configurable (GET, POST) make the module trigger at a specified time (probably only possible with a server cronjob) trigger manually Anything else? If there's interest, I might put in some more functionality. Let me know what you're interested in. Until then, maybe it is useful for a couple of people 🙂
      Github Repo: https://github.com/thomasaull/CiTrigger
    • By Robin S
      I created this module a while ago and never got around to publicising it, but it has been outed in the latest PW Weekly so here goes the support thread...
      Unique Image Variations
      Ensures that all ImageSizer options and focus settings affect image variation filenames.

      Background
      When using methods that produce image variations such as Pageimage::size(), ProcessWire includes some of the ImageSizer settings (height, width, cropping location, etc) in the variation filename. This is useful so that if you change these settings in your size() call a new variation is generated and you see this variation on the front-end.
      However, ProcessWire does not include several of the other ImageSizer settings in the variation filename:
      upscaling cropping, when set to false or a blank string interlace sharpening quality hidpi quality focus (whether any saved focus area for an image should affect cropping) focus data (the top/left/zoom data for the focus area) This means that if you change any of these settings, either in $config->imageSizerOptions or in an $options array passed to a method like size(), and you already have variations at the requested size/crop, then ProcessWire will not create new variations and will continue to serve the old variations. In other words you won't see the effect of your changed ImageSizer options on the front-end until you delete the old variations.
      Features
      The Unique Image Variations module ensures that any changes to ImageSizer options and any changes to the focus area made in Page Edit are reflected in the variation filename, so new variations will always be generated and displayed on the front-end.
      Installation
      Install the Unique Image Variations module.
      In the module config, set the ImageSizer options that you want to include in image variation filenames.
      Warnings
      Installing the module (and keeping one or more of the options selected in the module config) will cause all existing image variations to be regenerated the next time they are requested. If you have an existing website with a large number of images you may not want the performance impact of that. The module is perhaps best suited to new sites where image variations have not yet been generated.
      Similarly, if you change the module config settings on an existing site then all image variations will be regenerated the next time they are requested.
      If you think you might want to change an ImageSizer option in the future (I'm thinking here primarily of options such as interlace that are typically set in $config->imageSizerOptions) and would not want that change to cause existing image variations to be regenerated then best to not include that option in the module config after you first install the module.
       
      https://github.com/Toutouwai/UniqueImageVariations
      https://modules.processwire.com/modules/unique-image-variations/
    • By Sebi
      I've created a small module which lets you define a timestamp after which a page should be accessible. In addition you can define a timestamp when the release should end and the page should not be accessable any more.
      ProcessWire-Module: http://modules.processwire.com/modules/page-access-releasetime/
      Github: https://github.com/Sebiworld/PageAccessReleasetime
      Usage
      PageAccessReleasetime can be installed like every other module in ProcessWire. Check the following guide for detailed information: How-To Install or Uninstall Modules
      After that, you will find checkboxes for activating the releasetime-fields at the settings-tab of each page. You don't need to add the fields to your templates manually.
      Check e.g. the checkbox "Activate Releasetime from?" and fill in a date in the future. The page will not be accessable for your users until the given date is reached.
      If you have $config->pagefileSecure = true, the module will protect files of unreleased pages as well.
      How it works
      This module hooks into Page::viewable to prevent users to access unreleased pages:
      public function hookPageViewable($event) { $page = $event->object; $viewable = $event->return; if($viewable){ // If the page would be viewable, additionally check Releasetime and User-Permission $viewable = $this->canUserSee($page); } $event->return = $viewable; } To prevent access to the files of unreleased pages, we hook into Page::isPublic and ProcessPageView::sendFile.
      public function hookPageIsPublic($e) { $page = $e->object; if($e->return && $this->isReleaseTimeSet($page)) { $e->return = false; } } The site/assets/files/ directory of pages, which isPublic() returns false, will get a '-' as prefix. This indicates ProcessWire (with activated $config->pagefileSecure) to check the file's permissions via PHP before delivering it to the client.
      The check wether a not-public file should be accessable happens in ProcessPageView::sendFile. We throw an 404 Exception if the current user must not see the file.
      public function hookProcessPageViewSendFile($e) { $page = $e->arguments[0]; if(!$this->canUserSee($page)) { throw new Wire404Exception('File not found'); } } Additionally we hook into ProcessPageEdit::buildForm to add the PageAccessReleasetime fields to each page and move them to the settings tab.
      Limitations
      In the current version, releasetime-protected pages will appear in wire('pages')->find() queries. If you want to display a list of pages, where pages could be releasetime-protected, you should double-check with $page->viewable() wether the page can be accessed. $page->viewable() returns false, if the page is not released yet.
      If you have an idea how unreleased pages can be filtered out of ProcessWire selector queries, feel free to write an issue, comment or make a pull request!
×
×
  • Create New...