Szymon Janczura 2024-10-24T14:50:00-04:00

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • Szymon Janczura
    Participant
    Post count: 22
    in reply to: Awards not granted #11786

    Ok, so I tested again, and it worked for the second time logging in, the same with comment, as the first would have to go through admin moderation. I can’t find the pattern yet.

    Szymon Janczura
    Participant
    Post count: 22
    in reply to: Awards not granted #11785

    So I tested other achievement: changing profile foto, and it worked fine. What about just logging in ?

    Szymon Janczura
    Participant
    Post count: 22

    When I woke up today I have had a strong feel that problem might be caused by LiteSpeed Cache plugin. Because I added there some do not cache rules like
    http://localhost/kleo/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js
    http://localhost/kleo/wp-content/plugins/buddypress/bp-core/js/jquery-cookie.min.js

    which are connected to buddypress. So I
    1. purge all cache,
    2. deactivated LiteSpeed plugin
    3. Reset data again using your DB BadgeOs plugin.
    4. Added new achievement type.
    5. Checked if All users have their achievement tab
    6. Activated LiteSpeed Cache plugin without this buddypress exception files.

    I am not very technical, so maybe it was just 3. step but anyway problem solved.

    Szymon Janczura
    Participant
    Post count: 22

    I think I solved it . Give me a sec so I will make sure.

    Szymon Janczura
    Participant
    Post count: 22

    I tried deactivating it already, doesn’t matter. But you can try it yourself. Just be careful NOT tu update plugins

    Szymon Janczura
    Participant
    Post count: 22

    You can check users profile here http://bimv.pl/uzytkownicy/ and see which one have achievement Tab.

    Szymon Janczura
    Participant
    Post count: 22

    There is one achievement type I created- Kursy and I just published this one badge which was previously draft, but I doesn’t matter anyway.

    I deleted previous achievements
    using https://pl.wordpress.org/plugins/badgeos-reset/ because I thought
    there was some problem with database remains and I wanted to start
    fresh. So I used mentioned plugin and created fresh new achievement type
    Kursy, but the problem sitll there.

    Szymon Janczura
    Participant
    Post count: 22

    I am not technical, but I can give you admin access to the page. It’s really important because I already have bought Leaderboards and BadgeOs for Sensei so I don’t want it to be wasted money…And my page would be perfect after activating BadgeOs

    Szymon Janczura
    Participant
    Post count: 22

    Checked again, and its not like only admins have the achievements tab, some have some aren’t, so sorry for the misleading. Looking for pattern, between users…

    Szymon Janczura
    Participant
    Post count: 22

    I granted normal user with achievement through Admin->Members and it showed on activity stream. Tab in profile didn’t appeared though

    Szymon Janczura
    Participant
    Post count: 22

    Yes I checked it. As I said it is visible on admin accounts, I have three and on all of them it is visible. Now I don’t see it when I browse other members profiles, just admins.

    I also deleted plugin and even reset database using BadgeOS Reset Developer Add-On and installed again.

    Szymon Janczura
    Participant
    Post count: 22

    Thanks,
    Another question

    I have a course created using Sensei and there are lessons pages there, and user can comment on them. Are this comments included in “comment on post” activity counter? “Comment on post” does it also includes other types of comments like on page or in a Activity Stream?

    Szymon Janczura
    Participant
    Post count: 22

    I am using Sensei for E-learning and I have also Teachers on my site which I would like to exclude. Is there a way to do that ?

    Szymon Janczura
    Participant
    Post count: 22

    sorry I didn’t saw the second page, but anyway want to make sure:
    This are users IDs?
    19660, 19661, 19662, 19663, 19664, 19665, 19666, 19667

    Szymon Janczura
    Participant
    Post count: 22
    /**
     * Filter the update leaders function and conditionally undo addition of admins.
     * 
     * @param $leaders          Array of current leaders for the leaderboard
     * @param $leaderboard_id   Leaderboard ID we are updating.
     * @param $original_leaders Array of original leaders before most recent addition.
     *
     * @return array
     */
    function custom_exclude_admins_from_leaderboard( $leaders, $leaderboard_id, $original_leaders ) {
    	// Grab all of our current site admins.
    	
    // Set leaderboards to exclude from.
    $leaderboard_to_exclude_from = array( 19661, 19662, 19663, 19664, 19665, 19666, 19667, 19668 );
    
    if ( ! in_array( $leaderboard_to_exclude_from, $leaderboard_id ) ) {
    	return $leaders;
    }
    
    $admins = new WP_User_Query( array( 'role' => 'Administrator' ) );
    
    	$admin_users = $admins->get_results();
    	$admin_ids = array();
    	// Loop over the admins to get an array of just their IDs.
    	foreach ( $admin_users as $user ) {
    		$admin_ids[] = $user->ID;
    	}
    	// Placeholder boolean to hold whether or not to update the leaderboard data.
    	$should_update = false;
    	foreach ( $leaders as $key => $leader ) {
    		if ( in_array( $leader['user_id'], $admin_ids ) ) {
    			// We found an admin being added to the leaderboard data.
    			$should_update = true;
    		}
    	}
    	if ( $should_update ) {
    		// Since we just added an administrator, we need to re-set the leaderboard data to
    		// the state it was previously at.
    		update_post_meta( $leaderboard_id, '_badgeos_leaderboard_leaders', $original_leaders );
    		return $original_leaders;
    	}
    	return $leaders;
    }
    add_filter( 'badgeos_leaderboard_update_leaders', 'custom

    I don’t know if I understood all correctly. So this code should exclude admin and users with IDs: 19661, 19662, 19663, 19664, 19665, 19666, 19667, 19668 from leaderboard??

Viewing 15 posts - 1 through 15 (of 15 total)