WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] location address missing for google calendar and ical (12 posts)

  1. raskull
    Member
    Posted 1 year ago #

    #_EVENTGCALURL and #_EVENTICALURL do not have the location address -- only the location name. Therefore the user would not know the address of the event if looking at their calendar, and google cannot map an address-less event.

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

    you can modify that using template file at templates/ical.php or ical-event.php

    http://wp-events-plugin.com/documentation/using-template-files/

  3. raskull
    Member
    Posted 1 year ago #

    Hm, well it's going to take me some amount of time to muck around in there. Meanwhile, wouldn't you agree that a location without an address is a problem, not a feature?

  4. raskull
    Member
    Posted 1 year ago #

    I figured out how to correct the problem for the generated ics file in i-cal-event.php. But I do not see where to correct it for the parameters passed in the url to google. Please advise.

  5. agelonwl
    Member
    Posted 1 year ago #

    can you share the solution?

  6. raskull
    Member
    Posted 1 year ago #

    in ical-event.php, line 33

    before:
    $location = $EM_Event->output( '#_LOCATION' );

    after (using a local template, of course):
    $location = $EM_Event->output( '#_LOCATION #_LOCATIONADDRESS #_LOCATIONTOWN #_LOCATIONSTATE #_LOCATIONPOSTCODE' );

    That gives me all the info for the ics file. But which function/file is passing the parameters to the google url? That is the one I need to change.

  7. agelonwl
    Member
    Posted 1 year ago #

    it's the area here:

    BEGIN:VEVENT
    UID:{$UID}
    DTSTART:{$dateStart}
    DTEND:{$dateEnd}
    DTSTAMP:{$dateModified}
    SUMMARY:{$description}
    LOCATION:{$location}
    URL:{$EM_Event->output('#_EVENTURL')}
    END:VEVENT";
  8. raskull
    Member
    Posted 1 year ago #

    No, that info is what goes into the ics file. It does not have any effect on the url parameters passed to google. BUT I found it:

    In em-event.php, line 1457:

    before:
    $gcal_url = str_replace('location_name', urlencode($this->output('#_LOCATION')), $gcal_url);

    after:
    $gcal_url = str_replace('location_name', urlencode($this->output('#_LOCATION #_LOCATIONADDRESS #_LOCATIONTOWN #_LOCATIONSTATE #_LOCATIONPOSTCODE')), $gcal_url);

    Now google calendar can generate a map for the location. Would you consider this for an update? I don't know if there is any way to hook into your code, so I had to hack it.

  9. agelonwl
    Member
    Posted 1 year ago #

    you can try to modify/override placeholder instead to make it update free http://wp-events-plugin.com/tutorials/modifying-placeholder-default-information/

  10. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    rather than do that, I'd make this an option in the settings page, so you can change placeholders there.

  11. raskull
    Member
    Posted 1 year ago #

    Please explain further. Are you suggesting an update that you would make to the plugin?

    I wonder why #_LOCATION and #_LOCATIONNAME are both the same thing. It would make sense to me to have #_LOCATION be the combination of #_LOCATIONNAME #_LOCATIONADDRESS #_LOCATIONTOWN #_LOCATIONSTATE and #_LOCATIONPOSTCODE.

    BUT... since it is not, I am trying to modify the #_LOCATION placeholder. AND I need help. Using your example:

    function my_em_placeholder_mod($replace, $EM_Location, $result){
    	if ( $result == '#_LOCATION' ) {
    		$replace = $replace . WHAT GOES HERE?;
    	}
    	return $replace;
    }
    add_filter('em_location_output_placeholder','my_em_placeholder_mod',1,3);

    What do I put where it says WHAT GOES HERE? I tried, for example, '#_LOCATIONPOSTCODE' and #_LOCATIONPOSTCODE but neither of those worked.

  12. raskull
    Member
    Posted 1 year ago #

    Allrighty I think I got it. Let me know if you see any fatal flaws:

    function my_em_placeholder_mod( $replace, $EM_Location, $result ){
    	if ( $result == '#_LOCATION' ) {
    		$replace = $EM_Location->output( '#_LOCATIONNAME #_LOCATIONADDRESS #_LOCATIONTOWN #_LOCATIONSTATE #_LOCATIONPOSTCODE' );
    	}
    	return $replace;
    }
    add_filter( 'em_location_output_placeholder','my_em_placeholder_mod',1,3 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic