1. Index: yd-buddypress-feed-syndication.php
  2. ===================================================================
  3. --- yd-buddypress-feed-syndication.php  (revision 524247)
  4. +++ yd-buddypress-feed-syndication.php  (working copy)
  5. @@ -14,7 +14,6 @@
  6.   Author URI: http://www.yann.com/
  7.   License: GPL2
  8.   */
  9. -
  10.  /**
  11.   * @copyright 2010  Yann Dubois  ( email : yann _at_ abc.fr )
  12.   *
  13. @@ -38,6 +37,8 @@
  14.   */
  15.  
  16.  /**
  17. + Revision 2.1.1:
  18. +  - Make it work with latest BuddyPress (as of 2012/03/27).
  19.   Revision 2.1.0:
  20.   - Production release of 2011/08/27
  21.   - New feature: Max feeds per user != max feeds per groups (as suggested by J.Pisano)
  22. @@ -87,81 +88,82 @@
  23.   - Original alpha release 00
  24.   */
  25.  
  26. -/** Class includes **/
  27. -
  28. -include_once( dirname( __FILE__ ) . '/inc/yd-widget-framework.inc.php' );  // standard framework VERSION 20110405-01 or better
  29. -include_once( dirname( __FILE__ ) . '/inc/ydbfs.inc.php' );                    // custom classes
  30. -
  31. -/**
  32. - *
  33. - * Just fill up necessary settings in the configuration array
  34. - * to create a new custom plugin instance...
  35. - *
  36. - */
  37. -global $ydbfs_o;
  38. -$ydbfs_o = new ydbfsPlugin(
  39. -   array(
  40. -       'name'              => 'YD BuddyPress Feed Syndication',
  41. -       'version'           => '2.1.0',
  42. -       'has_option_page'   => true,
  43. -       'option_page_title' => 'YD Feed Syndication',
  44. -       'op_donate_block'   => false,
  45. -       'op_credit_block'   => true,
  46. -       'op_support_block'  => false,
  47. -       'has_toplevel_menu' => false,
  48. -       'has_shortcode'     => false,
  49. -       'shortcode'         => 'ydbfs',
  50. -       'has_widget'        => false,
  51. -       'widget_class'      => 'YD_BuddyPressFeedSyndicationWidget',
  52. -       'has_cron'          => true,
  53. -       'crontab'           => array(
  54. -           'daily'         => array( 'ydbfsPlugin', 'daily_update' ),
  55. -           'hourly'        => array( 'ydbfsPlugin', 'hourly_update' )
  56. -       ),
  57. -       'has_stylesheet'    => false,
  58. -       'stylesheet_file'   => 'css/yd.css',
  59. -       'has_translation'   => true,
  60. -       'translation_domain'=> 'ydbfs', // must be copied in the widget class!!!
  61. -       'translations'      => array(
  62. -           array( 'English', 'Yann Dubois', 'http://www.yann.com/' ),
  63. -           array( 'French', 'Yann Dubois', 'http://www.yann.com/' ),
  64. -           array( 'Italian', 'Czz', 'Uajika.tk' ),
  65. -           array( 'Russian', 'Diogen Platonovich', 'http://platonovich.ru/' )
  66. -       ),
  67. -       'initial_funding'       => array( 'Selliance', 'http://www.selliance.com' ),
  68. -       'additional_funding'    => array(
  69. -           array( 'Selliance', 'http://www.selliance.com' )
  70. -       ),
  71. -       'form_blocks'           => array(
  72. -           'Main options'      => array(
  73. -               'limit'         => 'text',
  74. -               'group_limit'   => 'text',
  75. -               'open_out'      => 'bool',
  76. -           )
  77. -       ),
  78. -       'option_field_labels'=>array(
  79. -               'limit'         => 'Maximum number of user-aggregated feeds:',
  80. -               'group_limit'   => 'Maximum number of group-aggregated feeds:',
  81. -               'open_out'      => 'Open feed links in new window.',
  82. -       ),
  83. -       'option_defaults'   => array(
  84. -               'limit'         => 5,
  85. -               'group_limit'   => 5,
  86. -               'open_out'      => 1,
  87. -       ),
  88. -       'form_add_actions'  => array(
  89. -               'Manually run hourly process'   => array( 'ydbfsPlugin', 'hourly_update' ),
  90. -               'Manually force feed reload'    => array( 'ydbfsPlugin', 'force_update' ),
  91. -               'Manually check broken feeds'   => array( 'ydbfsPlugin', 'force_check' ),
  92. -               'Check latest'                  => array( 'ydbfsPlugin', 'check_update' )
  93. -       ),
  94. -       'has_cache'             => false,
  95. -       'option_page_text'      => '',
  96. -       'backlinkware_text'     => '',
  97. -       'plugin_file'           => __FILE__,
  98. -       'has_activation_notice' => false,
  99. -       'activation_notice'     => '',
  100. -       'form_method'           => 'post'
  101. -   )
  102. -);
  103. +function yd_buddypress_feed_syndication_init() {
  104. +   // Class includes.
  105. +   require_once( dirname( __FILE__ ) . '/inc/yd-widget-framework.inc.php' );  // standard framework VERSION 20110405-01 or better
  106. +   require_once( dirname( __FILE__ ) . '/inc/ydbfs.inc.php' ); // custom classes
  107. +  
  108. +   /**
  109. +    * Just fill up necessary settings in the configuration array
  110. +    * to create a new custom plugin instance...
  111. +    */
  112. +   global $ydbfs_o;
  113. +   $ydbfs_o = new ydbfsPlugin(
  114. +       array(
  115. +           'name'              => 'YD BuddyPress Feed Syndication',
  116. +           'version'           => '2.1.1',
  117. +           'has_option_page'   => true,
  118. +           'option_page_title' => 'YD Feed Syndication',
  119. +           'op_donate_block'   => false,
  120. +           'op_credit_block'   => true,
  121. +           'op_support_block'  => false,
  122. +           'has_toplevel_menu' => false,
  123. +           'has_shortcode'     => false,
  124. +           'shortcode'         => 'ydbfs',
  125. +           'has_widget'        => false,
  126. +           'widget_class'      => 'YD_BuddyPressFeedSyndicationWidget',
  127. +           'has_cron'          => true,
  128. +           'crontab'           => array(
  129. +               'daily'         => array( 'ydbfsPlugin', 'daily_update' ),
  130. +               'hourly'        => array( 'ydbfsPlugin', 'hourly_update' )
  131. +           ),
  132. +           'has_stylesheet'    => false,
  133. +           'stylesheet_file'   => 'css/yd.css',
  134. +           'has_translation'   => true,
  135. +           'translation_domain'=> 'ydbfs', // must be copied in the widget class!!!
  136. +           'translations'      => array(
  137. +               array( 'English', 'Yann Dubois', 'http://www.yann.com/' ),
  138. +               array( 'French', 'Yann Dubois', 'http://www.yann.com/' ),
  139. +               array( 'Italian', 'Czz', 'Uajika.tk' ),
  140. +               array( 'Russian', 'Diogen Platonovich', 'http://platonovich.ru/' )
  141. +           ),
  142. +           'initial_funding'       => array( 'Selliance', 'http://www.selliance.com' ),
  143. +           'additional_funding'    => array(
  144. +               array( 'Selliance', 'http://www.selliance.com' )
  145. +           ),
  146. +           'form_blocks'           => array(
  147. +               'Main options'      => array(
  148. +                   'limit'         => 'text',
  149. +                   'group_limit'   => 'text',
  150. +                   'open_out'      => 'bool',
  151. +               )
  152. +           ),
  153. +           'option_field_labels'=>array(
  154. +                   'limit'         => 'Maximum number of user-aggregated feeds:',
  155. +                   'group_limit'   => 'Maximum number of group-aggregated feeds:',
  156. +                   'open_out'      => 'Open feed links in new window.',
  157. +           ),
  158. +           'option_defaults'   => array(
  159. +                   'limit'         => 5,
  160. +                   'group_limit'   => 5,
  161. +                   'open_out'      => 1,
  162. +           ),
  163. +           'form_add_actions'  => array(
  164. +                   'Manually run hourly process'   => array( 'ydbfsPlugin', 'hourly_update' ),
  165. +                   'Manually force feed reload'    => array( 'ydbfsPlugin', 'force_update' ),
  166. +                   'Manually check broken feeds'   => array( 'ydbfsPlugin', 'force_check' ),
  167. +                   'Check latest'                  => array( 'ydbfsPlugin', 'check_update' )
  168. +           ),
  169. +           'has_cache'             => false,
  170. +           'option_page_text'      => '',
  171. +           'backlinkware_text'     => '',
  172. +           'plugin_file'           => __FILE__,
  173. +           'has_activation_notice' => false,
  174. +           'activation_notice'     => '',
  175. +           'form_method'           => 'post'
  176. +       )
  177. +   );
  178. +}
  179. +// Init this plugin after BuddyPress is loaded and initialized.
  180. +add_action( 'bp_include', 'yd_buddypress_feed_syndication_init');
  181.  ?>
  182. \ No newline at end of file
  183. Index: inc/ydbfs.inc.php
  184. ===================================================================
  185. --- inc/ydbfs.inc.php   (revision 524247)
  186. +++ inc/ydbfs.inc.php   (working copy)
  187. @@ -16,7 +16,7 @@
  188.                
  189.         $this->form_blocks = $opts['form_blocks']; // No backlinkware
  190.        
  191. -       add_action( 'bp_include', array( &$this, 'plugin_init' ) );
  192. +       add_action( 'init', array( &$this, 'setup_tabs' ) );
  193.         add_filter( 'wp_feed_cache_transient_lifetime', array( &$this, 'set_transient_lifetime' ) );
  194.        
  195.         if( function_exists( 'bp_register_group_extension' ) ) {
  196. @@ -26,10 +26,6 @@
  197.         add_filter( 'bp_get_activity_action', array( &$this, 'add_target' ), 10000 );
  198.     }
  199.    
  200. -   function plugin_init() {
  201. -       add_action( 'init', array( &$this, 'setup_tabs' ) );
  202. -   }
  203. -  
  204.     // =======================================  FRONT OFFICE ====================================
  205.    
  206.     function add_target( $html ) {