How to Fix Layout Issues

If you’ve upgraded from v2.x to v3.x and experience layout issues such as duplicate icons (admin area) or slow load times in the front-end, please be sure to “purge your cache” from your CloudFlare account.

If you don’t use CloudFlare, your webhost might be caching or compressing your CSS and JS files. Ask your webhost to purge the cache for your account.

And if you still experience problems with the front-end layout, please delete the files from your /Smarty/templates_c/ folder.

 

 

How to Update the Social Links from your template

Open footer.tpl form your current theme folder:

/templates/{current theme}/

Since it’s a basic HTML file, you can edit this file with any text editor.

Find in file the list-social-sites CSS selector.

You should be taken to the HTML responsible for your social links. It  should looks something like:

<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-youtube"></i></a></li>
<li><a href="#"><i class="fa fa-instagram"></i></a></li>

or

<li><i class="fa fa-facebook"></i> <a href="#">Facebook</a></li>
<li><i class="fa fa-twitter"></i> <a href="#">Twitter</a></li>
<li><i class="fa fa-youtube"></i> <a href="#">YouTube</a></li>
<li><i class="fa fa-instagram"></i> <a href="#">Instagram</a></li>

Replace # with your own social profile links.

Save changes and re-upload the modified file into your theme folder:

/templates/{current theme}/

PHP Melody Critical Vulnerability Fix (Aug 2017)

PHP Melody websites running anything from v2.2 to v2.7.1 are vulnerable to SQL injection and should be patched immediately as instructed below. Alternatively, you can download the v2.7.2 update package form your Customer Account with us.

To manually patch the issue, please open: /include/functions.php

Find:

	$id = ($list_id != false) ? $list_id : $list_uniq_id;
	$get_by_id = ($list_id != false) ? 'list_id' : 'list_uniq_id';

Replace with:

	if ($list_uniq_id != false && ctype_alnum($list_uniq_id) === false)
	{
		return false;
	}
	
	$id = ($list_id != false) ? (int) $list_id : secure_sql($list_uniq_id);
	$get_by_id = ($list_id != false) ? 'list_id' : 'list_uniq_id';

Find:

	$sql = "SELECT list_uniq_id 
			FROM pm_playlists 
			WHERE list_id = $list_id";

Replace with:

	$list_id = secure_sql($list_id);	
	
	$sql = "SELECT list_uniq_id 
			FROM pm_playlists 
			WHERE list_id = $list_id";

Find:

	$sql = 'SELECT * 
			FROM pm_playlists 
			WHERE user_id = '. $user_id;

Replace with:

	$user_id = secure_sql($user_id);
	
	$sql = 'SELECT * 
			FROM pm_playlists 
			WHERE user_id = '. $user_id;

 

How to Insert JavaScript Code into PHP Melody

Inserting any Javascript code (e.g. AdSense) into PHP Melody’s *.tpl files is very easy.

Since PHP Melody uses the Smarty template engine you do need to wrap your Javascript code between an open and close {literal} tags.

Here’s an example of how the AdSense code should be added into the <head> part of your site.

{literal}
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-0000000000000",
    enable_page_level_ads: true
  });
</script>
{/literal}

Note the opening and closing {literal} tags. That’s how any kind of Javascript code should be injected into any of the *.tpl files from PHP Melody.

For the official documentation please visit:
https://www.smarty.net/docs/en/language.function.literal.tpl

Troubleshooting Automated Jobs

When all your automated jobs show “Last Performed” as “Never”, your cron job might not be running. There are several common causes for this.

Case #1

Usually, the cause is forgetting to set up a cron job in the first place.We detail how to setup your new cron job in our help documents.

Case #2

Another problem might be with the server’s configuration. Hosting providers sometimes limit what commands Cron can run. For example, Inmotionhosting does not allow you to run wget at all. They do allow lynx or curl instead.

However the majority of hosting providers allow you to run wget. To make sure your hosting provider is OK with wget, Google search for: your hosting provider + cron“.  This should help you find if they forbid or allow wget via cron.  In case they don’t allow wget, adjust your crontab command as they recommend it.

Case #3

And lastly, it may be a permissions thing. See that your /cron.php file from your PHP Melody installation has the 755 permissions (i.e. is executable).

Each hosting company does things their own way. If none of these tips helped, contact your hosting provider and ask them to set up this cron job for you.

PHP Melody Critical Vulnerability Fix (Jan 2017)

PHP Melody releases before January 26th 2017 are vulnerable to SQL injection and should be patched immediately.

In case you cannot use the official package to update your PHP Melody website(s), simply apply the following changes to patch your site against intrusion. Updating is still required but can be safely postponed to a later date.

Open file: /comment.php

Find:

$user_id = $_POST['user_id'];

Replace with:

$user_id = 0;

If you have Mobile Melody installed:

Open file: /mobile/comment.php

Find:

$user_id = $_POST['user_id'];

Replace with:

$user_id = 0;

For PHP Melody versions v2.5 and later, phpmailer can be easily updated as well.

Download phpmailer.zip and replace your existing /include/phpmailer/ folder with the one form the zip archive.

These two code patches should provide adequate security to your PHP Melody website(s). We do however recommend updating to the latest PHP Melody version to fix any pending bugs.

To download the complete update packages visit your customer account with us. To patch this critical vulnerability, you need to run at least PHP Melody v2.7.1.