Index: yd-buddypress-feed-syndication.php =================================================================== --- yd-buddypress-feed-syndication.php (revision 524247) +++ yd-buddypress-feed-syndication.php (working copy) @@ -14,7 +14,6 @@ Author URI: http://www.yann.com/ License: GPL2 */ - /** * @copyright 2010 Yann Dubois ( email : yann _at_ abc.fr ) * @@ -38,6 +37,8 @@ */ /** + Revision 2.1.1: + - Make it work with latest BuddyPress (as of 2012/03/27). Revision 2.1.0: - Production release of 2011/08/27 - New feature: Max feeds per user != max feeds per groups (as suggested by J.Pisano) @@ -87,81 +88,82 @@ - Original alpha release 00 */ -/** Class includes **/ - -include_once( dirname( __FILE__ ) . '/inc/yd-widget-framework.inc.php' ); // standard framework VERSION 20110405-01 or better -include_once( dirname( __FILE__ ) . '/inc/ydbfs.inc.php' ); // custom classes - -/** - * - * Just fill up necessary settings in the configuration array - * to create a new custom plugin instance... - * - */ -global $ydbfs_o; -$ydbfs_o = new ydbfsPlugin( - array( - 'name' => 'YD BuddyPress Feed Syndication', - 'version' => '2.1.0', - 'has_option_page' => true, - 'option_page_title' => 'YD Feed Syndication', - 'op_donate_block' => false, - 'op_credit_block' => true, - 'op_support_block' => false, - 'has_toplevel_menu' => false, - 'has_shortcode' => false, - 'shortcode' => 'ydbfs', - 'has_widget' => false, - 'widget_class' => 'YD_BuddyPressFeedSyndicationWidget', - 'has_cron' => true, - 'crontab' => array( - 'daily' => array( 'ydbfsPlugin', 'daily_update' ), - 'hourly' => array( 'ydbfsPlugin', 'hourly_update' ) - ), - 'has_stylesheet' => false, - 'stylesheet_file' => 'css/yd.css', - 'has_translation' => true, - 'translation_domain'=> 'ydbfs', // must be copied in the widget class!!! - 'translations' => array( - array( 'English', 'Yann Dubois', 'http://www.yann.com/' ), - array( 'French', 'Yann Dubois', 'http://www.yann.com/' ), - array( 'Italian', 'Czz', 'Uajika.tk' ), - array( 'Russian', 'Diogen Platonovich', 'http://platonovich.ru/' ) - ), - 'initial_funding' => array( 'Selliance', 'http://www.selliance.com' ), - 'additional_funding' => array( - array( 'Selliance', 'http://www.selliance.com' ) - ), - 'form_blocks' => array( - 'Main options' => array( - 'limit' => 'text', - 'group_limit' => 'text', - 'open_out' => 'bool', - ) - ), - 'option_field_labels'=>array( - 'limit' => 'Maximum number of user-aggregated feeds:', - 'group_limit' => 'Maximum number of group-aggregated feeds:', - 'open_out' => 'Open feed links in new window.', - ), - 'option_defaults' => array( - 'limit' => 5, - 'group_limit' => 5, - 'open_out' => 1, - ), - 'form_add_actions' => array( - 'Manually run hourly process' => array( 'ydbfsPlugin', 'hourly_update' ), - 'Manually force feed reload' => array( 'ydbfsPlugin', 'force_update' ), - 'Manually check broken feeds' => array( 'ydbfsPlugin', 'force_check' ), - 'Check latest' => array( 'ydbfsPlugin', 'check_update' ) - ), - 'has_cache' => false, - 'option_page_text' => '', - 'backlinkware_text' => '', - 'plugin_file' => __FILE__, - 'has_activation_notice' => false, - 'activation_notice' => '', - 'form_method' => 'post' - ) -); +function yd_buddypress_feed_syndication_init() { + // Class includes. + require_once( dirname( __FILE__ ) . '/inc/yd-widget-framework.inc.php' ); // standard framework VERSION 20110405-01 or better + require_once( dirname( __FILE__ ) . '/inc/ydbfs.inc.php' ); // custom classes + + /** + * Just fill up necessary settings in the configuration array + * to create a new custom plugin instance... + */ + global $ydbfs_o; + $ydbfs_o = new ydbfsPlugin( + array( + 'name' => 'YD BuddyPress Feed Syndication', + 'version' => '2.1.1', + 'has_option_page' => true, + 'option_page_title' => 'YD Feed Syndication', + 'op_donate_block' => false, + 'op_credit_block' => true, + 'op_support_block' => false, + 'has_toplevel_menu' => false, + 'has_shortcode' => false, + 'shortcode' => 'ydbfs', + 'has_widget' => false, + 'widget_class' => 'YD_BuddyPressFeedSyndicationWidget', + 'has_cron' => true, + 'crontab' => array( + 'daily' => array( 'ydbfsPlugin', 'daily_update' ), + 'hourly' => array( 'ydbfsPlugin', 'hourly_update' ) + ), + 'has_stylesheet' => false, + 'stylesheet_file' => 'css/yd.css', + 'has_translation' => true, + 'translation_domain'=> 'ydbfs', // must be copied in the widget class!!! + 'translations' => array( + array( 'English', 'Yann Dubois', 'http://www.yann.com/' ), + array( 'French', 'Yann Dubois', 'http://www.yann.com/' ), + array( 'Italian', 'Czz', 'Uajika.tk' ), + array( 'Russian', 'Diogen Platonovich', 'http://platonovich.ru/' ) + ), + 'initial_funding' => array( 'Selliance', 'http://www.selliance.com' ), + 'additional_funding' => array( + array( 'Selliance', 'http://www.selliance.com' ) + ), + 'form_blocks' => array( + 'Main options' => array( + 'limit' => 'text', + 'group_limit' => 'text', + 'open_out' => 'bool', + ) + ), + 'option_field_labels'=>array( + 'limit' => 'Maximum number of user-aggregated feeds:', + 'group_limit' => 'Maximum number of group-aggregated feeds:', + 'open_out' => 'Open feed links in new window.', + ), + 'option_defaults' => array( + 'limit' => 5, + 'group_limit' => 5, + 'open_out' => 1, + ), + 'form_add_actions' => array( + 'Manually run hourly process' => array( 'ydbfsPlugin', 'hourly_update' ), + 'Manually force feed reload' => array( 'ydbfsPlugin', 'force_update' ), + 'Manually check broken feeds' => array( 'ydbfsPlugin', 'force_check' ), + 'Check latest' => array( 'ydbfsPlugin', 'check_update' ) + ), + 'has_cache' => false, + 'option_page_text' => '', + 'backlinkware_text' => '', + 'plugin_file' => __FILE__, + 'has_activation_notice' => false, + 'activation_notice' => '', + 'form_method' => 'post' + ) + ); +} +// Init this plugin after BuddyPress is loaded and initialized. +add_action( 'bp_include', 'yd_buddypress_feed_syndication_init'); ?> \ No newline at end of file Index: inc/ydbfs.inc.php =================================================================== --- inc/ydbfs.inc.php (revision 524247) +++ inc/ydbfs.inc.php (working copy) @@ -16,7 +16,7 @@ $this->form_blocks = $opts['form_blocks']; // No backlinkware - add_action( 'bp_include', array( &$this, 'plugin_init' ) ); + add_action( 'init', array( &$this, 'setup_tabs' ) ); add_filter( 'wp_feed_cache_transient_lifetime', array( &$this, 'set_transient_lifetime' ) ); if( function_exists( 'bp_register_group_extension' ) ) { @@ -26,10 +26,6 @@ add_filter( 'bp_get_activity_action', array( &$this, 'add_target' ), 10000 ); } - function plugin_init() { - add_action( 'init', array( &$this, 'setup_tabs' ) ); - } - // ======================================= FRONT OFFICE ==================================== function add_target( $html ) {