Ticket #254 (new Bug)

Opened 5 months ago

Last modified 1 month ago

Link to country flags does not work correctly when embedding Piwik in PHP site

Reported by: meglio Assigned to:
Priority: major Milestone: RobotRock
Component: Plugins Version:
Keywords: flag flags country countries Cc:

Description

I have embedded Piwik to my PHP site and I'm calling Piwik from PHP code directly.

In the code Piwik checks whether file exists:

function Piwik_getFlagFromCode($code)
{
	$path = 'plugins/UserCountry/flags/%s.png';
	$normalPath = sprintf($path,$code);
	// flags not in the package !
	if(!file_exists($normalPath))
	{
		return sprintf($path, 'xx');			
	}
	return $normalPath;
}

The PHP file where I'm calling Piwik locates in different folder. Really flag file exists but this function can't locate it and returns 'xx' value.

I have solved this problem just by commenting IF section. But you have to invent something to make it more intelligent.

Thanks, Anton Andriyevskyy

Change History

06/30/08 00:47:49 changed by matt

  • milestone set to Stable release.

10/10/08 16:26:23 changed by matt

  • milestone changed from Stable release to RobotRock.