Guest User

MultiSite Fix? - BuddyPress Activity Stream Bar

a guest
Feb 1st, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.15 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: BuddyPress Activity Stream Bar
  4. Version: 1.3.1
  5. Plugin URI: http://blog.slyspyder.com/?p=410
  6. Description: Adds a static bar at the bottom of every page of your website. Which displays the latest 20 BuddyPress activities and rotates threw them.
  7. Author: Tosh Hatch
  8. Author URI: http://www.SlySpyder.com
  9. */
  10.  
  11. /* Define a constant that will hold the current version number of the component */
  12. define ( 'BP_ACTIVITY_BAR_VERSION', '1.3.1' );
  13. // Begin BuddyPress aware
  14. function bp_activity_bar_loader() {
  15. // Begin BuddyPress aware
  16. function add_bp_activity_header() {
  17.     wp_enqueue_style('bp_activity_header_css', WP_PLUGIN_URL .'/buddypress-activity-stream-bar/bp_activity_bar.css');
  18.     wp_print_styles();
  19. }
  20. function add_bp_activity_footer() { ?>
  21.   <div id="innerbpclose"><a href="javascript:bpactbarclose()">-</a></div><div id="innerbpopen"><a href="javascript:bpactbaropen()">-</a></div>
  22.   <div id="footeractivity">
  23.     <div id="bp_activity_bar">
  24.     <?php if ( bp_has_activities('max=20') ) : ?>
  25.     <ul id="rotation"><?php while ( bp_activities() ) : bp_the_activity(); ?><li id="activity-<?php bp_activity_id() ?>" class="slide">    
  26.     <div id="innerbp_act"><a href="JavaScript:rotateback();"><img src="<?php get_home_url() ?>/wp-content/plugins/buddypress-activity-stream-bar/img/left.png" /></a><a href="JavaScript:rotate();"><img src="<?php get_home_url() ?>/wp-content/plugins/buddypress-activity-stream-bar/img/right.png" /></a>&nbsp;<a href="<?php bp_activity_user_link() ?>"><?php bp_activity_avatar( 'type=full&width=20&height=20' ) ?></a></div>
  27.     <?php bp_activity_action() ?><?php do_action( 'bp_activity_entry_content' )  ?>
  28.     </li><?php endwhile; ?></ul>
  29.     </div>
  30.   </div>
  31.   <?php endif;
  32.   echo "<script type='text/javascript' src='".get_home_url()."/wp-content/plugins/buddypress-activity-stream-bar/bp_activity_bar.js'></script>";
  33. }
  34. add_action('wp_head', 'add_bp_activity_header');
  35. add_action('wp_footer', 'add_bp_activity_footer');
  36. //END BuddyPress aware
  37. }
  38. //END BuddyPress aware
  39. if ( defined( 'BP_VERSION' ) )
  40.     bp_activity_bar_loader();
  41. else
  42.     add_action( 'bp_init', 'bp_activity_bar_loader' );
  43. // END BuddyPress aware
  44. ?>
Add Comment
Please, Sign In to add comment