Support » Plugin: Tutor LMS - eLearning and online course solution » Adding Gamipress points achievements, ranks etc.. in tutor Dashboard

  • Resolved sanumolu5

    (@sanumolu5)


    Hi,

    I am using Gamipress to award points to the users for various activities. I would like to show their points, achievements (badges) and ranks in the Tutor Dashboard. How can I add Gamipress widgets in Tutor Dashboard? Kindly help.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • largbasket

    (@largbasket)

    Dear @sanumolu5

    For that you need to override and modify the Tutor LMS dashboard templates. Please check our documents to know how to override Tutor LMS templates, the link is below.

    https://docs.themeum.com/tutor-lms/developers/override-templates/

    Thank you.

    Thread Starter sanumolu5

    (@sanumolu5)

    @largbasket

    I appreciate your guidance in referring to the section on overriding the tutor template. However, it appears that the provided information doesn’t include a sample code demonstrating how to create a page under the dashboard, similar to pages like “/dashboard/my-profile/” or “/dashboard/wishlist/.”

    My objective is to establish a page like “/dashboard/rewards” that displays gamipress user points, achievements, and rank.

    While I’ve managed to successfully add a link to the Dashboard navigation by following the steps outlined in https://docs.themeum.com/tutor-lms/developers/editing-tutor-dashboard/, I’m still facing the challenge of creating the “Rewards” page as described above. I would greatly appreciate your guidance in achieving this.

    Thread Starter sanumolu5

    (@sanumolu5)

    Hi,

    Here is an update. I am successfully able to create a dashboard/rewards page by creating a rewards.php file in themes/<child-theme>/tutor/dashboard. I have the following code in rewards.php file

    <?php
    /**
     * Frontend Rewards Page
     *
     * @package Tutor\Templates
     * @subpackage Dashboard
     * @author JKYog <support@jkyog.org>
     * @link https://themeum.com
     * @version 1.4.3
     */
    
    use TUTOR\Input;
    
    // Get the current user ID
    $user_id = get_current_user_id();
    
    // Get user points
    $user_points = gamipress_get_user_points( $user_id );
    
    // Get user achievements
    $user_achievements = gamipress_get_user_achievements( $user_id );
    ?>
    
    <div class="tutor-fs-5 tutor-fw-medium tutor-color-black tutor-mb-24"><?php esc_html_e( 'Rewards', 'tutor' ); ?></div>
    <div class="tutor-dashboard-content-inner">
    	<section class="user-rewards">
            <div class="tutor-row tutor-mb-24">    
        		<h2><?php esc_html_e( 'User Points:', 'tutor' ); ?> <?php echo $user_points; ?></h2>
    		</div>
            <div class="tutor-row tutor-mb-24">      
                <h3><?php esc_html_e( 'Achievements:', 'tutor' ); ?></h3>
                	<?php echo do_shortcode( '[gamipress_user_achievements user_id="' . $user_id . '"]' ); ?>
            </div>
    		<div class="tutor-row tutor-mb-24">  	
                <h3><?php esc_html_e( 'Ranks:', 'tutor' ); ?></h3>
                <?php echo do_shortcode( '[gamipress_user_ranks user_id="' . $user_id . '"]' ); ?>
            </div>    
        </section>
    </div>

    However this is not processing gamipress shortcode and showing the results. Instead it is showing it as a text as follows:

    Rewards
    User Points: 0
    Achievements:
    [gamipress_user_achievements user_id="491"]
    Ranks:
    [gamipress_user_ranks user_id="491"]

    Could you please guide where am I doing wrong?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding Gamipress points achievements, ranks etc.. in tutor Dashboard’ is closed to new replies.