Stijn

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • in reply to: iCal export does not include attached images #16031
    Stijn
    Member

    We’ve currently solved the problem by hacking the filter code into the 2.0.4 code. Obviously this is not desirable (after an update it won’t work anymore), but we could not find a better solution.

    We made the following addition to events-calendar-pro.php (I hope it formats well, I’m not sure what tags are supported here)

    public function iCalFeed( $post = null, $eventCatSlug = null, $eventDate = null ) {

    foreach( $eventPosts as $eventPost ) {

    $events .= “LOCATION:” . html_entity_decode($tribeEvents->fullAddressString( $eventPost->ID ), ENT_QUOTES) . “\n”;
    $events .= “URL:” . get_permalink( $eventPost->ID ) . “\n”;

    /////////////// HACK ///////////////////////////////////
    $attachments_args = array(
    ‘post_type’ => ‘attachment’,
    ‘numberposts’ => -1,
    ‘post_status’ => null,
    ‘post_parent’ => $eventPost->ID
    );

    $size = ‘full’;

    $attachments = get_posts($attachments_args);
    if ($attachments) {
    foreach ($attachments as $attachment) {
    $image_attributes = wp_get_attachment_image_src($attachment->ID, $size);
    $events .= “ATTACH:”.$image_attributes[0].”\n”;
    }
    }
    /////////////// END OF HACK //////////////////////////////

    $events .= “END:VEVENT\n”;
    }


    }

    in reply to: iCal export does not include attached images #16026
    Stijn
    Member

    Hey Rob. I figured it wouldn’t be a very good idea to have both versions active, but I thought that was what you meant. Nothing got ruined fortunately 🙂

    It’s a pretty odd issue this one, too bad we can’t find a solution for it. We were almost there! I’ll see if we can find a workaround to achieve the desired effect. If you know some other way to get an export of all events with attached image, I’d be very interested to hear it.

    Either way, thanks for the help!

    in reply to: iCal export does not include attached images #15928
    Stijn
    Member

    Rob, I’ve updated to 2.0.4 which makes the setup:

    – The Events Calendar 2.0.4 (active)
    – The Events Calendar 2.1 (active)
    – Events Calendar PRO 2.0.4 (active)
    – Events Calendar PRO 2.1 (active)

    Unfortunately this setup still results in the same behaviour: the number of events in the export is limited to the “number of events in the loop” setting. Disabling the 2.0.4 plugins does not change anything. Disabling the 2.1 plugins makes the iCal export show all events but obviously the attachments wont show up anymore.

    The code provided by Nick does work however and I can see ATTACH-ed urls for each attached image, which is great! Any other ideas on how to resolve this issue? Which of the files of the plugin generates the iCal export, maybe I can have a look myself.

    Thanks!

    in reply to: iCal export does not include attached images #15825
    Stijn
    Member

    Hi Rob. That is correct, when I set the number of events in the loop to 3, only 3 events appear in the ical import. Could it be because we currently have both version 2.0.3 and 2.1 installed (with 2.0.3 deactivated)? Would it help to remove the 2.0.3 version of the plugin, or would that also delete the events data?
    Or maybe there is some kind of conflict with another plugin (seems rather far fetched)?
    Thanks!

    in reply to: iCal export does not include attached images #15715
    Stijn
    Member

    Guys,

    I’ve added the 2.1 plugins you provided to WordPress using the “upload plugin” function. It now shows up next to the version we already had installed (2.0.3) but we deactivated the ‘old’ version.

    The plugin works for as far as I tested it, but the iCal export now only includes 10 events instead of all. It appears that changing the “Number of events to show per page in the loop” setting changes the number of events in the iCal export (as well as the number of events on the List page).

    I’m not sure if this is intended behaviour for 2.1, but it seems like a bug. What can I do to change it back to export all events? Thanks!

    in reply to: iCal export does not include attached images #15255
    Stijn
    Member

    Sounds great! Thanks for the code Nick.

    Rob (I hope you still monitor this thread), is it possible to receive a copy of the 2.1 dev branch like Nick suggested? If it is not ready (tested) yet, could you give me an indication of when we could receive it? Also, when is version 2.1 to be released (roughly)?

    Thanks

    in reply to: iCal export does not include attached images #15217
    Stijn
    Member

    True.

    For our case we just need the urls of the images attached to an event (post) to show up in the feed, but I very much understand your point. I’ll see what I can do for now!

    in reply to: iCal export does not include attached images #15153
    Stijn
    Member

    Alright, too bad there is no solution ready. If you could give me some additional pointers on how to implement an immediate solution that would be great (maybe you have an example on something similar?). My php is a bit rusty…

    Many thanks for your help. If I manage to implement this addition I’ll post it here for everyone to enjoy.

    Cheers!

    in reply to: iCal export does not include attached images #15146
    Stijn
    Member

    Hi Nick,

    We’re trying to include the calendar from our (wordpress) website in an iOS application. In order to do this we need some way to import the calendar data in our app and the iCal feed seemed like the best way to do this. If there is another way to accomplish this (like a JSON or XML feed), please let me know.

    My example is based on RFC 2445 which describes the iCalendar format if i’m correct.
    http://www.ietf.org/rfc/rfc2445.txt

    It contains ATTACH lines with an URL in several examples like here:

    ——————
    4.1.3 Binary Content

    Binary content information in an iCalendar object SHOULD be
    referenced using a URI within a property value. That is the binary
    content information SHOULD be placed in an external MIME entity that
    can be referenced by a URI from within the iCalendar object. In
    applications where this is not feasible, binary content information
    can be included within an iCalendar object, but only after first
    encoding it into text using the “BASE64” encoding method defined in
    [RFC 2045]. Inline binary contact SHOULD only be used in applications
    whose special circumstances demand that an iCalendar object be
    expressed as a single entity. A property containing inline binary
    content information MUST specify the “ENCODING” property parameter.
    Binary content information placed external to the iCalendar object
    MUST be referenced by a uniform resource identifier (URI).

    The following example specifies an “ATTACH” property that references
    an attachment external to the iCalendar object with a URI reference:

    ATTACH:http://xyz.com/public/quarterly-report.doc

    The following example specifies an “ATTACH” property with inline
    binary encoded content information:

    ATTACH;FMTTYPE=image/basic;ENCODING=BASE64;VALUE=BINARY:
    MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQAwdzELMAkGA1U
    EBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bmljYXRpb25zIE

    —————————

    This seemed like a solution for our problem, unless I’m missing something?

    Thank you for your time!

    in reply to: iCal export does not include attached images #15135
    Stijn
    Member

    Hey Rob, thanks for the quick response! I’d be great if this was possible, otherwise we’ll have to find some workaround…

    If there is another way to get a (json) feed of the events on the calendar _with_ image, that would be great as well.

    Cheers!

Viewing 10 posts - 1 through 10 (of 10 total)