From fb9d6d845732d2af646f522ebb277c5202f408b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=EF=BF=BD=EF=BF=BD?= Date: Wed, 18 Jun 2014 15:05:34 +0000 Subject: [PATCH] piwik: properly record the site id after creation --- bureau/class/m_piwik.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bureau/class/m_piwik.php b/bureau/class/m_piwik.php index 58940475..6d776261 100644 --- a/bureau/class/m_piwik.php +++ b/bureau/class/m_piwik.php @@ -292,9 +292,10 @@ class m_piwik { // Ajoute un site à Piwik // can't figure out how to pass multiple url through the API function site_add($siteName, $urls, $ecommerce = FALSE) { + global $db, $cuid; $urls = is_array($urls) ? implode(',', $urls) : $urls; $api_data = $this->call_privileged_page('API', 'SitesManager.addSite', array('siteName' => $siteName, 'urls' => $urls)); - printvar($api_data); + $db->query("INSERT INTO piwik_sites set uid='$cuid', piwik_id='{$api_data->value}'"); return TRUE; }