Category: How-to

Common requests answered

  • How to Manually Change Your Password (for back-end access)

    Losing your PHP Melody admin password isn’t the end of the world. In this post we will help you overwrite your existing password in a matter of minutes.

    Reasons why you might need this tutorial:

    • forgot the darn password
    • someone changed it and forgot to tell you
    • retrieving the password via the “Forgot your password” page fails

    Before you begin make sure you have the login details for your cPanel, Plesk or your hosting management console.

    If you’re already familiar with MySQL simply execute this MySQL query:

    UPDATE `pm_users` SET `password` = MD5('newpassword') WHERE `pm_users`.`id` = 1;

    Replace “newpassword” with your desired password.

    Otherwise, log into your cPanel/Plesk account:

    1. Find the phpMyAdmin link which will take you to your MySQL databases
    2. Select your PHP Melody MySQL database
    3. Select the “pm_users” table from all of PHP Melody’s tables
    4. Click on the top left “Browse” tab to see the contents of the “pm_users” table
    5. Go to the first listing (ID number 1), normally the “admin” account and click the edit button (the pencil)
    6. Once on the edit page for the admin account, type in your new password in plain text
    7. Make sure you select “md5 from the functions column (on the left of your password)
    8. Hit the “Go” or “Save” button and try your new password by accessing your PHP Melody admin area.

    We also have a quick video on the entire procedure:

  • How to Add a New Link In the Header Menu

    Including a new link into your PHP Melody header menu (see image) is very easy.

    All you have to do is open the template file responsible for the header and include the HTML for your new link.

    In the following example we’re going to include a new link, named ‘Special Link‘ which points to https://www.phpmelody.com/. Here’s how to do it.

    1. Open your /templates/[current theme folder]/header.tpl file with a plain-text editor.
    2. Search for the following code:
      {if $smarty.const._MOD_ARTICLE == 1}
    3. Add your new link right after the closing {/if} like so:
      <li><a href="https://www.phpmelody.com/" class="wide-nav-link">Special Link</a></li>

    Here’s how the code should look:

     

    That’s it. Upload the updated header.tpl file back to your PHP Melody installation and the new link will appear in the header menu.

     

  • Show hidden files on a Mac

    Update: You can download an app (Funter) to do all the work for you.

    PHP Melody includes several files beginning with a dot (e.g. .htaccess). If you’re using a Mac OS to upload the PHP Melody into your server, you’ll have to first make the .htaccess files visible in Finder or your FTP app.

    To show hidden files, first open up the Terminal app. If you’ve never used this, it’s here:

    Appli­cations → Utilities → Terminal

    A quick note before you do anything: using Terminal without knowing what you’re doing can really screw up your computer. It’s not unsafe to do, you just have to be very careful not to type in any commands that you don’t intend to. As such make sure you’ve read the code below carefully and have typed it exactly as written! You have been warned.

    Okay now, right after the dollar sign you can go ahead and type or paste in the code below, and press enter.

    defaults write com.apple.finder AppleShowAllFiles TRUE

    Nothing will happen yet, because you need to restart Finder for the changes to take effect. To do this, you can either press option+command+esc to open the Force Quit Appli­cations window, select Finder from the list and hit “Relaunch”, or simply type in the code below in the Terminal window, and again press enter.

    killall Finder

    If you typed those lines correctly, your desktop icons should disappear for just a second while Finder restarts and the code in your finder window will look like the image screenshot below.

    Now any hidden files on the system should be visible. If you’re not seeing the file you expected, it’s possible that your FTP client is not configured to pull down those hidden files, so you may need to check those settings also. And remember, deleting any system files can break stuff on your computer—if you’re going to go through this process, make sure you’re only editing stuff you know is pertinent to your site, like the .htaccess file.

    [Source]

  • How to improve the quality of your preview images

    Note: Newer PHP Melody versions do not require this change. You can change the thumbnail quality straight form the back-end interface.
    Browse to your ‘Settings‘ page (under the ‘General Settings‘ tab) and look for ‘Use thumbnail size‘. For PHP Melody versions released in early 2015 read on.

    low-quality-imageIf you’ve recently (April 2015) updated your PHP Melody website and noticed the preview images look pixelated, like the image on the right, please read on.

    Let’s get started.

    Step 1.

    Make sure that you are using PHP Melody v2.3.1 or newer.
    Note: This procedure not apply to older installations (i.e. before v2.3.1).

    Step 2.

    Open your PHP Melody’s /include/functions.php file and search for the following (Lines: 1078 to 1082):

    // if ($video['source_id'] == $video_sources['youtube']['source_id'] && $video['yt_id'] != '')
    // {
    // 	$video['preview_image'] = 'https://i.ytimg.com/vi/'. $video['yt_id'] .'/hqdefault.jpg'; 
    // }
    

    Replace that with:

    if ($video['source_id'] == $video_sources['youtube']['source_id'] && $video['yt_id'] != '')
    {
    	$video['preview_image'] = 'https://i.ytimg.com/vi/'. $video['yt_id'] .'/hqdefault.jpg'; 
    }
    

    Step 3.

    Save functions.php and upload it to the /include/ folder.
    Enjoy your new high quality preview images.

    Notes.

    #1 The issue is found only in installations which were upgraded to PHP Melody v2.3 (before April, 2015). Newer installations should not be affected by this issue.
    #2 If there are still problems with your preview images, please contact customer support.

  • How to add classic ads (banners) manually

    Sometimes a restrictive ‘mod_security’ configuration prevents you from creating banners in PHP Melody.

    That’s when you need to roll up your sleeves and add banners the old fashion way (or change hosting providers).

    Let’s start by adding banners in the already defined ad zones (e.g. header, floating ads, video page, etc.).

    Here are all the template files which already have defined ‘ad zones’.

    /templates/default/article-read.tpl:
    /templates/default/footer.tpl:
    /templates/default/header.tpl:
    /templates/default/index.tpl:
    /templates/default/video-watch.tpl:

    In any of these files you will find one or more instances of the following code snippet (where X is a number):

    {$ad_X}

    To add your banners, replace all instances of {$ad_X} with your own HTML code.

    To get a complete list of existing ‘ad zones’ log into your PHP Melody back-end and browse to the following page, as illustrated below:

    screenshot-demo phpmelody com 2014-11-25 12-23-28

    If you still need help with this, you can always get in touch with our customer support.