Forum Replies Created
-
AuthorPosts
-
Mark
ParticipantI only have one site. I figured buying it early would just extend my
license, no? That July purchase was intended to extend one expiring to next
year.Sent from Mobile
Mark
ParticipantI don’t know why I didn’t see that. I think I was making it more complicating than it needed to be. Thanks!
Mark
ParticipantThanks for all of your time and efforts. I guess the root issue is, not wanting to administrate two separate calendars. Is there a different way to align your Google calendar and this Events Calendar? Because if so, I would rather import my Google calendar into Events Calendar rather than the other way around.
If not…
Is it possible to request a feature for Events Calendar? The reason I ask is because when someone wants to export listed events, shouldn’t they be able to do just that instead of just what’s on the page? I guess I’m a little confused as to what that export function really does. Either that, or there should be a URL for each site that’s create using the plugin. Just some thoughts.
Mark
ParticipantI did reformat the quotes to now reflect straight quotes.
So if I understand you correctly, I should be able to pull a full export of all my events with this link as long as I change the future date to something not so distant:
http://anccbellevue.org/events/?ical=1&full-export
I changed the future date to 2015-12-31 as you recommended, but it still only pulls the 1st page of events (I have my events calendar set to limit to 6 events per page and I have a total of 9 just to test it out). The first 6 always show up, no issue, it’s anything beyond the six. I’m wondering if the only fix for this is to list all events on one page (but than that makes our page really crowded, so I prefer it not to do that).
Mark
ParticipantI found a code through the forums that was supposed to address the issue, I corrected the fancy quotes and turned them into straight ones and pasted this code into my THEMEFUNCTIONS.PHP file on a CHILD THEME.
See Line 26 and below:
https://gist.github.com/anonymous/32ad876dcb9fa147f18fMark
ParticipantHere is the code I am using: https://gist.github.com/anonymous/32ad876dcb9fa147f18f
The error I get is this:
Parse error: syntax error, unexpected T_STRING in /home/anccbell/public_html/wp-content/themes/salient-child/functions.php on line 8Mark
ParticipantAdding that code seems to create syntax errors. My current functions.php file looks like this, which is causing errors:
<?php
/**
* Remove “share” prompt text from end of gCal-exported descriptions.
* @link http://theeventscalendar.com/support/forums/topic/sharing-options-for-events/
*/
function remove_tags_from_gcal_links( array $params ) {$cleaned = html_entity_decode( strip_tags( apply_filters( ‘the_content’, urldecode( $params[‘details’] ) ) ), ENT_QUOTES, ‘UTF-8’ );
$to_remove = ‘Share this with others via:’;
$pos = ( strlen( $cleaned ) – strpos( $cleaned, $to_remove ) );
$trimmed = substr( $cleaned, 0, ( -$pos ) );$params[‘details’] = urlencode( $trimmed );
return $params;
}add_filter( ‘tribe_google_calendar_parameters’, ‘remove_tags_from_gcal_links’ );
// Second solution – links on the right of the organizer box (after)
add_action( ‘tribe_events_single_event_meta_primary_section_end’, array( ‘TribeiCal’, ‘single_event_links’ ) );
remove_action( ‘tribe_events_single_event_after_the_content’, array( ‘TribeiCal’, ‘single_event_links’ ) );add_action( ‘pre_get_posts’, ‘full_ical_export’ );
function full_ical_export( WP_Query $query ) {
if ( ! isset( $_GET[‘ical’] ) || ! isset( $_GET[‘full-export’] ) ) return;
if ( ! isset( $query->tribe_is_event_query ) || ! $query->tribe_is_event_query ) return;$query->set( ‘eventDisplay’, ‘custom’ );
$query->set( ‘start_date’, ‘now′ );
$query->set( ‘end_date’, ‘3000-01-01′ );
$query->set( ‘posts_per_page’, ‘-1′ );
}?>
Mark
ParticipantCode worked brilliantly!!! You’re awesome!
As for the second set of instructions, I’m not so clear on that one, but I’ll get a guy who knows code to work on that! Thanks!!!!
Mark
ParticipantThe code is still showing up. No worries on the misunderstanding. I was probably not describing the issue correctly. Any help in this area would be greatly appreciated!
Here is the Gist: https://gist.github.com/anonymous/800b2a185ce4c0c96af3
Mark
ParticipantSorry for all the updates, just trying to solve this issue as fast as possible. So, here is what I have been able to resolve.
1) Caching is no longer a problem (webpage is set to have Cache ON now)
2) No longer getting a invalid request or 400 error (Google calendar sharing is working)
3) Only issue remaining is trying to get rid of the code that the sharing plugin (Easy Social Share and any other share plugin) inserts into the Google event details.Here is the code that I added to my functions.php to solve the first two issues:
add_filter( ‘tribe_google_calendar_parameters’, ‘remove_tags_from_gcal_links’ );
function remove_tags_from_gcal_links( array $params ) {
$cleaned = html_entity_decode( strip_tags( apply_filters( ‘the_content’, urldecode( $params[‘details’] ) ) ), ENT_QUOTES, ‘UTF-8’);
$params[‘details’] = urlencode( $cleaned );return $params;
}/**
* Shortens the event description used within Google Calendar links.
*
* The Events Calendar already truncates the event description before using it in Google
* Calendar links – however some themes/other plugins may add additional markup/content
* after this, expanding it back to too big a size to make for a valid request.
*
* @param array $properties
* @return array
*/
function truncate_gcal_description_late( array $properties ) {
$details = $properties[‘details’];if ( strlen( $details ) > 996 ) {
//Strip tags
$details = strip_tags( $details );$url = get_permalink();
$details = substr( $details, 0, 996 );//Only add the permalink if it’s shorter than 900 characters, so we don’t exceed the browser’s URL limits
if ( strlen( $url ) < 900 ) {
$details .= ‘ (View Full Event Description Here: ‘ . $url . ‘)’;
}
}$properties[‘details’] = $details;
return $properties;
}add_filter( ‘tribe_google_calendar_parameters’, ‘truncate_gcal_description_late’ );
Mark
ParticipantSo I did some testing today. I have a plugin called WP Super Cache. If it is ACTIVATED and cache is on, Google Calendar sharing does not work and I get the invalid request error.
When I turn cache off, I can use the sharing function, but the whole code thing pops up.
So it looks like I also cannot cache my page. Do you have any recommendations?
Mark
ParticipantYes, the sharing related code happens only after the rest of the description code. I can always delete the last portion, but I’m thinking about all the users out there who have to go through the trouble of doing that. If there is a code out there, it would be great to have… and I think others could benefit as well, since this seems to clash with other plugins as well. It’s a small detail, I can understand that, but if possible, it would be great to share events and have them export details in a fashion that is clean and organized.
Mark
ParticipantThis reply is private.
Mark
ParticipantThe invalid request error only happens with Jetpack ON, so I DISABLED the Jetpack share function and turned on Easy Social Share.
I then went on your forums and found a code to strip the extra coding and markings that were popping up on the Google calendar description and all life was wonderful.
But when I turn Easy Social Share ON and in the Google Calendar description, it adds the Easy Social Share code as following:
Every 1st Sunday of the month, youth students (6th-12th grade) are invited to go out for lunch and hangout after service. It’s a casual environment where students get to mingle, build relationships with their leaders, share a meal together, and have a little fun outside of our regular group times. Activities and lunch spots vary each month, but if you would like to get notified about upcoming hangout locations and events, please sign up for our newsletter by registering your family.We can’t wait to spend some time with your students @Hangouts!Sign Up for Newsletters Share this with others via:FacebookTwitterPrintE-mail function essb_window1270294632(oUrl, oService) { essb_window_stat(oUrl, oService, 3832); essb_ga_tracking(oService, “bottom”, “http://anccbellevue.org/event/youth-hangouts/”); }; function essb_pinterenst1270294632() {essb_ga_tracking(“pinterest”, “bottom”, “http://anccbellevue.org/event/youth-hangouts/”); essb_pinterenst_stat(3832); };Share this with others via: FacebookTwitterPrintE-mail function essb_window4514479(oUrl, oService) { essb_window_stat(oUrl, oService, 3832); essb_ga_tracking(oService, “bottom”, “http://anccbellevue.org/event/youth-hangouts/”); }; function essb_pinterenst4514479() {essb_ga_tracking(“pinterest”, “bottom”, “http://anccbellevue.org/event/youth-hangouts/”); essb_pinterenst_stat(3832); };
I tried other share plugins like Mashshare, and for some reason all the share functions insert some code into the event description. So I was wondering if there was a way to adjust the code or functions of the calendar to not include that last bit of code in the description.
Mark
ParticipantI just disabled the Jetpack sharing because that just seems to be the problem. I had Easy Social Share Buttons plugin installed already and that does not seem to interfere with the Google Calendar import function, but it does add code to the event detail.
I searched through the forums and found this bit of code that helped strip some of the coding and markings from the even descriptions. Is there anything that I need to add to also make sure that the social sharing code doesn’t show up?
—————
add_filter( ‘tribe_google_calendar_parameters’, ‘remove_tags_from_gcal_links’ );function remove_tags_from_gcal_links( array $params ) {
$cleaned = html_entity_decode( strip_tags( apply_filters( ‘the_content’, urldecode( $params[‘details’] ) ) ), ENT_QUOTES, ‘UTF-8’);
$params[‘details’] = urlencode( $cleaned );return $params;
} -
AuthorPosts
