• 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.

  • Can’t add any ‘classic ads’. Internal Error 500.

    If creating or saving ads in PHP Melody returns an ‘Internal Error 500’ message, your hosting provider has a restrictive ‘mod_security’ configuration.

    There are several things which you can do to fix circumvent this problem.

    Option 1

    Call or live chat with your hosting provider and ask them to disable ‘mod_security’ for your hosting account. GoDaddy is known not to help in this case and simply play dumb. You’ll be wasting your time with them on this issue. Other hosting providers are more helpful and cooperative.

    Option 2

    Try disabling ‘mod_security’ yourself via .htaccess.

    Open .htaccess and add these lines at the end of the file:

    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </IfModule>

    Or in some cases this might also work:

    <IfModule mod_env.c>
    SetEnv MODSEC_ENABLE Off
    PassEnv MODSEC_ENABLE
    </IfModule>

    Note: this method will not work with mod_security2 or on GoDaddy accounts.

    Option 3

    If you have your own server you can edit your ‘mod_security’ config file and white-list some PHP Melody files.

    Locate and open your mod_security config file. In this case, the config file was found at: /usr/local/apache/conf/modsec2/whitelist.conf

    Add the following lines:

    <LocationMatch "/admin/ad_manager.php">
    SecRuleRemoveById 300015 300016 300017
    </LocationMatch>
    <LocationMatch "/admin/admin-ajax.php">
    SecRuleRemoveById 300015 300016 300017
    </LocationMatch>
    <LocationMatch "/admin/prerollstatic_ad_manager.php">
    SecRuleRemoveById 300015 300016 300017
    </LocationMatch>

    Option 4

    If everything fails, you can quickly insert the ads code via phpMyAdmin. Browse to your PHP Melody database, select the ‘pm_ads’ table and in the ‘code’ field of your desired ad zone add the HTML code provided by your ad partner.

    You can also add banners manually by editing your theme files.

    Good luck!

  • How to rename the ‘admin’ folder in PHP Melody

    Starting with PHP Melody v2.2 you can easily move/rename PHP Melody’s ‘admin‘ folder.

    You may want to do this for several reasons all concerning the security of your website. Let’s see how you can rename the ‘admin‘ folder without breaking PHP Melody.

    Step 1.

    Open /config.php and find this line:

    define('_ADMIN_FOLDER', 'admin');

    Replace the ‘admin‘ value with your new folder name (e.g. admin2015). Edit only the underlined bit. Make sure there are no empty spaces between the single quotes.

    Save and upload /config.php to your installation.

    Step 2.

    Rename your ‘admin‘ folder to match the new folder name (i.e. admin2015).

    That’s it. Job done!

  • How to create ad zones in Mobile Melody v2.x

    As you know, PHP Melody comes with pre-made ad zones for the ‘Classic banners’.

    However, if you want to add ads to your Mobile Melody layout, you need to create new ad zones. This is because, unfortunately most banners do not come with responsive support. Having separate ad zones for Mobile Melody will also enable you to easily track you mobile traffic revenue separately form your regular (desktop) site.

    To add your first ads on Mobile Melody, you need to log into the PHP Melody back-end and go to “Advertisements > Classic Banners” page. Click the “Create new ad zone” and in the “name” field (the first form field) use any of these names:

    • mobile_header
    • mobile_footer
    • mobile_video
    • mobile_article

    Mobile Melody will recognize and display these ads them as follows:

    • mobile_header: appears in the header
    • mobile_footer: appears in the footer
    • mobile_video: appears after the video player
    • mobile_article: appears after the article

    Here is a screenshot to get you started, but if you have any questions please contact the support team.

    How to add Mobile Melody ads