RSS

Piwik: MultiSitesPlugin update after 0.2.37 upgrade

Saturday, 31 July 2010

We are starting to use Piwik more and more, and a thread on the forum points to issues with the MultiSitesPlugin after the upgrade to 0.2.37. I managed to spend some time over the weekend and got the basic features working with the code changes below. Sparklines and sorting don't work, but I should be able to clean those up later this week. Stay tuned.

from about line #85 in Controller.php

foreach($my_sites as &$site)
{
        $tmp = $visits_piwik_array[$site['idsite']]->getColumn(0);
        $site['visits'] = $tmp[0];
        $tmp = $actions_piwik_array[$site['idsite']]->getColumn(0);
        $site['actions'] = $tmp[0];
        $tmp = $unique_users_piwik_array[$site['idsite']]->getColumn(0);
        $site['unique'] = $tmp[0];

        $site['last_visits'] = $last_visits_piwik_array[$site['idsite']]->getColumn(0);
        $site['last_actions'] = $last_actions_piwik_array[$site['idsite']]->getColumn(0);
        $site['last_unique'] = $last_unique_users_piwik_array[$site['idsite']]->getColumn(0);
        $site['sparkline'] = $sparklines_piwik_array[$site['idsite']];
        $site['visits_summary'] = $visits_summary[$site['idsite']]['text'];
        $site['visits_summary_value'] = $visits_summary[$site['idsite']]['value'];
        $site['actions_summary'] = $actions_summary[$site['idsite']]['text'];
        $site['actions_summary_value'] = $actions_summary[$site['idsite']]['value'];
        $site['unique_summary'] = $unique_summary[$site['idsite']]['text'];
        $site['unique_summary_value'] = $unique_summary[$site['idsite']]['value'];
}

and again, from about line 130 in Controller.php

foreach($sites as $s)
{      
        $my_sites_ids[] = $s['idsite'];
        $unique += $s['unique'];
        $visits += $s['visits'];
        $actions += $s['actions'];
        $last_unique += $s['last_unique'][0];
        $last_visits += $s['last_visits'][0];
        $last_actions += $s['last_actions'][0];

}



This entry was written by Karl Kopp, posted on Saturday, 31 July 2010 Bookmark the permalink. Follow any comments here with the RSS feed for this post. You can post a comment.

Post a comment

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact me so we can take care of it!

Visit my friends!

A few highly recommended friends...

About

Some semi-interesting ramblings from a technology geek (me, Karl Kopp) about some future adventures...