• Resolved tgilber007

    (@tgilber007)


    How to display messages to users (once watched the video (or) already Watched the video (or) Hide the video) after gaining the mycred points

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tgilber007

    (@tgilber007)

    add_filter( 'mycred_video_output', 'mycred_limit_video_views', 10, 2 );
    function mycred_limit_video_views( $output, $atts ) {
        global $wpdb;
        $mycred = mycred();
       $user_id = get_current_user_id();
           $count = $wpdb->get_var( "SELECT COUNT( * ) FROM {$mycred->log_table} WHERE ref = 'watching_video' AND user_id = %d AND data = %s;", $user_id, $atts['id'] );
    
        $limit = 1; //total no of views
     
        if ( $count >= $limit )
            return '';
     
        return $output;
     
    }

    I tried out this code but it not work

    Hi @tgilber007,

    Thank you for contacting us, If you use mycred video addon a message is displayed on the front-end as soon as you receive the points.

    Screenshots: https://we.tl/t-PrOBgUYe4r

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘message for already viewed video’ is closed to new replies.