Guest User

[Hide for Visitors] BuddyPress Activity Stream Bar

a guest
Jan 11th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.27 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: BuddyPress Activity Stream Bar
  4. Version: 1.3.2
  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.2' );
  13. // Begin BuddyPress aware
  14. function bp_activity_bar_loader() {
  15.  if ( is_user_logged_in() ) {
  16. // Begin BuddyPress aware http://codex.wordpress.org/Determining_Plugin_and_Content_Directories
  17. function add_bp_activity_header() {
  18.     wp_enqueue_style('bp_activity_header_css', WP_PLUGIN_URL .'/buddypress-activity-stream-bar/bp_activity_bar.css');
  19.     wp_print_styles();
  20. }
  21. function add_bp_activity_footer() { ?>
  22.   <div id="innerbpclose"><a href="javascript:bpactbarclose()">-</a></div><div id="innerbpopen"><a href="javascript:bpactbaropen()">-</a></div>
  23.   <div id="footeractivity">
  24.     <div id="bp_activity_bar">
  25.     <?php if ( bp_has_activities('max=20') ) : ?>
  26.     <ul id="rotation"><?php while ( bp_activities() ) : bp_the_activity(); ?><li id="activity-<?php bp_activity_id() ?>" class="slide">    
  27.     <div id="innerbp_act"><a href="JavaScript:rotateback();"><img src="<?php get_bloginfo('wpurl') ?>/wp-content/plugins/buddypress-activity-stream-bar/img/left.png" /></a><a href="JavaScript:rotate();"><img src="<?php get_bloginfo('wpurl') ?>/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>
  28.     <?php bp_activity_action() ?><?php do_action( 'bp_activity_entry_content' )  ?>
  29.     </li><?php endwhile; ?></ul>
  30.     </div>
  31.   </div>
  32.   <?php endif;
  33.   echo "<script type='text/javascript' src='".get_bloginfo('wpurl')."/wp-content/plugins/buddypress-activity-stream-bar/bp_activity_bar.js'></script>";
  34. }
  35. add_action('wp_head', 'add_bp_activity_header');
  36. add_action('wp_footer', 'add_bp_activity_footer');
  37. //END BuddyPress aware
  38.  }
  39. }
  40. //END BuddyPress aware
  41. if ( defined( 'BP_VERSION' ) )
  42.     bp_activity_bar_loader();
  43. else
  44.     add_action( 'bp_init', 'bp_activity_bar_loader' );
  45. // END BuddyPress aware
  46. ?>
Add Comment
Please, Sign In to add comment