Viewing 10 replies - 1 through 10 (of 10 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    You can add this shortcode to your theme’s functions.php if you want.

    function badgeos_tk_earn_achievement_for_page_view_shortcode( $atts = array() ) {
    
    	$atts = shortcode_atts( array(
    		'achievement_id' => 0,
    		'user_id' => get_current_user_id()
    	), $atts );
    
    	badgeos_maybe_award_achievement_to_user( $atts['achievement_id'], $atts['user_id'] );
    }
    add_shortcode( 'badgeos_tk_earn_achievement_for_page_view', 'badgeos_tk_earn_achievement_for_page_view_shortcode' );

    you would then have a shortcode available named [badgeos_tk_earn_achievement_for_page_view] with possible shortcode attributes of achievement_id an user_id.

    [badgeos_tk_earn_achievement_for_page_view achievement_id="52"]

    The example right above would try to award the current user with the achievement whose ID is 52.

    Place it on a page/post/wherever you want and it’ll run when the user views that page/post/whatever. If they’ve already earned it, nothing will change. If they haven’t yet, they’ll be awarded it.

    Thread Starter bharatmahajan51

    (@bharatmahajan51)

    i copy & paste this shortcode themes>functions.php but following shortcode is not working.
    [badgeos_tk_earn_achievement_for_page_view][badgeos_tk_earn_achievement_for_page_view achievement_id=”52″]
    Please setup step by step procedure.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    If it’s not being parsed as a shortcode, then it’s not getting registered as one like it should be for some reason.

    I did the exact same steps I provided, in a dev site, and it’s getting registered and not showing through like that. I put it at the very end of the functions.php file of my active theme.

    Thread Starter bharatmahajan51

    (@bharatmahajan51)

    Thank you for help.
    I Successfully setup & working shortcode, but other problem founded,
    1) [badgeos_tk_earn_achievement_for_page_view achievement_id=”52″], this sortcode earned badge only 1 time, how to set up unlimited earn points this badge?
    2) who user earned not displaying name, only point for displaying.
    3) can i possible adding new ”required step” for badge. example, (earn viewing the page)
    Please solve my all problems.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    All the shortcode does, as you can see, is pass the user and achievement ID into the badgeos_maybe_award_achievement_to_user function. The rest of the logic determining whether or not the user deserves the achievement however many times is up to the system to handle. I’m not going to be able to manipulate that at this point of execution.

    1) This would depend on your achievement settings for the achievement(s) used in the shortcode.
    2) Not quite following where this is for. Possibly the widget? If so, I’d check the settings for that to see what’s set to be shown.
    3) You can do whatever you want with the achievement settings, but note you may have to revoke for users if you change settings after they’ve already earned the achievement. It doesn’t re-check and re-qualify after having already awarded.

    Thread Starter bharatmahajan51

    (@bharatmahajan51)

    ok, thank you so much.

    Thread Starter bharatmahajan51

    (@bharatmahajan51)

    Hi, Michael one more question please,
    how to set up setting badgeos, that earn points for playing online game?

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Best I can think of would be reviewed submissions for that one. I can’t think of any way to automate the earning of that type of thing, and we don’t have any triggers for that specifically.

    Thread Starter bharatmahajan51

    (@bharatmahajan51)

    Can I use any other badgeos premium plugin working for this type.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    I am not aware of any of the premium plugins offering triggers/ways to track online game playing, to be honest. There is an addon that is based on referral links. If you’re able to provide some sort of customizable landing page or popup after the online game is done, you could use it to provide a specific link to click and earn the achievement.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Earned the badges by only clicking or viewing, can possible using badgeos plugin?’ is closed to new replies.