WordPress.org

Ready to get started?Download WordPress

Forums

All-in-One Event Calendar
Special characters and html in ical and googlecal (11 posts)

  1. mimosatree
    Member
    Posted 2 years ago #

    I love this plugin, but I am having trouble with special characters and html markup appearing in the ical and google cal events.

    1) In my event titles, dashes get transformed into &8211; (8211). Even when I go back through the events and edit them and make sure that they are using plain hyphens, not endash - they still appear in ical and google calendar.

    2) event descriptions are surrounded by <p></p> in iCal. Again, I went back to the event and checked html view to ensure that <p></p> were not there. But they still appear in iCal. It doesn't happen in Google Calendar.

    Could you perhaps make some way of controlling special characters and html in the subscribe-able calendars? Thank you!

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

  2. mimosatree
    Member
    Posted 2 years ago #

    p.s. I would like to repeat the request made elsewhere, asking that multi-day events should appear as a "bar" across all dates, similar to the appearance of Google Cal or iCal.

  3. Yani Iliev
    Member
    Posted 2 years ago #

    1 and 2 - we have something in mind for this - we will offer a few choices to export/import events that should solve this problem.
    Multiday events can be tracked in this ticket: http://trac.the-seed.ca/ticket/334

  4. ullemehner
    Member
    Posted 2 years ago #

    Hi mimosatree,

    For topic 1)
    see this post/thread:
    http://wordpress.org/support/topic/plugin-all-in-one-event-calendar-compatibility-with-french-accentuated-letters-google-export?replies=5#post-2648579

    It seems, that wordpress is converting non ascii characters into those entities automatically (at least for title field). In regular posts as in ai1ec posts. This could depend on certain plugin(s)/wysiwyg-editor.
    So it is not ai1ec's fault.

    I found some idea in the comments of this page:
    http://www.php.net/manual/en/function.html-entity-decode.php

    So
    In file class-ai1ec-exporter-helper.php
    in wp-content/plugins/all-in-one-event-calendar/app/helper/
    at about line 68

    just replace the line

    $e->setProperty( 'summary', html_entity_decode( apply_filters( 'the_title', $event->post->post_title ), ENT_QUOTES ) );

    with this code:

    $e->setProperty( 'summary', preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, apply_filters( 'the_title', $event->post->post_title )));

    For topic 2)
    see this post/thread:
    http://wordpress.org/support/topic/plugin-all-in-one-event-calendar-filter-html-tags-and-wpautop?replies=1

    This hasn't changed in version 1.4.

    As a quick help:
    In file class-ai1ec-exporter-helper.php
    in wp-content/plugins/all-in-one-event-calendar/app/helper/
    at about line 69

    just replace the line

    $content = apply_filters( 'the_content', $event->post->post_content );

    with this code:

    # No wrapping <p></p> in event description
    		if( $export ) {
    			remove_filter( 'the_content', 'wpautop', 10 );
    		}
    		$content = apply_filters( 'the_content', $event->post->post_content );
    		# No HTML code in event description
    		if( $export ) {
    			$content = strip_tags($content);
    		}

    Note that these changes get overwritten with every new ai1ec update .

    Cheers,
    Ulle

  5. Yani Iliev
    Member
    Posted 2 years ago #

    Thank you, Ulle!

  6. mimosatree
    Member
    Posted 2 years ago #

    Thank you so much to both of you!
    Ulle, I am trying to put your two suggested changes into class-ai1ec-exporter-helper.php, but it is causing my whole site not to work. I'm trying to figure out if there's a typo. If you see it please let me know.

  7. mimosatree
    Member
    Posted 2 years ago #

    Follow up to Ulle... your second suggestion (how to get rid of the <p></p>) works great! But I am still trying to find if there is a typo in #1, because it is causing my site not to load.

  8. ullemehner
    Member
    Posted 2 years ago #

    Hi mimosatree,

    I checked again the code I posted for 1) and I don't get any errors here (version 1.4).
    Note that the code has to be on one line.

    Please look into your webservers error logs, if there is something related.

    Cheers,
    Ulle

  9. mimosatree
    Member
    Posted 2 years ago #

    Thank you for checking this. I did make sure that I put the code all in one line, and that I have plugin version 1.4. But I still get a blank screen when I go to my site with this line in place. I'm sorry, but I don't know how to find my error log. If I figure out the problem, I will follow up.

  10. ullemehner
    Member
    Posted 2 years ago #

    Hi all,

    in this thread

    Exported Calendar shows htmlentities

    shrmn suggests something promising for html entities in titles.

    Cheers,
    Ulle

  11. shrmn
    Member
    Posted 2 years ago #

    Just a heads up, this issue is also present in Descriptions of events, and has been fixed in this post:

    Fix: Description in exported calendar has htmlentities and tags

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic