smithgt
Forum Replies Created
-
Using Subscribe2 should be possible as it’s designed to work with other custom post types.
I did have a go, but it fell over with an error.
MattyRob – the Subscribe2 author posted (https://www.ads-software.com/support/topic/plugin-subscribe2-notifications-for-customer-events?replies=16_
I’ve had a dig in the event plugin code, this is a thrown error code in one of the files.
It seems to be saying that the event details are null.
Now this might be because they are not collected at the time the filter code is called or perhaps they are nit yet created when the filter code is called. I’m not sure. I think it may be better to follow up with the event calendar author as they know their code better.
Thanks, but unfortunately that’s still not fixed the AE1EC errors ??
Fatal error: Uncaught exception 'Ai1ec_Event_Not_Found' with message 'Event with ID '5778' could not be retrieved from the database.' in /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php:356 Stack trace: #0 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/helper/class-ai1ec-events-helper.php(63): Ai1ec_Event->__construct(5778, false) #1 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/controller/class-ai1ec-events-controller.php(491): Ai1ec_Events_Helper::get_event(5778) #2 [internal function]: Ai1ec_Events_Controller->event_content('<p>test b</p>?') #3 /homepages/10/d83518211/htdocs/WordPress/testing/wp-includes/plugin.php(170): call_user_func_array(Array, Array) #4 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/subscribe2/classes/class-s2-core.php(559): apply_filters('the_content', 'test b') #5 [internal function]: s2class->publ in /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php on line 356
I’ve found some possible taxonomy candidates – events_tags and events_categories
So how do I add more than one taxonomy? The code below fails ??
function my_taxonomy_types($taxonomies) {
// where ‘my_taxonomy_type’ is the name of your custom taxonomy
$taxonomies[] = ‘events_tags’,’events_categories’;
return $taxonomies;
}
add_filter(‘s2_taxonomies’, ‘my_taxonomy_types’);Apparently its possible to add custom post type to Subscribe2, with a little bit of PHP
What I’d need to know is the name of the custom post type that AE1EC uses.
Is it ai1ec_event ?
The PHP I’ve written is
<?php
/*
Plugin Name: AI1EC-Subscribe2
Description: Add AI1EC to Subscribe2 notifications
Version: 0.1
Author: smithgt
*/
function my_post_types($types) {
$types[] = ‘ai1ec_event’;
return $types;
}
add_filter(‘s2_post_types’,’my_post_types’);
?>But it seems to crash ai1ec with this error
“Fatal error: Uncaught exception ‘Ai1ec_Event_Not_Found’ with message ‘Event with ID ‘5752’ could not be retrieved from the database.’ in /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php:356 Stack trace: #0 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/helper/class-ai1ec-events-helper.php(63): Ai1ec_Event->__construct(5752, false) #1 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/controller/class-ai1ec-events-controller.php(491): Ai1ec_Events_Helper::get_event(5752) #2 [internal function]: Ai1ec_Events_Controller->event_content(‘<p>bbc</p>?’) #3 /homepages/10/d83518211/htdocs/WordPress/testing/wp-includes/plugin.php(170): call_user_func_array(Array, Array) #4 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/subscribe2/classes/class-s2-core.php(559): apply_filters(‘the_content’, ‘bbc’) #5 [internal function]: s2class->publish(Ob in /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php on line 356”
Any ideas what’s gone wrong?
thanks
Ah ??
Moved that to the end of the file and activation was ok this time around, but when I created a test event I get this error ??
Fatal error: Uncaught exception ‘Ai1ec_Event_Not_Found’ with message ‘Event with ID ‘5752’ could not be retrieved from the database.’ in /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php:356 Stack trace: #0 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/helper/class-ai1ec-events-helper.php(63): Ai1ec_Event->__construct(5752, false) #1 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/controller/class-ai1ec-events-controller.php(491): Ai1ec_Events_Helper::get_event(5752) #2 [internal function]: Ai1ec_Events_Controller->event_content(‘<p>bbc</p>?’) #3 /homepages/10/d83518211/htdocs/WordPress/testing/wp-includes/plugin.php(170): call_user_func_array(Array, Array) #4 /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/subscribe2/classes/class-s2-core.php(559): apply_filters(‘the_content’, ‘bbc’) #5 [internal function]: s2class->publish(Ob in /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/all-in-one-event-calendar/app/model/class-ai1ec-event.php on line 356
It must be something to do with the use of the post type “ai1ec_event” as if I change to something else then the error when posting an event doesnt appear.
I’ve asked on the AE1EC forum for confirmation of the post type.
Does the error mean anything useful to you?
OK – I’ve read that and created this file
<?php
/*
Plugin Name: AI1EC-Subscribe2
Description: Add AI1EC to Subscribe2 notifications
Version: 0.1
Author: smithgt
*/
?>
function my_post_types($types) {
$types[] = ‘ai1ec_event’;
return $types;
}
add_filter(‘s2_post_types’, ‘my_post_types’);It’s called my_post_types.php and I’ve uploaded it into my wordpress site into the folder /wp-content/plugins/AI1EC-Subscribe2
It’s now listed under plugins – wow!
If I activate it I see an error:The plugin generated 123 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
And when I add an event I get this error:
function my_post_types($types) { $types[] = ‘ai1ec_event’; return $types; } add_filter(‘s2_post_types’, ‘my_post_types’);
Warning: Cannot modify header information – headers already sent by (output started at /homepages/10/d83518211/htdocs/WordPress/testing/wp-content/plugins/AI1EC-Subscribe2/my_post_types.php:13) in /homepages/10/d83518211/htdocs/WordPress/testing/wp-includes/pluggable.php on line 866Now I’m a bit stuck ??
While I’m no IT novice, I am new to PHP and wordpress, so I’m a little unsure what I would need to include in a PHP file.
From your FAQ I beleive that the event type my AI1EC is ‘ai1ec_event’, so this this script correct?
/* Code to add post type for AI1EC to Subscribe2 */
function my_post_types($types) {
$types[] = ‘ai1ec_event’;
return $types;
}
add_filter(‘s2_post_types’, ‘my_post_types’);And do I simply drop this in the root folder of /wp-content/plugins or does it need it its own sub folder? Do I have to do anything to activate/ run the code?
Thanks MattyRob,
Silly question, but which PHP file am I to add the my_post_types to?
subscribe2.php?
(I’ve just upgraded to V8)
I’ve just made a similar post as I’ve just added Subscribe2 to my site and it would be great if that could notify of AIO events.
Hi Yani,
I’ve just updated to 1.4 and this issue is still present
https://sandbox.smith-it.co.uk/
Did a fix not make it in to this version?
That sounds like a great idea – I could do the same with my on road and off road cycle events.
That would be useful for my site too.
Forum: Themes and Templates
In reply to: Changing the order of the top level menu from alphabeticalAh – I’d not realised that I could make a custom menu for use at the top of the site ??
Problem resolved. Thanks Zambala
Hi Yani,
Any progress on this?
thanks