How to redirect to a page after completing a Learndash course

How to redirect to a page after completing a Learndash course

How to redirect to a page after completing a Learndash course

Congratulations page
[wpseo_breadcrumb]


This tutorial is an improve version of Zac Gordon’s How to Redirect to Custom Page After Completing a LearnDash Course version.
While his tutorial works just fine, it is limited only for Linear Course progression setting.

What is similar?

Like Zac’s tutorial, in order for this to work you must do the following:

  1. First, create a parent page and name it to anything you like. mine will be name as “Congrats”.
  2. Then create a child page under “Congrats” with the same slug URL of the course you want to be redirected.
  3. Lastly, add a code snippet on functions.php (recommended in a child theme)

Optionally but recommended, make the Parent page private. As it has no content, it’s better to be unavailable for public view.

What is different between Zac’s and mine?

With Zac’s code, it is more incline for Linear courses. Meaning, you can’t jump from lesson to lesson or topic to topic. Everything is in order. If however, the author wanted to make his course Free form, his code doesn’t work anymore. Every time you click the last topic, it will redirect you to the page you set. Regardless if all topics and lessons are completed.

The main difference is the code snippet itself. In his code, he actually use LearnDash’s filter hook learndash_course_completion_url that filters the URL. This make sense why it redirects after the last topic has been completed even if the course is not yet totally completed at all.

With my improve code, we are actually using the correct action hook that will redirect any courses that is truly completed.

The Code snippet explained

[php]
 add_action('learndash_course_completed', 'course_completed', 10, 1);

function course_completed( $data ) {
    $course_id = $data['course']->ID;
    $slug_url = get_post_field( 'post_name', $course_id );

    if ($course_id) {
        wp_redirect(site_url("/congrats/$slug_url"));
        exit;
    }
}
[/php]

Using the action hook learndash_course_completed, it triggers a function right after a course has been completed. Instead of filtering a URL like what Zac is actually doing.

So in my code, we created a trigger using the action hook, then get the course URL and redirect it right away to the child page.

Hopefully, I have explained it well. Happy to help everyone! 🙂

How to Upload Music Files using sFTP in Azuracast?

How to Upload Music Files using sFTP in Azuracast?

How to Upload Music Files using sFTP in Azuracast?

[wpseo_breadcrumb]

In the early days of Azuracast, connecting via SFTP was a bit tricky and hard.

docker run –rm \\\\\\\\\\\\\\\\

    -v azuracast_station_data:/home/azuracast/stations \\\\\\\\\\\\\\\\

    -p 2222:22 atmoz/sftp:alpine \\\\\\\\\\\\\\\\

    azuracast:C27b6889c75ee8238e2:1000::stations

Especially for the newbies or for users who are not confident with using the shell command, the code above is not something they want to try.

Good thing, Azuracast has improved a long the way. With the latest AzuraCast version, SFTP connection has been made easier. So I will be guiding you on how to create an SFTP user and then connect the user using several FTP clients such as Coda 2 for Mac users, the more popular one, FileZilla and for advanced users, the Terminal command.

Create the SFTP user

On the sidebar, under Utilities >> click SFTP user

Click “Add SFTP user” then fill up the username and password. Note that “SSH Public Keys” is optional but recommended if you don’t want to use a password when connecting.

Once you have the user, take note of the IP address and port number located on the right sidebar under “Connection Information”.

Once you have the prerequisites, it’s now time to connect using FTP clients.

Connect using Coda 2 by Panic

Open the application. Click the + button located at the bottom left. Then click the server tab and add the parameters. Protocol must be SFTP. Fill up the following fields using the (dynamic) informations from the SFTP tab of your Azuracast panel.

Click save then double click the information to connect. Once connected, you can now upload your audio files directly or create folders first to organize them.

Troubleshooting tips:

If files under Music files tab are not in-sync with the files in the SFTP client, do the following until it’s showing:

  1. Reload broswer
  2. Create a new folder – https://share.getcloudapp.com/jkuK6yOr
  3. In your SFTP client, refresh the directory (right click on your mouse then choose refresh)
  4. If it’s still not showing, reprocess media by navigating to /var/azuraast then executing ./docker.sh cli azuracast:media:reprocess command.

    cd /var/azracast

    ./docker.sh cli azuracast:media:reprocess


    https://share.getcloudapp.com/mXuqv7DB (Note: You must have root privileges to do this. If not permitted, please inform your system administrator.)

Connect using FileZilla

Open the application. On the Host field: Enter the correct format sftp://domainOrIP. On my example, the hostname should be sftp://206.189.152.134.

Connect using Mac Terminal

Open the application. This format should be followed:

sftp -P(not p) {port#} username@IP

Example, sftp -P 2022 [email protected] then hit enter. Type the password when prompted.

Tips:

  1. To upload files use “put{filename}.
  2. Make sure that your are on the right directory. To check local dirctory use “lpwd” command.

How to Ban a malicious IP in Azuracast?

How to Ban a malicious IP in Azuracast?

How to Ban a malicious IP in Azuracast?

[wpseo_breadcrumb]

There are times when checking your listeners, (in Reports tab >> Listeners) you might encounter unwanted IPs. Mostly these IPs have an “EMPTY” user agent. They have a longer listening Time (sec). So you might ask yourself, “how can I ban these IPs?”



In Azuracast, banning an IP works the same way, with other radio hosting platforms. For the regular user, you can use the Azuracast UI to ban the IP on your streaming media server. And here’s how to do it:

For SHOUTCAST

Click Profile tab >> click Administration URL under Broadcasting Service section >> enter the username and password. Take note that the default user will always be “admin”. Still, on the Broadcasting Service section, copy and enter the “Administration password”.

Once you are inside the SHOUTcast panel, do this in the following order:

  1. Click Ban list
  2. Enter the IP address to ban
  3. Click Ban single IP or Ban whole subnet for multiple range
  4. Check to review if the IP is on the list. You can also click remove to unban it.

Check the image below for visualization.

For ICECAST

There’s no easy way to ban an IP on your ICEcast streaming server. As the admin settings have no interface to ban an IP add. You should be at least an advanced user and confident with terminal (SSH) commands.

To make the banning of an IP possible, you have to edit your nginx.config file.

Take note that Azuracast is hosted on a Nginx server and not Apache. This means that banning an IP using .htaccess is not possible.

A tutorial has been documented in Github on how to do it the hard way. You might want to check it out.

How to set up Admob advertising for published and unpublished radio app?

How to set up Admob advertising for published and unpublished radio app?

How to set up Admob advertising for published and unpublished radio app?

[wpseo_breadcrumb]

Here at Internet Radio Cast on VPS, we are guiding you how to set up Admob advertising in case you want to monetize your radio mobile app.

Set up an unpublished app

By default, our app will enable Admob advertising for Banner and Interstitial Ads on Category unless requested by the customer to disable it. And because of that, we will be asking you to send us the generated codes for Banner and Interstitial ad unit.

All in all we need the following:

  • Admob publisher ID
  • App ID
  • Banner ad unit ID
  • Interstitial ad unit ID

Please check the tutorial video on how to generate the ad units and where to find the App and publisher IDs.

Set up a published app

If your app has been published already, you can still advertise by following these steps.

  1. Sign in to your AdMob account at https://apps.admob.com.
  2. Click Apps in the sidebar.
  3. Click Add app. A dialog box appears.
  4. Click Yes.
  5. Enter the name of the app and click Search.
  6. Click Add beside the app you want to add.

Video tutorial: Auto Login to your Azuracast server

Video tutorial: Auto Login to your Azuracast server

Video tutorial: Auto Login to your Azuracast server

[wpseo_breadcrumb]

Here at Internet Radio Cast on VPS, we are constantly updating our website’s features. This is to make our customers happy and satisfied with the services and products that we offer.

On our recent updates, you can now auto login to your Azuracast server. Please check the video above or in Youtube.

Thank you for watching!