7 years ago
Topic

Hi

I'm trying to allow some iCAL export of our Seblod Events but maybe someone already wrote some typo plugin that would do it ?

thanks

cyril

Get a VIP membership
6 years ago
0
Level 1

Hi Cyril,

I want something like that too... Did you code your own?

Cheers,

Elisa

6 years ago
1
Level 1

Hi Elisa

Yes here is what we did:

1- we first have some ICS layout file (ics.php file in the layouts folder)

 

BEGIN:VCALENDAR 

VERSION:2.0 

PRODID:-//hacksw/handcal//NONSGML v1.0//EN 

BEGIN:VEVENT 

DTSTART;TZID=:

DTEND;TZID=:

RRULE:FREQ=  

SUMMARY: 

LOCATION: 

DESCRIPTION: 

END:VEVENT 

END:VCALENDAR

2- at the record time fo the event we launch an aftersotre code:

// No Direct Access 

defined( '_JEXEC' ) or die;

jimport( 'joomla.filesystem.file' ); 

$app=JFactory::getApplication(); 

$isNew=$config['isNew']; 

$event=JCckContent::getInstance( $config['id'] ); 

$ics_file='images/event/ics/' . $config['pk'] . '/' . $event->get( 'alias' ) . '.ics'; 

$ics_layout=new JLayoutFile( 'ics' ); 

$ics_content=$ics_layout->render( $fields ); 

JFile::write( JPATH_ROOT . '/' . $ics_file, $ics_content ); 

$event->save( 'more', array( 'ics_file'=>$ics_file ) );

3- in the content view we have a before display code:

$id=$fields['art_id']->value; 

$title=$fields['art_alias']->value; 

$url=JURI::root(); 

$domain=substr($url,7); 

$label=JText::_(iCal) ; 

$ical="<a href='webcal://".$domain."images/event/ics/".$id."/".$title.".ics"." ' >$label</a>";

$fields['ev_event_lien_ics']->html=$ical; 

$fields['ev_event_lien_ics']->value=$ical; 

6 years ago
0
Level 2

Cool thank you! Will try it out today. Much thanks!!!

6 years ago
0
Level 1

Hi Cyril,

how does your layout file actually look like? I tried with:

BEGIN:VCALENDAR VERSION:2.0 PRODID:-//hacksw/handcal//NONSGML v1.0//EN BEGIN:VEVENT DTSTART;TZI D=:<?php echo $fields['fair_start_date']->value; ?>

DTEND;TZID=:<?php echo $fields['fair_end_date']->value; ?>

RRULE:FREQ= SUMMARY: LOCATION:<?php echo $fields['fair_location']->value; ?>

DESCRIPTION:<?php echo $fields['introtext']->value; ?> / <?php echo $fields['fair_booth']->value; ?>

END:VEVENT END:VCALENDAR <br> <br>

But it does not retrieve the values... Maybe i do something wrong.

The ics is created but only with the Layout file text (without contents)

Thanks,

Elisa

6 years ago
0
Level 1

Got it, using $displayData instead of $fields, thanks !!

Get a Book for SEBLOD