Custom Statistics Panels

Permalink Browser Info Environment
Hi,

I was trying to register a custom stats panel to include within another of my packages however I'm running into a few issues. I've tried to follow your instructions on your website but I think I'm getting a bit confused.
http://concrete5packages.com/toolbox/stats/custom-statistics-panels...

I've modified your code so that it reads as follows:
Loader::helper('stats','tony_stats');
Loader::model('panel','tony_stats');
$urlHelper = Loader::helper('concrete/urls');
$packageHandle='tony_stats';
$statsPkg = Package::getByHandle($packageHandle);
$absoluteFilePath = $urlHelper->getPackageURL($statsPkg).'/panels/popularity/';
$result = ParticleTrafficPanel::registerPanel($absoluteFilePath);

However the resulting array contains an error message 'Register panel error, invalid directory'

Any help would be greatly appreciated.

Thanks!

Type: Discussion
Status: New
bashton
View Replies:
Tony replied on at Permalink Reply
Tony
Did you create that directory with the necessary files within it, like what's there with the other panels?
bashton replied on at Permalink Reply
bashton
I was trying to register and access the panel within another custom package which I have created. Basically I was hoping to bring in a bunch of custom stats including page view and events related to that specific custom package.

Any advice on achieving this would be greatly appreciated.
Tony replied on at Permalink Reply
Tony
I'm not sure that really answers my question. did you create a directory in that location with that name?
bashton replied on at Permalink Reply
bashton
What I have done is create a custom panel in the tony_stats package. My custom panel contains both a view and controller file like the other panels. However I am trying to access that panel from within another packages called forum_stats which contains a single page within the dashboard for which I can view both user submissions and stats such as page views etc.
Tony replied on at Permalink Reply
Tony
well it's not doing much at the point where you're getting that error except for checking to see if that directory exists. You could try echoing out the $absoluteFilePath variable to see what the directory path is that it's trying to use. If that looks fine, then maybe it's a permissions error, where the application doesn't have read privileges to the new directory that you've created?

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.