/bp-themes/bp-default/activity/post-form.php

  1. <?php 
  2.  
  3. /** 
  4. * BuddyPress - Activity Post Form 
  5. * 
  6. * @package BuddyPress 
  7. * @subpackage bp-default 
  8. */ 
  9.  
  10. ?> 
  11.  
  12. <form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary"> 
  13.  
  14. <?php do_action( 'bp_before_activity_post_form' ); ?> 
  15.  
  16. <div id="whats-new-avatar"> 
  17. <a href="<?php echo bp_loggedin_user_domain(); ?>"> 
  18. <?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?> 
  19. </a> 
  20. </div> 
  21.  
  22. <h5><?php if ( bp_is_group() ) 
  23. printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname() ); 
  24. else 
  25. printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname() ); 
  26. ?></h5> 
  27.  
  28. <div id="whats-new-content"> 
  29. <div id="whats-new-textarea"> 
  30. <textarea name="whats-new" id="whats-new" class="bp-suggestions" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea> 
  31. </div> 
  32.  
  33. <div id="whats-new-options"> 
  34. <div id="whats-new-submit"> 
  35. <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" /> 
  36. </div> 
  37.  
  38. <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?> 
  39.  
  40. <div id="whats-new-post-in-box"> 
  41.  
  42. <?php _e( 'Post in', 'buddypress' ); ?>: 
  43.  
  44. <select id="whats-new-post-in" name="whats-new-post-in"> 
  45. <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option> 
  46.  
  47. <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) : 
  48. while ( bp_groups() ) : bp_the_group(); ?> 
  49.  
  50. <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option> 
  51.  
  52. <?php endwhile; 
  53. endif; ?> 
  54.  
  55. </select> 
  56. </div> 
  57. <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> 
  58.  
  59. <?php elseif ( bp_is_group_home() ) : ?> 
  60.  
  61. <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> 
  62. <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" /> 
  63.  
  64. <?php endif; ?> 
  65.  
  66. <?php do_action( 'bp_activity_post_form_options' ); ?> 
  67.  
  68. </div><!-- #whats-new-options --> 
  69. </div><!-- #whats-new-content --> 
  70.  
  71. <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?> 
  72. <?php do_action( 'bp_after_activity_post_form' ); ?> 
  73.  
  74. </form><!-- #whats-new-form --> 
.