Unit Duration problem after update to 3.9.7

Home Forums Legacy Support Support queries Update Issues Unit Duration problem after update to 3.9.7

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #232917
    ateya3d
    Spectator
    Hello i use a custome php code you give it to me to show the total unit number and total units time in hours in course details after the update to 3.9.7 i get this error in error log /wp-content/plugins/wplms-assignments/includes/class.assignment-process.php on line 202 PHP Warning:  A non-numeric value encountered in /wp-content/themes/wplmsblankchildhtheme/functions.php on line 94   this is the line 94 $duration = $duration + ($unit_duration_parameter * get_post_meta($unit,'vibe_duration',true))/3600;   this is the first problem when i try to use the total units duration from the course setting it's illustrate the total duration in days, hours how can i show the duration in hours, minutes <span style="color: #222222; font-family: Consolas, 'Lucida Console', 'Courier New', monospace; font-size: 12px; white-space: pre-wrap;">https://image.prntscr.com/image/KYqi3DnJRSKhzhpiEGjaEQ.jpg</span>
    #232918
    ateya3d
    Spectator
    This reply has been marked as private.
    #232923
    MrVibe
    Keymaster
    The unit duration parameter should not be zero or space. Can you just edit the units of the course and make sure that the unit duration value and unit duration parameter is not zero or blank. Like when you set unit duration as 5 minutes , 5 is the unit duration value and minutes (60 in seconds) is the unit duration parameter. I am also adding a code fix to ensure this issue should not appear I. The first place.the fix would be available in this weeks update 3.9.7.1 P.s: the 3.9.7 update has nothing connected to it.
    #232925
    ateya3d
    Spectator
    i have inspect 262 Unit items no any unit duration Zero or Blank or Space i'm not care this problem related to 3.9.7 update or no , but the error start in appearing after i have update my theme to 3.9.7 i ask you second question but you don't reply it when i try to use the total units duration from the course setting in LMS Setting it's illustrate the total duration in days, hours how can i show the duration in hours, minutes https://image.prntscr.com/image/KYqi3DnJRSKhzhpiEGjaEQ.jpg
    #233052
    Anshuman Sahu
    Keymaster
    to check and solve the error we would need your valid ftp credentials along with admin credential . Secondly to show that time in hours and minutes please try adding this code in your wplms-customizer.php file in wplms customizer plugin : add_filter('wplms_cs_get_course_unit_durations',function($html,$seconds){     return date("H:i:s", $seconds); },10,2);
    #233751
    ateya3d
    Spectator
    this code not work
    add_filter('wplms_cs_get_course_unit_durations',function($html,$seconds){
    
        return date("H:i:s", $seconds);
    
    },10,2);
    it's show 74 hours as 01:55:00
    #233888
    Anshuman Sahu
    Keymaster
    Yes you are right . Corrected code : add_filter('wplms_cs_get_course_unit_durations',function($html,$seconds){ $hours = floor($seconds / 3600); $minutes = floor(($seconds / 60) % 60); $seconds = $seconds % 60; return "$hours:$minutes:$seconds"; },10,2);  
    #233892
    ateya3d
    Spectator
    the code is work the final request , i want after the hours count to add word HOURS like this 74 HOURS
    #234005
    Anshuman Sahu
    Keymaster
    change this line :

    return "$hours:$minutes:$seconds";

      to this : return "$hours Hours $minutes:$seconds";  
Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Unit Duration problem after update to 3.9.7’ is closed to new replies.