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
5 minutes ago, joshuag said:

@SoccerGuy3 is it returning any of the other properties/variables? 

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

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

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?

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Soma
      LogMaintenance
      A simple ProcessWire module to give some maintenance control over log files. I found myself often having lots of log files for different things that can grow more or less quickly to a size where they can be difficult to maintain. The built in Logger of PW does a good job of giving you the possibility to delete or prune logs. But it has to be done manually and sometimes a log grows into millions of lines, which makes it often impossible to even prune it as it's too large.
      LogMaintenance uses LazyCron to run the maintenance task and there's several settings you can setup on a global or per log basis.
      Archive: will create zip files for each log file in logs/archive/ folder and add the log each time the maintenance is run to a subfolder containing the datetime.
      Lines: keeps logs to a certain number of lines 
      Days: keeps the log to a certain number of days
      Bytes: keeps the log to a certain amount of bytes
      Each setting is checked from top down, the first setting to contain something is used. So if you check the "Archive" option, all other settings are ignored and logs are archived everytime the LazyCron is executed. If you want to keep your logs to a certain amount of bytes just leave all other settings to 0 or blank.
      Per Log Settings
      There's a textarea that you can use to setup a config for a specific log file one per line. All the logs you define here ignore the global settings above. The syntax for the settings is:
      logname:[archive]:[lines]:[days]:[bytes] 
      errors:1:0:0:0 // would archive the errors log messages:0:10000:0:0 // will prune the errors log to 10000 lines  
      The module can be found on github for you to check out. It's still fresh and I'm currently testing.
      https://github.com/somatonic/LogMaintenance
    • By teppo
      Fieldtype Page IDs is a third party Fieldtype that, simply put, stores Page references as integers (Page IDs).
      This fieldtype was built as a quick and dirty workaround for Page Reference fields' inability handle self-references due to circular reference issues. A project I've been working on for a while now includes a combination of RepeaterMatrix content blocks and tagging/categorization system that would've resulted in a lot of duplicate pages (and plenty of unnecessary manual work for content editors) had I used built-in Page Reference fields, and thus a new Fieldtype felt like the most sensible approach.
      Fieldtype Page IDs was designed to be loosely compatible with Page References in order to make conversions between the two feasible, but it is quite limited feature wise:
      largely due to the fact that stored values are actually just integers with no connection to Pages whatsoever some advanced selectors and related features are not supported, and page values can't be directly accessed configuration settings are limited to the bare essentials (selector string and Inputfield class) only a handful of Inputfields (AsmSelect, Checkboxes, Text) are (currently) supported Anyway, in case you need to store Page IDs (and Page IDs only) and are happy with the limitations mentioned above, feel free to give this Fieldtype a try. It has been working fine for me in one particular project, but hasn't been tested that much, so please tread carefully – and let me know if you run into any issues.
      GitHub repository: https://github.com/teppokoivula/FieldtypePageIDs
      Modules directory: https://modules.processwire.com/modules/fieldtype-page-ids/
    • By daniels
      This is a lightweight alternative to other newsletter & newsletter-subscription modules.
      You can find the Module in the Modules directory and on Github
      It can subscribe, update, unsubscribe & delete a user in a list in Mailchimp with MailChimp API 3.0. It does not provide any forms or validation, so you can feel free to use your own. To protect your users, it does not save any user data in logs or sends them to an admin.
      This module fits your needs if you...
      ...use Mailchimp as your newsletter / email-automation tool ...want to let users subscribe to your newsletter on your website ...want to use your own form, validation and messages (with or without the wire forms) ...don't want any personal user data saved in any way in your ProcessWire environment (cf. EU data regulation terms) ...like to subscribe, update, unsubscribe or delete users to/from different lists ...like the Mailchimp UI for creating / sending / reviewing email campaigns *I have only tested it with PHP 7.x so far, so use on owners risk
      EDIT:
      I've updated the module to 0.0.4. I removed the instructions from this forum, so I don't have to maintain it on multiple places. Just checkout the readme on github 🙂
      If you have questions or like to contribute, just post a reply or create an issue or pr on github. 
    • By bernhard
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://modules.processwire.com/modules/rock-finder/
      https://gitlab.com/baumrock/RockFinder/tree/master
       
      Changelog
      180528, v1.0.4 add custom select statement option 180516 change sql query method, bump version to 1.0.0 180515 multilang bugfix 180513 beta release <180513 preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/
    • By blynx
      Hej,
      A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated
      (Also pull requests are appreciated 😉 - have a new Job now and don't work a lot with ProcessWire anymore, yet, feel free to contact me here or on GitHub, Im'm still "online"!)

      Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe
      .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip
      You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method:
      <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so:
      <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe
      What do you think? Any ideas, bugs, critique, requests?
      cheers
      Steffen