Home › Forums › Legacy Support › Support queries › Setup issues › ALL unit popup
Tagged: popup
- This topic has 3 replies, 2 voices, and was last updated 9 years ago by Anshuman Sahu.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
December 14, 2015 at 2:06 am #13728rockylinSpectatorCan i let all unit popup?Not just free unit popup,thanks.December 14, 2015 at 7:25 am #13756Anshuman SahuKeymasterAdd this code in your wplms-customizer.php file in wplms customizer plugin : add_filter('wplms_curriculum_course_link','enable_course_students_view_units_curriculum'); function enable_course_students_view_units_curriculum($enable){ $user_id = get_current_user_id(); $course_id = get_the_ID(); if(wplms_user_course_active_check($user_id,$course_id)) return 1; return $enable; } add_filter('wplms_direct_access_tounit','enable_access_tostudents',10,2); function enable_access_tostudents($flag,$post){ $user_id = get_current_user_id(); $check = get_user_meta($user_id,$post->ID,true); if(!empty($check)){ return 0; } return $flag; } add_filter('wplms_course_curriculum_free_access','wplms_custom_course_curriculum_free_access',10,3); function wplms_custom_course_curriculum_free_access($html,$lesson,$free){ if(vibe_validate($free)) $html ='<a href="'.get_permalink($lesson).'" class="ajax_unit">'.get_the_title($lesson).(vibe_validate($free)?'<span>'.__('FREE','vibe').'</span>':'').'</a>'; return $html; } 4. Add the following code in WPLMS Customizer -> custom.js file : (requires FTP) Code: jQuery(document).ready(function(){ jQuery('.ajax_unit').magnificPopup({ type: 'ajax', alignTop: true, fixedContentPos: true, fixedBgPos: true, overflowY: 'auto', closeBtnInside: true, preloader: false, midClick: true, removalDelay: 300, mainClass: 'my-mfp-zoom-in', callbacks: { parseAjax: function(mfpResponse) { mfpResponse.data = jQuery(mfpResponse.data).find('.unit_wrap'); }, ajaxContentAdded: function() { // jQuery('video,audio').mediaelementplayer(); jQuery('.fitvids').fitVids(); jQuery('.tip').tooltip(); jQuery('.nav-tabs li:first a').tab('show'); jQuery('.nav-tabs li a').click(function(event){ event.preventDefault(); jQuery(this).tab('show'); }); } } }); });December 17, 2015 at 11:58 am #14363rockylinSpectatorHi Alex: i'm already add those code in plugin but it ddin't work. can you check? here is my web info url:http://supershortcut.com/wp-admin/ account:wplms password:L3Y1@vXg@9)@j@Pi^7Pg(R1j thanks.December 18, 2015 at 6:47 am #14494Anshuman SahuKeymasterI have modified the code and it seems it have done what you were asking . Please check . Note that only students which are added to the course will be able to see the units from the curriculum in popup .
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘ALL unit popup’ is closed to new replies.