Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed a bunch of stuff...I hope nothing broke

git-svn-id: http://plugins.svn.wordpress.org/bp-groupblog/trunk@211726 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information...
commit a2dd1c3fbb1c5c6d01dc628573e1318a413c737b 1 parent d48c8f9
MariusOoms authored
View
45 bp-groupblog-blog.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * This is the plugin template that is loaded when visiting the 'blog tab' within the group.
+ * To modify you can either use the provided hooks. You may also copy the whole groupblog over
+ * to your active theme and completely re-theme the blog template.
+ *
+ * Includes: inc/pages.php, inc/posts.php, inc/activity.php
+ */
+?>
+
+<?php do_action( 'bp_before_group_blog_template' ) ?>
+
+ <?php if ( bp_group_is_visible() && bp_groupblog_is_blog_enabled ( bp_get_group_id() ) ) : ?>
+
+ <?php switch_to_blog( get_groupblog_blog_id() ); ?>
+
+ <?php do_action( 'bp_before_group_blog_content' ) ?>
+
+ <?php /********************* Start your custom content *********************/ ?>
+
+ <?php /* Uncomment to disable */ include( 'groupblog/inc/pages.php' ); ?>
+ <?php /* Uncomment to disable */ include( 'groupblog/inc/posts.php' ); ?>
+
+ <?php /********************* End your custom content *********************/ ?>
+
+ <?php do_action( 'bp_after_group_blog_content' ) ?>
+
+ <?php restore_current_blog(); ?>
+
+ <?php /* Uncomment to disable */ include( 'groupblog/inc/activity.php' ); ?>
+
+ <?php elseif ( !bp_group_is_visible() ) : ?>
+ <?php /* The group is not visible, show the status message */ ?>
+
+ <?php do_action( 'bp_before_group_status_message' ) ?>
+
+ <div id="message" class="info">
+ <p><?php bp_group_status_message() ?></p>
+ </div>
+
+ <?php do_action( 'bp_after_group_status_message' ) ?>
+
+ <?php endif;?>
+
+<?php do_action( 'bp_after_group_blog_template' ) ?>
View
50 bp-groupblog.php
@@ -4,7 +4,7 @@
Plugin URI: http://wordpress.org/extend/plugins/search.php?q=buddypress+groupblog
Description: Automates and links WPMU blogs groups controlled by the group creator.
Author: Rodney Blevins & Marius Ooms
-Version: 1.4.2
+Version: 1.4.3
License: (Groupblog: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html)
Site Wide Only: true
*/
@@ -20,7 +20,7 @@
/*******************************************************************/
define ( 'BP_GROUPBLOG_IS_INSTALLED', 1 );
-define ( 'BP_GROUPBLOG_VERSION', '1.4.2' );
+define ( 'BP_GROUPBLOG_VERSION', '1.4.3' );
// Define default roles
if ( !defined( 'BP_GROUPBLOG_DEFAULT_ADMIN_ROLE' ) )
@@ -792,38 +792,11 @@ function bp_groupblog_create_blog( $group_id ) {
}
add_action( 'groups_group_create_complete', 'bp_groupblog_create_blog' );
-/**
- * groupblog_screen_home()
- *
- * Redirect the group home page to the blog front page or else load a template file.
- */
-/*
-function groupblog_screen_home() {
- global $bp;
-
- if ( bp_is_group_home() ) {
-
- $checks = get_site_option('bp_groupblog_blog_defaults_options');
-
- if ( $checks['redirecthome'] == '1' ) {
- $blog_details = get_blog_details( get_groupblog_blog_id(), true );
- bp_core_redirect( $blog_details->siteurl );
- }
- }
-}
-add_action( 'plugins_loaded', 'groupblog_screen_home' );
-*/
-
-/**
- * groupblog_screen_blog()
- *
- * Redirect the group blog page to the blog front/posts page or else load a template file.
- */
function groupblog_screen_blog() {
- global $bp, $wp;
+ global $bp;
if ( $bp->current_component == $bp->groups->slug && 'blog' == $bp->current_action ) {
-
+
$checks = get_site_option('bp_groupblog_blog_defaults_options');
if ( $checks['redirectblog'] == '1' ) {
@@ -831,8 +804,14 @@ function groupblog_screen_blog() {
bp_core_redirect( $blog_details->siteurl );
}
else {
- add_action( 'bp_template_content', 'groupblog_screen_blog_content' );
- bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'groups/single/plugins' ) );
+ if ( file_exists( locate_template( array( 'groupblog/blog.php' ) ) ) ) {
+ bp_core_load_template( apply_filters( 'groupblog_screen_blog', 'groupblog/blog' ) );
+ add_action( 'wp', 'groupblog_screen_blog', 4 );
+ }
+ else {
+ bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'groups/single/plugins' ) );
+ add_action( 'bp_template_content', 'groupblog_screen_blog_content' );
+ }
}
}
}
@@ -840,10 +819,7 @@ function groupblog_screen_blog() {
function groupblog_screen_blog_content() {
global $bp, $wp;
- if ( file_exists( locate_template( array( 'groupblog/blog.php' ) ) ) )
- locate_template( array( 'groupblog/blog.php' ), true );
- else
- load_template( WP_PLUGIN_DIR . '/bp-groupblog/groupblog/blog.php' );
+ load_template( WP_PLUGIN_DIR . '/bp-groupblog/bp-groupblog-blog.php' );
}
/* Add a filter option to the filter select box on group activity pages */
View
89 groupblog/blog.php
@@ -1,45 +1,84 @@
<?php
/**
- * This is the plugin template that is loaded when visiting the 'blog tab' within the group.
+ * This is the template that is loaded when visiting the 'blog tab' within the group.
* To modify you can either use the provided hooks. You may also copy the whole groupblog over
* to your active theme and completely re-theme the blog template.
*
* Includes: inc/pages.php, inc/posts.php, inc/activity.php
*/
?>
+<?php get_header() ?>
-<?php do_action( 'bp_before_group_blog_template' ) ?>
+ <div id="content">
+ <div class="padder">
+ <?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
- <?php if ( bp_group_is_visible() && bp_groupblog_is_blog_enabled ( bp_get_group_id() ) ) : ?>
+ <?php do_action( 'bp_before_group_home_content' ) ?>
- <?php switch_to_blog( get_groupblog_blog_id() ); ?>
+ <div id="item-header">
+ <?php locate_template( array( 'groups/single/group-header.php' ), true ) ?>
+ </div>
- <?php do_action( 'bp_before_group_blog_content' ) ?>
+ <div id="item-nav">
+ <div class="item-list-tabs no-ajax" id="object-nav">
+ <ul>
+ <?php bp_get_options_nav() ?>
- <?php /********************* Start your custom content *********************/ ?>
-
- <?php /* Uncomment to disable */ include( 'inc/pages.php' ); ?>
- <?php /* Uncomment to disable */ include( 'inc/posts.php' ); ?>
+ <?php do_action( 'bp_group_options_nav' ) ?>
+ </ul>
+ </div>
+ </div>
- <?php /********************* End your custom content *********************/ ?>
+ <div id="item-body">
- <?php do_action( 'bp_after_group_blog_content' ) ?>
+ <?php do_action( 'bp_before_group_body' ) ?>
+
+ <?php if ( bp_group_is_visible() && bp_groupblog_is_blog_enabled ( bp_get_group_id() ) ) : ?>
+
+ <?php switch_to_blog( get_groupblog_blog_id() ); ?>
+
+ <?php /********************* Start your custom content *********************/ ?>
+
+ <?php /* Uncomment to disable */ include( 'inc/pages.php' ); ?>
+ <?php /* Uncomment to disable */ include( 'inc/posts.php' ); ?>
+
+ <?php /********************* End your custom content *********************/ ?>
+
+ <?php restore_current_blog(); ?>
+
+ <?php /* Uncomment to disable */ include( 'inc/activity.php' ); ?>
- <?php restore_current_blog(); ?>
-
- <?php /* Uncomment to disable */ include( 'inc/activity.php' ); ?>
+ <?php elseif ( !bp_group_is_visible() ) : ?>
+ <?php /* The group is not visible, show the status message */ ?>
- <?php elseif ( !bp_group_is_visible() ) : ?>
- <?php /* The group is not visible, show the status message */ ?>
+ <?php do_action( 'bp_before_group_status_message' ) ?>
- <?php do_action( 'bp_before_group_status_message' ) ?>
+ <div id="message" class="info">
+ <p><?php bp_group_status_message() ?></p>
+ </div>
- <div id="message" class="info">
- <p><?php bp_group_status_message() ?></p>
- </div>
+ <?php do_action( 'bp_after_group_status_message' ) ?>
- <?php do_action( 'bp_after_group_status_message' ) ?>
-
- <?php endif;?>
-
-<?php do_action( 'bp_after_group_blog_template' ) ?>
+ <?php else : ?>
+ <?php
+ /* If nothing sticks, just load a group front template if one exists. */
+ locate_template( array( 'groups/single/front.php' ), true );
+ ?>
+ <?php endif; ?>
+
+ <?php do_action( 'bp_after_group_body' ) ?>
+ </div>
+
+ <?php do_action( 'bp_after_group_home_content' ) ?>
+
+ <?php endwhile; endif; ?>
+ </div><!-- .padder -->
+ </div><!-- #content -->
+
+ <?php switch_to_blog( get_groupblog_blog_id() ); ?>
+
+ <?php locate_template( array( 'sidebar.php' ), true ) ?>
+
+ <?php restore_current_blog(); ?>
+
+<?php get_footer() ?>
View
7 readme.txt
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: buddypress,groups,blogs,content
Requires at least: WPMU 2.9 / BP 1.2
Tested up to: WPMU 2.9.1
-Stable tag: 1.4.2
+Stable tag: 1.4.3
BuddyPress Groupblog extends the group functionality by enabling the group to have a single blog associated with it. Group members are automatically added to the blog and will have roles as set by the group admin.
@@ -49,7 +49,7 @@ The BuddyPress Groupblog plugin extends the group functionality by enabling each
4) You are done!
-5) Optionally, if you wish to override the files inside the folder called groupblog, first copy that folder over to the BuddyPress bp-default theme folder. You can make any changes in the folder that you just copied and they will take precedence over the original folder.
+5) Optionally, if you would like the sidebar to reflect the blog of the group, move the bp-groupblog/groupblog folder to buddypress/bp-themes/bp-default/.
**NOTE: Please deactivate the plugin before running automatic upgrade or you will get a big fat 'Cannot redeclare' fatal error. Regardless, if you do activate while the plugin is active it will still work fine. It is just that nobody likes errors, even when they are not real.**
@@ -64,6 +64,9 @@ Thanks to Boone for coming up with a solid solution to add users to the groupblo
== Changelog ==
+= 1.4.3 =
+* Restructed templating. To control the sidebar of your group, you will need to move the bp-groupblog/groupblog folder to buddypress/bp-themes/bp-default/.
+
= 1.4.2 =
* Changed group template behavior and structure
* Added admin option to redirect to Blog Home within the Group
Please sign in to comment.
Something went wrong with that request. Please try again.