Commits

Doug Stewart committed c7ba67d

Trying to get this ruddy BuddyPress stuff working.

Comments (0)

Files changed (4)

includes/functions/buddypress.php

 		
 	} 
 }
+add_action( 'widgets_init', 'lblg_add_default_buddypress_menu' );
+
+function lblg_bp_menu() {
+		get_template_part( 'bp-navigation' );
+}
+add_action( 'lblg_print_bp_menu', 'lblg_bp_menu' );
 
 /*
-*  BuddyPress support code, taken from the BuddyPress Template Pack
-*
+*  BuddyPress support code, adapted from the BuddyPress Template Pack
+*  http://wordpress.org/extend/plugins/bp-template-pack/
+*  By apeatling & boonebgorges
 */
 function lblg_bp_init(){
 	global $lblg_shortname, $lblg_options;
 	
+	echo "Oooooh rah!";
 	/* Load the default BuddyPress AJAX functions */
-	if ( 'false' == $lblg_options['disable_bp_js'] ) {
+	if ( 'true' != $lblg_options['disable_bp_js'] ) {
 		require_once( BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php' );
 
 		/* Load the default BuddyPress javascript */
 	}
 	
 	/* Add the wireframe BP page styles */
-	if ( 'false' == $lblg_options['disable_bp_css'] )
+	if ( 'true' != $lblg_options['disable_bp_css'] )
 		wp_enqueue_style( 'lblg-bp-css', get_template_directory_uri() . '/includes/css/bp.css' );
+		
+	// Add words that we need to use in JS to the end of the page so they can be 
+	// translated and still used.
+	$params = array(
+		'my_favs'           => __( 'My Favorites', 'buddypress' ),
+		'accepted'          => __( 'Accepted', 'buddypress' ),
+		'rejected'          => __( 'Rejected', 'buddypress' ),
+		'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ),
+		'show_all'          => __( 'Show all', 'buddypress' ),
+		'comments'          => __( 'comments', 'buddypress' ),
+		'close'             => __( 'Close', 'buddypress' ),
+		'mention_explain'   => sprintf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress' ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) )
+	);
+
+	wp_localize_script( 'bp-js', 'BP_DTheme', $params );
 }
-
+add_action( 'bp_init', 'lblg_bp_init' );

includes/functions/hooks.php

 	}
 }
 
-function lblg_bp_menu() {
-		get_template_part( 'bp-navigation' );
-}
-
 function lblg_styles(){
 	global $lblg_shortname, $lblg_options;
 	$layout_handle = $lblg_shortname . '_layout_stylesheet';
 // Output the Featured Image
 function lblg_the_postimage() {
 	if( has_post_thumbnail() ) {
-		the_post_thumbnail();
+		the_post_thumbnail( 'lb-content-header' );
 	}
 }
 
 add_action( 'widgets_init', 'lblg_widgets_init' );
 add_action( 'after_setup_theme','lblg_options_init', 9 );
 
-// Only load the BuddyPress menu code if BP is active
-if( function_exists( 'bp_get_loggedin_user_nav' ) ){
-	add_action( 'widgets_init', 'lblg_add_default_buddypress_menu' );
-	add_action( 'lblg_print_bp_menu', 'lblg_bp_menu' );
-	add_action( 'bp_init', 'lblg_bp_init' );
-}
-
 // Only load custom header code if the option is checked
 if( 'true' == $lblg_options['use_custom_header'] ){
 	add_action( 'after_setup_theme', 'lblg_register_headers', 11 );

includes/functions/supports.php

 /*
 * Support 2.9, 3.0 and 3.1 coolness
 */
+if ( ! isset( $content_width ) ) $content_width = '640';
 add_theme_support( 'nav-menus' );
 add_theme_support( 'post-thumbnails' );
+set_post_thumbnail_size( 64, 64, true );
+add_image_size( 'lb-content-header', $content_width, 9999 );
 add_theme_support( 'automatic-feed-links' );
 add_custom_background();
 
 	font-size: 3.5em;
 	font-weight: bold;
 	font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
-	margin-top: 2em;
+	margin-top: 20px;
 }
 
 #header h1 a:link, #header h1 a:visited, #header p.blogtitle a:link, #header p.blogtitle a:visited {
 	padding: 3px;
 }
 
+#lb-content img.wp-post-image {
+	margin: 0 auto;
+	display: block;
+}
 /* @end */
 
 /* @group BuddyPress Elements */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.