Category: Working with PHP Melody

  • Featured Categories on Homepage

    Starting with PHP Melody v2.5 you can show videos from selected categories on your homepage. We call those “featured categories”. To show a featured category on your homepage simply browse to your PHP Melody back-end and follow the instructions as illustrated below.

    Clicking on the home icon will mark any category as “featured”.

  • How to create a YouTube API key

    As is tradition, the process consists of 3 easy steps:

    1. Creating a new project in your Google Cloud Platform account.
    2. Enabling the “YouTube Data API V3″ data source for your newly created project. 
    3. Generating the API key to access the YouTube API.

    Step 1

    Log into your Google Cloud Platform account. Create your new project or select an existing one. 

     

    Step 2

    Once your new project is available, search “YouTube Data API V3” and enable the data source. You can also create the project here if you’re a rebel and skipped step 1. 

    The end goal is to enable the YouTube data source for your project, which you did. Half-way there.

     

    Step 3

    Generate and save your API keys as illustrated below. But first, locate the YouTube DATA API.

     

    Here you can choose to restrict the API key to your own domain. If unsure about this, leave the default options until you get the website operational. Otherwise, make sure to use the correct details about your domain and the rules you set. This part can’t be ignored and is the #1 source for problems. 

    When set incorrectly, there can be no communication between your domain and the YouTube API since the restrictions/rules prevent it. Don’t worry, you’ll get an error message about it. 

     

     

    Job done 🥳

    Just copy/pasta your shiny new API key in PHP Melody’s ‘Settings’ page (you know where) and you’re good to go.

    Have fun and be mindful of API usage and Google’s terms of service. 

     

  • How to Create a Cron Job

    The “Automated Jobs” feature from PHP Melody requires a cron job to run a PHP script on a regular basis.
    Most of the times this can be easily be accomplished with the help of crontab (linux).

    To setup your new cron job, you need to know the URL/command which cron will run. Retrieve this information log into your PHP Melody’s back-end and browse to the Automated Jobs > Setup page.

    Once you retrieved your URL/command (should include a secret key), proceed with setting up your cron job as follows.

    Method 1: Setup cron via cPanel, Plesk or your webhost panel

    If you’re running PHP Melody on a shared hosting account or VPS, your webhost has already provided you with some sort of management area such as cPanel or Plesk.

    Since adding a new cron job is already very well documented for both cPanel and Plesk we recommend using their instructions:

    We also have a quick video on the entire cPanel procedure:

    Method 2: Creating a new cron job using the command line (linux)

    If you own the server or have access to the command line, edit your crontab by running:

    # crontab -e

    In a new line, add your cron job by pasting in the following line:

    */5 * * * * wget -q "https://www.PHPMELODY-URL.com/cron.php?cron-key=SECRET_KEY"

    This example uses a dummy URL. To get your URL (with the secret key), visit your PHP Melody back-end and browse to the Automated Jobs > Setup page.

  • Verified Channels

    Users with the “Verified Channel” mark represent a trusted source of content. The verification process or criteria depends on a per-project basis and should be handled by the site’s administrator.

    “Verified channels”  display a checkmark icon to the right of the channel name, and “Verified” appears in a popup if you point your cursor at it.

    In addition to having the verification badge applied to their profile/channel, verified users can also be allowed more freedom when it comes to publishing videos.

    For example, users which own a “verified channel” can have their submissions automatically approved even if PHP Melody is configured to require manual approval of all user submitted content.

    This feature was introduced in PHP Melody v2.6 and is part of the “Social Module”.