Restrict access to courses by IP and type

Home Forums Legacy Support Support queries How-to & Troubleshooting Restrict access to courses by IP and type

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #108818
    Hello, The courses we have are for internal users and external users. Internal users are users who access the platform through our proxy server and external users are everyone else. We want to be able to specify what courses the external and internal users can view. What would you suggest, please?
    #108978
    H.K. Latiyan
    Participant
    Sorry this is not possible in wplms.
    #109153
    I'm trying to implement that myself, but I'm unable to override courses file. I've copied course/course-loop.php to my child theme, but it's not overriding the parent theme file. I want to override the file that lists the courses in "all-courses" and in the homepage. What am I missing?
    #109227
    H.K. Latiyan
    Participant
    It comes from the theme/wplms/course/course-loop.php file Please make sure you add the file in your child theme with the same name and inside the same folder, like theme/child theme/course/course-loop.php
    #109283
    Yes, I know that it comes from that directory and I ensured I added the same directory to the child theme. What I noticed though is that if I make changes to the file that's in the child theme, the code shows up in the source code (ctrl+u), but it doesn't show up in the browser. It's as if the code is added and then it's replaced with the original file. I tested removing all the code from the course-loop.php file, then when I check the page source code, there's nothing there (only the header and the footer), but in the browser I see everything as if I hadn't removed anything. Please advise.
    #109477
    H.K. Latiyan
    Participant
    This happens due to the ajax call "course_filter" present in the vibe course module plugin. After the page is loaded this ajax call is made and it fetches all the courses to be shown. You'll have to make changes in the ajax call to reflect the changes.
    #109525
    Right, why is that ajax call needed and how can I abort that without losing the change when the plugin is updated? I wanted to fetch the courses with the course-loop.php file. I see that the ajax call is being made in the file "plugins/vibe-course-module/includes/course.js" at line 101: bp_filter_request( 'course', '', '', 'div.course','', 1,'{}'); The function "bp_filter_request" is in the file "_inc/global.js" Appreciate your help!
    #109534
    Now I understand that the ajax call is used in the pagination too, so that's why it's needed. How can I override the code that loads the courses in bp-course-filters.php? I've created a custom field in courses and I want to check the value of that field before listing the courses.
    #109630
    H.K. Latiyan
    Participant
    Its a php code, you cannot override php codes. To change the ajax, first you need to use remove_action and then add your own action on for changing the ajax call. For more details on remove_action, refer: https://codex.wordpress.org/Function_Reference/remove_action
Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Restrict access to courses by IP and type’ is closed to new replies.