course duration not working

Home Forums Legacy Support Support queries How-to & Troubleshooting course duration not working

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #33517
    tsungyu
    Participant
    I added the code that you provided in my wplms-customizer.php file in wplms customizer plugin, but still not working. Could you tell me the correct place where should I add? Thank you.
    #33519
    tsungyu
    Participant
    Here is my page url and admin credentials. http://contentsbank.cc/ ID: admin PW: S02aab6Mm
    #34060
    Anshuman Sahu
    Keymaster
    Can you please share more information and also the link of the code ,tip or topic to check this out .
    #34073
    tsungyu
    Participant
    Shortcode to show course duration in certificate are not working in my site. I added the code that you provided in my wplms-customizer.php file but still not working. Here is code that you provided. https://wplms.io/support/knowledge-base/shortcode-to-show-course-duration-in-certificate/ Here is certificate which I added the shortcode. http://contentsbank.cc/members/toshinari/  
    #34350
    Anshuman Sahu
    Keymaster
    Well this tip requires that the activity when user started course must be recorded in the system . It fetches  date when the user started the course . If it is not recorded then it will mot work . Please check if the activity is recorded when the user started the course on your activity page . (that will be :  yoursite.com/activity)
    #34526
    tsungyu
    Participant
    Thank you for your help, it's working now. But, actually I hope can display the Start Date or duration date, not <span style="line-height: 1.5;">duration TIME.</span> Is it possible display the <span style="line-height: 1.5;">Start Date?</span>
    #34644
    H.K. Latiyan
    Participant
    You can use this code instead to show start date. add_shortcode('certificate_course_duration', 'vibe_certificate_course_duration2');   function vibe_certificate_course_duration2( $atts, $content = null ) {      global $bp,$wpdb;      $student_id=$_GET['u'];      $course_id=$_GET['c'];      $start_time = $wpdb->get_var($wpdb->prepare("SELECT date_recorded FROM {$bp->activity->table_name}          WHERE type ='subscribe_course' AND item_id=%d AND component='course' AND user_id=%d ORDER BY          id DESC LIMIT 1", $course_id,$student_id));      $expiry=get_user_meta($student_id,$course_id,true);     if(isset($start_time) && $start_time)       return  date_i18n( get_option( 'date_format' ), strtotime( $start_date ));     else       return '[certificate_course_duration]';   }
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘course duration not working’ is closed to new replies.