Create a custom trigger to award points
-
Hello,
How can I integrate the “LIVE” button event on my page which is dynamically generated by custom PHP plugin, which allows users to join online classes on Zoom, with Gamipress? I want to reward points for this action too.
The page I need help with: [log in to see the link]
-
Hi @sanumolu5
You can use the Button or Link add-ons and add the link that redirects to the Zoom meeting. With these add-ons you will only be awarding points for pressing the button or link.
In the event that you want an integration with Zoom, this would be a custom development in which you would have to connect with the Zoom API
https://gamipress.com/add-ons/button/
https://gamipress.com/add-ons/link/
Best regards
Thank you for the reply. Could you please provide reference materials for custom development to connect with the Zoom API?
Hi @dioni00
I have given the following in my code
[gamipress_button type="submit" label="LIVE" class="live-class-link" url="' . $class_details['zoom_link'] . '"]
and it correctly generated the following html
<button type="submit" id="" class="gamipress-button live-class-link" form="" name="" value="" data-url="https://jkyog.co/courses" data-post="11041" data-comment="0">LIVE</button>
However, I would like to open the url in a new tab. How can I achieve this?
Hi @sanumolu5
I’m sorry but the button shortcode does not have the target attribute, for this you should use the Link add-on with which you can use the target=”_blank” attribute to open the URL in another tab.
https://gamipress.com/add-ons/link/
With the add-on button you can create custom elements if you add class=”gamipress-button” to catch the event to give points. You have more information about it in the following link
https://gamipress.com/add-ons/button/
You can find information on how to create custom events in the following link
https://gamipress.com/snippets/tutorials/creating-a-custom-event/
Regarding the Zoom API, you can find all the information in its official documentation.
https://developers.zoom.us/docs/api/
Best regards.
Hi @sanumolu5
Please clear your website cache. I have run a test from https://staging66.courses.jkyog.org/day-wise-online-classes/ and opened the correct link in another tab after clearing cache (CTRL + F5).
Best regards
Hi @dioni00
I’ve successfully created a dedicated dashboard page called “Rewards” by crafting a rewards.php file within themes/<child theme>/tutor/dashboard. Below is the code I’ve incorporated into the rewards.php file:
<?php /** * Frontend Rewards Page * * @package Tutor\Templates * @subpackage Dashboard * @author JKYog <[email protected]> * @link https://themeum.com * @version 1.4.3 */ use TUTOR\Input; // Obtain the current user's ID $user_id = get_current_user_id(); // Fetch the user's accumulated points $user_points = gamipress_get_user_points( $user_id ); // Retrieve the user's 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>
Unfortunately, I’m encountering an issue where the Gamipress shortcodes aren’t functioning as anticipated. Instead of displaying the expected outcomes, the shortcodes themselves are being shown. I’m actively seeking a resolution for this matter. Any assistance or insights you can offer to overcome this challenge would be immensely valuable.
Hi @dioni00 ,
Furthermore, I’m encountering a problem on another website where I’ve positioned Gamipress user achievements, user points, and user ranks within a sidebar widget. Despite providing titles for these widgets, they aren’t visible when viewed. Kindly refer to the attached screenshots for visual clarity.
https://drive.google.com/file/d/1nCVGw0KqppyZ2BAmCweJEvC4-psAqjxj/view?usp=sharing
https://drive.google.com/file/d/1h2jIsK8-pB9zoT570fiNnwF6jbA7U-Op/view?usp=sharing
Hi @sanumolu5
Regarding your custom code, please make sure to use the correct shortcodes, as those do not correspond to GamiPress shortcodes. In the following link you can find all the available shortcodes with their attributes.
https://gamipress.com/docs/shortcodes/
About the titles may be due to the characteristics of your theme. Please enter the titles in different blocks.
Hi @dioni00,
Indeed, I discovered this even before receiving your response, and it proved effective. At present, I’ve employed [gamipress_user_points type=”all”] to exhibit user points. At this juncture, I’d like to inquire whether it’s feasible to display user points horizontally instead of vertically.
Furthermore, akin to how [gamipress_user_points type=”all”] exhibits all earned point types for the user, is there a method to compile a list of all the user’s achievements? Presently, only [gamipress_last_achievements_earned] is available in the shortcodes you provided.
Hi @sanumolu5
To display horizontally, you can use the “columns” attribute, it allows you to create up to 6 columns maximum.
For achievements you can use the shortcode with the “filter_value” attribute to show only those that have been completed.
[gamipress_achievements filter_value=”completed”]
That worked. Thank you.
I’ve got a technical question. Could you clarify the distinctions and commonalities between Achievements and Ranks? While I grasp how Achievements are used, I’m a bit uncertain about the purpose and differentiation of Ranks. Would you be able to provide some insights to clarify this for me?
@dioni00 ,
On one of my websites, I’ve utilized Profile Builder for Logins and Fluent Forms for Registrations. However, I’ve noticed that there are no options for Profile Builder and Fluent Forms in the Gamipress points awarding settings. How can I go about awarding points for Logins and Registrations in this specific setup?
Hi @sanumolu5
The achievements are prizes that users can get when they meet the established requirements, for example, getting a gold medal. The ranks can be considered as the level up of a character in a video game when he gains experience, in GamiPress he can go up a rank when he meets the requirements that you establish.
Regarding the other question, GamiPress has the “Register to website” event
On the other hand, could you please open different topics or feel free to open a ticket at https://gamipress.com/contact-us/ to ask questions. This thread covers many different topics that can be confusing for other users looking for information on how to create a custom trigger, which was the initial topic.
Thanks for your understanding.
Best regards.
- The topic ‘Create a custom trigger to award points’ is closed to new replies.