charlielove
Forum Replies Created
-
I resolved it by replacing
$user_is_owner = ($this->user_id == $user_id );
with$username = bp_group_creator_username($group_id); $the_user = get_user_by('login', $username); $groupOwnerId = $the_user->ID; $user_is_owner = ($groupOwnerId == $user_id );
I’m sure there is a more elegant way!
Looks like the issue is in classes.php Line 256
$user_is_owner = ($this->user_id == $user_id );
mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Using $this when not in object context in classes.php:256
- This reply was modified 7 years, 8 months ago by charlielove.
I’ve got the same issue on all my groups. PHP7 running on server – works no problem when logged in as an Admin – just affecting all non-admin users (editors, authors etc).
- This reply was modified 7 years, 8 months ago by charlielove.
Forum: Plugins
In reply to: [Group Documents] Group Docs Work with BP 1.7?Doesn’t work. It needs a bit of a re-write to use the Buddypress groups API properly from the very quick look I had at the code. I’ve started the job but I might just switch to another plug-in.
Forum: Plugins
In reply to: [Achievements for WordPress] Bug Report: Needs updating for WP 3.5The fix is easy:
Edit achievements-classes.php line 676 from
$admin_sql = $wpdb->prepare( "AND (is_active = 1 OR is_active = 2)" );
to be
$admin_sql = $wpdb->prepare( "AND (is_active = 1 OR is_active = 2)", NULL );
And Edit
achievements-core.php line 453 from$actions = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT action.name FROM {$bp->achievements->table_achievements} as achievement, {$bp->achievements->table_actions} as action WHERE achievement.action_id = action.id AND achievement.action_id != -1 AND (achievement.is_active = 1 OR achievement.is_active = 2)" ) );
to
$actions = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT action.name FROM {$bp->achievements->table_achievements} as achievement, {$bp->achievements->table_actions} as action WHERE achievement.action_id = action.id AND achievement.action_id != -1 AND (achievement.is_active = 1 OR achievement.is_active = 2)",NULL ) );
The $wpdb->prepare expects an additional parameter to adding the NULL makes to work as it did previously.
This fix gets the plugin so that no errors are reported but I now have new members being automatically approved rather waiting to be approved.
Really need a fix from Author for Buddypress 1.5
Change the files in the plugins folder
/plugins/achievements/includes/templates/achievements/ and
/plugins/achievements/includes/templates/achievements/single/to match the structure of the main pages. The divs need to be reorganized to follow the same structure as the other pages.
i.e. /single/home.php fixed
<?php get_header() ?> <div id="content"> <div class="padder"> <div id="sidebar-squeeze"> <div id="main-column"> <?php if ( dpa_has_achievements( 'skip_detail_page_result=0') ) : while ( dpa_achievements() ) : dpa_the_achievement(); ?> <?php do_action( 'dpa_before_achievement_home_content' ) ?> <div id="item-header"> <?php dpa_load_template( array( 'achievements/single/achievement-header.php' ) ) ?> </div><!-- #item-header --> <div id="item-nav"> <div class="item-list-tabs no-ajax" id="object-nav"> <ul> <?php bp_get_options_nav() ?> <?php do_action( 'dpa_achievement_options_nav' ) ?> </ul> </div> </div><!-- #item-nav --> <div id="item-body"> <?php do_action( 'dpa_before_achievement_home_body' ) ?> <?php if ( dpa_is_achievement_change_picture_page() ) : ?> <?php dpa_load_template( array( 'achievements/single/change-picture.php' ) ) ?> <?php elseif ( dpa_is_achievement_activity_page() && bp_is_active( 'activity' ) ) : ?> <?php dpa_load_template( array( 'achievements/single/activity.php' ) ) ?> <?php elseif ( dpa_is_achievement_unlocked_by_page() ) : ?> <?php dpa_load_template( array( 'achievements/single/unlocked-by.php' ) ) ?> <?php elseif ( dpa_is_achievement_delete_page() ) : ?> <?php dpa_load_template( array( 'achievements/single/delete.php' ) ) ?> <?php elseif ( dpa_is_achievement_edit_page() ) : ?> <?php dpa_load_template( array( 'achievements/single/edit.php' ) ) ?> <?php elseif ( dpa_is_achievement_grant_page() ) : ?> <?php dpa_load_template( array( 'achievements/single/grant.php' ) ) ?> <?php endif; ?> <?php do_action( 'dpa_after_achievement_home_body' ) ?> </div><!-- #item-body --> <?php do_action( 'dpa_after_achievement_home_content' ) ?> <?php endwhile; endif; ?> </div><!-- .main column --> <div id="side-bar" role="complementary"> <?php get_sidebar() ?> </div> <!-- #sidebar --> </div> <!-- #sidebar-squeeze --> </div><!-- .padder --> </div><!-- #content --> <?php get_sidebar() ?> <?php get_footer() ?>
I had a look at it and Achievements uses its own templates which then render in the theme. They don’t follow the same structure as the default Buddypress/Frisco themes hence the full width of main column and widgets over the top on the right.
I edited the Achievements plug-in templates to have the same structure as the other Buddypress pages and it works great now.