bb_forum_row

The BuddyPress bb forum row function.

Description

bb_forum_row( (int) $forum_id = 0, (constant) $echo = true, (bool) $close = false ); 

Parameters (3)

0. $forum_id — Optional. (int)
The forum id.
1. $echo — Optional. (constant) => true
The echo.
2. $close — Optional. (bool) => false
The close.

Usage

  1. if ( !function_exists( 'bb_forum_row' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php'; 
  3.  
  4. // The forum id. 
  5. $forum_id = -1; 
  6.  
  7. // The echo. 
  8. $echo = true; 
  9.  
  10. // The close. 
  11. $close = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bb_forum_row($forum_id, $echo, $close); 
  15.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-admin/includes/functions.bb-admin.php  
  1. function bb_forum_row( $forum_id = 0, $echo = true, $close = false ) { 
  2. global $forum, $forums_count; 
  3. if ( $forum_id ) 
  4. $_forum = bb_get_forum( $forum_id ); 
  5. else 
  6. $_forum =& $forum; 
  7.  
  8. if ( !$_forum ) 
  9. return; 
  10.  
  11. $description = get_forum_description( $_forum->forum_id ); 
  12.  
  13. $r = ''; 
  14. if ( $close ) 
  15. $r .= "\t<li id='forum-$_forum->forum_id'" . get_alt_class( 'forum', 'forum clear list-block' ) . ">\n"; 
  16. $r .= "\t\t<div class='list-block posrel'>\n"; 
  17. $r .= "\t\t\t<div class=\"row-title\">" . get_forum_name( $_forum->forum_id ) . "</div>\n"; 
  18. if ( $description ) 
  19. $r .= "\t\t\t<p class=\"row-description\">" . get_forum_description( $_forum->forum_id ) . "</p>\n"; 
  20. $r .= "\t\t\t<div class=\"row-actions\"><span>\n"; 
  21. $r .= "\t\t\t\t<a class='edit' href='" . get_forum_link() . "'>" . __('View') . "</a>\n"; 
  22. if ( bb_current_user_can( 'manage_forums' ) ) 
  23. $r .= "\t\t\t\t| <a class='edit' href='" . esc_attr( bb_get_uri('bb-admin/forums.php', array('action' => 'edit', 'id' => $_forum->forum_id), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN) ) . "'>" . __('Edit') . "</a>\n"; 
  24. if ( bb_current_user_can( 'delete_forum', $_forum->forum_id ) && 1 < $forums_count ) 
  25. $r .= "\t\t\t\t| <a class='delete' href='" . esc_attr( bb_get_uri('bb-admin/forums.php', array('action' => 'delete', 'id' => $_forum->forum_id), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN) ) . "'>" . __('Delete') . "</a>\n"; 
  26. $r .= "\t\t\t</span> </div>\n"; 
  27. $r .= "\t\t</div>\n"; 
  28. if ( $close ) 
  29. $r .= "\t</li>\n"; 
  30.  
  31. if ( $echo ) 
  32. echo $r; 
  33. return $r;