QRC generator (the regular plugin, not the one from Jerry or CMSB Cookbook)

4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 28, 2022   (RSS)

By daniel - April 12, 2022

Hi Codee,

It looks like the QR code was not generating the event dates with the correct timezone reference, so everything was being created in UTC. In the QRCodeGenerator.php plugin file, can you try replacing this line (at or around line 48):

  elseif ($type == 'event')         { $data = "BEGIN:VEVENT:\nSUMMARY:" . $options['title'] . "\nDTSTART:" . gmdate("Ymd\THis", strtotime($options['start'])) . "\nDTEND:" . gmdate("Ymd\THis", strtotime($options['end'])) . "\nEND:VEVENT";  }

with this:

  elseif ($type == 'event')         { $data = "BEGIN:VEVENT\nSUMMARY:" . $options['title'] . "\nDTSTART;TZID=".date_default_timezone_get().":" . date("Ymd\THis", strtotime($options['start'])) . "\nDTEND:" . date("Ymd\THis", strtotime($options['end'])) . "\nEND:VEVENT"; echo $data;  }

Let me know if this works for you!

Thanks,

Daniel
Technical Lead
interactivetools.com

By Codee - June 28, 2022

Hi Daniel,

Sorry for the delay in responding ~ I literally just got back to this part of their project.  Your solution mostly worked. I have attached a screen shot of the before and after.  While the time for the event was pulled, correctly, from the default/globals as you wrote, unfortunately a bunch of text was inserted between the title "Calendar Event" (in red) and the qr code sample just below it. 

If we can correct that portion then we have a solid fix.

Thank you kindly!

By daniel - June 28, 2022

Hey Codee,

It looks like some debugging code got left in the sample, so I you should just need to remove "echo $data;" so it looks like this:

 elseif ($type == 'event')         { $data = "BEGIN:VEVENT\nSUMMARY:" . $options['title'] . "\nDTSTART;TZID=".date_default_timezone_get().":" . date("Ymd\THis", strtotime($options['start'])) . "\nDTEND:" . date("Ymd\THis", strtotime($options['end'])) . "\nEND:VEVENT"; }

Can you try that out and let me know if it works?

Thanks,

Daniel
Technical Lead
interactivetools.com