From 1c5a97ae3c3a3aa47c8ac23ac47cabc809743832 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 14 Sep 2010 17:31:52 +0000 Subject: [PATCH] --- inc/ws/Controlleur/class.ws.stats.php | 296 ++++++++++++--------- inc/ws/Controlleur/class.ws.url.php | 8 + inc/ws/Metier/class.ws.book.parametres.php | 2 + style/ws/style.css | 60 ++++- 4 files changed, 236 insertions(+), 130 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.stats.php b/inc/ws/Controlleur/class.ws.stats.php index 0d12662d6..30d7eb889 100644 --- a/inc/ws/Controlleur/class.ws.stats.php +++ b/inc/ws/Controlleur/class.ws.stats.php @@ -1,21 +1,22 @@ book = round($d->visitor * 1.2); - }*/ + public static function display($bid, $annee = null, $mois = null) { - wsDroits::viewBook($bid); cubePHP::set_memory('512M'); + + $res = extranetPage::barre(); + $res .= extranetPage::tMain(); if (is_null($annee) && is_null($mois)) { - return self::vue_globale($bid); - } - if (is_null($mois)) { - return self::vue_annuelle($bid, $annee); + $res .= self::vue_globale($bid); + } elseif (is_null($mois)) { + $res .= self::vue_annuelle($bid, $annee); + } else { + $res .= self::vue_mensuelle($bid, $annee, $mois); } - return self::vue_mensuelle($bid, $annee, $mois); + $res .= extranetPage::bMain(); + return $res; } public static function getExtra($extra) @@ -58,7 +59,6 @@ class wsStats { if ($date[2] != $y || $date[1] != $m) { continue; } - fb($y, $m); $days = $x->xpath("//day[@day=" . $date[0] . "]"); foreach($days as $day) { break; @@ -210,41 +210,56 @@ class wsStats { } } - public static function getActives($stats, $rr, &$aextra, &$adown, &$adownp, &$aprint, &$afriend) + public static function getActives($stats, $book, &$aextra, &$adown, &$adownp, &$aprint, &$afriend) { - $extra = self::getExtra($rr->extras); + $extra = self::getExtra($book->extras); $aextra = ($extra != null && $stats['extras'] > 0); - $adown = ($rr->pdf == 1 && $stats['downloads'] > 0); - $adownp = ($rr->pdf == 1 && $rr->pdfComplex == 1 && $stats['partDownloads'] > 0); - $aprint = ($rr->print == 1); - $afriend = ($rr->friend == 1); + $adown = ($book->parametres->pdf == 1 && $stats['downloads'] > 0); + $adownp = ($book->parametres->pdf == 1 && $book->parametres->pdfComplex == 1 && $stats['partDownloads'] > 0); + $aprint = ($book->parametres->print == 1); + $afriend = ($book->parametres->friend == 1); } - public static function globalDatas($date_creation, $rr, $stats, $afriend, $aprint, $adown, $adownp, $aextra) + public static function globalDatas($titre, $date_creation, $book, $stats, $afriend, $aprint, $adown, $adownp, $aextra) { + global $core; $res = ''; - $res .= ''; + $res .= ''; + $res .= ''; - $res .= ''; + $res .= ''; $res .= ''; - $res .= ''; + $res .= ''; $res .= ''; + $i = 1; if ($afriend) { - $res .= ''; + $odd = $i % 2 == 1?' class="odd"':''; + $i++; + $res .= ''; } - $res .= ''; + $odd = $i % 2 == 1?' class="odd"':''; + $i++; + $res .= ''; if ($aprint) { - $res .= ''; + $odd = $i % 2 == 1?' class="odd"':''; + $i++; + $res .= ''; } if ($adown) { - $res .= ''; + $odd = $i % 2 == 1?' class="odd"':''; + $i++; + $res .= ''; } if ($adownp) { - $res .= ''; + $odd = $i % 2 == 1?' class="odd"':''; + $i++; + $res .= ''; } if ($aextra) { - $res .= ''; + $odd = $i % 2 == 1?' class="odd"':''; + $i++; + $res .= ''; } $res .= '
' . $date_creation . '' . date(__('d-m-Y'), $rr->date) . '
' . $core->typo->Titre($titre) . '
' . $date_creation . '' . date(__('d-m-Y'), $book->date) . '
' . __('Nombre de lieux de visite') . '' . $stats['places'] . '
' . __('Nombre de lieux de visite') . '' . $stats['places'] . '
' . __('Nombre de visiteurs uniques') . '' . $stats['visitors'] . '
' . __('Nombre de visites') . '' . $stats['visits'] . '
' . __('Nombre de visites') . '' . $stats['visits'] . '
' . __('Nombre de pages vues') . '' . $stats['pages'] . '
' . __('Nombre de liens envoyés') . '' . $stats['friends'] . '
' . __('Nombre de liens envoyés') . '' . $stats['friends'] . '
' . __('Nombre de liens cliqués') . '' . $stats['links'] . '
' . __('Nombre de liens cliqués') . '' . $stats['links'] . '
' . __("Nombre d'impressions") . '' . $stats['prints'] . '
' . __("Nombre d'impressions") . '' . $stats['prints'] . '
' . __('Nombre de téléchargements') . '' . $stats['downloads'] . '
' . __('Nombre de téléchargements') . '' . $stats['downloads'] . '
' . __('Nombre de téléchargements partiels') . '' . $stats['partDownloads'] . '
' . __('Nombre de téléchargements partiels') . '' . $stats['partDownloads'] . '
' . __('Accès à la rubrique') . ' ' . $extra . '' . $stats['extras'] . '
' . __('Accès à la rubrique') . ' ' . $extra . '' . $stats['extras'] . '
'; return $res; @@ -252,18 +267,25 @@ class wsStats { public static function indisponible() { - $res = wsPage::bh('stats_global'); + $res = extranetPage::bh('stats_global'); $res .= '

' . __('Les statistiques concernant cette période ne sont actuellement pas disponibles') . '

'; - $res .= wsPage::bf(); + $res .= extranetPage::bf(); return $res; } + public static function getBook($bid) + { + global $core; + $daoBook = new wsDAOBook($core->con); + return $daoBook->selectById($bid); + } + public static function vue_globale($bid, $annee = null) { global $core; - $rr = $core->con->select('SELECT * FROM book WHERE bid=' . $bid); - $extra = self::getExtra($rr->extras); + $book = self::getBook($bid); + $extra = self::getExtra($book->extras); if (is_null($annee)) { $stats = self::load_stats($bid); @@ -275,17 +297,20 @@ class wsStats { return self::indisponible(); } - self::getActives($stats, $rr, $aextra, $adown, $adownp, $aprint, $afriend); + self::getActives($stats, $book, $aextra, $adown, $adownp, $aprint, $afriend); + + $res = extranetPage::bh('stats_global'); + + $titre = __('Statistiques de la publication « %s »'); + $date_creation = __('Date de création de la publication'); - $res = wsPage::bh('stats_global'); - $titre = ($_SESSION['white'])?__('Statistiques de la publication « %s »'):__('Statistiques du fluidbook « %s »'); - $date_creation = ($_SESSION['white'])? __('Date de création de la publication'): __('Date de création du fluidbook'); - $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(sprintf($titre, $rr->titre))), 'hache2'); - $res .= self::globalDatas($date_creation, $rr, $stats, $afriend, $aprint, $adown, $adownp, $aextra); - $res .= wsPage::bf(); + $res .= self::globalDatas(sprintf($titre, $book->nom), $date_creation, $book, $stats, $afriend, $aprint, $adown, $adownp, $aextra); + $res .= extranetPage::bf(); - $res .= wsPage::bh('stats_detail_mois'); - $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(sprintf(__('Détail par mois'), $rr->titre))), 'hache2'); + $res .= extranetPage::bh('stats_detail_mois'); + $res .= ''; + $res .= ''; + $res .= '
' . $core->typo->Titre(__('Détail par mois')) . '
'; $res .= '
' ; if (is_null($annee)) { $res .= self::graph_global($bid, $stats); @@ -293,8 +318,9 @@ class wsStats { $res .= self::graph_annuel($bid, $annee, $stats); } $res .= '
'; - $res .= ''; - $res .= ''; + $res .= ''; + + $res .= ''; $res .= ''; $res .= ''; $res .= ''; @@ -334,7 +360,7 @@ class wsStats { if ($afriend) { $res .= ''; } - $res .= ''; + $res .= ''; if ($aprint) { $res .= ''; } @@ -350,7 +376,7 @@ class wsStats { $res .= ''; } foreach($year->month as $month) { - $res .= ''; + $res .= ''; $res .= ''; $res .= ''; @@ -376,16 +402,15 @@ class wsStats { } } $res .= '
' . __('Période') . '
' . __('Période') . '' . __('Lieux de visite') . '' . __('Visiteurs uniques') . '' . __('Visites') . '' . $year['friends'] . '' . $year['links'] . '' . $year['links'] . '' . $year['prints'] . '
' . strftime('%B %Y', mktime(0, 0, 0, (string)$month['month'], 15, (string)$month['year'])) . '
' . strftime('%B %Y', mktime(0, 0, 0, (string)$month['month'], 15, (string)$month['year'])) . '' . $month['places'] . '' . $month['visitors'] . '
'; - $res .= wsPage::bf(); + $res .= extranetPage::bf(); return $res; } public static function graph_global($bid, $stats) { - wsDroits::viewBook($bid); global $core; - $img = ROOT . '/images/stats/global-' . $bid . '.png'; - $imgw = WEBROOT . '/images/stats/global-' . $bid . '.png'; + $img = SYSIMG . '/stats/global-' . $bid . '.png'; + $imgw = IMG . '/stats/global-' . $bid . '.png'; $s = array(); foreach ($stats->year as $year) { @@ -397,11 +422,9 @@ class wsStats { $s[$time]['visit'] = $month['visitors']; } } - fb($s); + krsort($s); $s = array_slice($s, 0, 12, true); - // $s = array_reverse($s); - fb($s); $maxv = 0; $maxp = 0; $maxb = 0; @@ -420,7 +443,7 @@ class wsStats { if (!file_exists($img) || filemtime($img) < cubeDate::round(null, 'H')) { $im = imagecreatetruecolor(944, 306); imagelayereffect($im, IMG_EFFECT_REPLACE); - $trans = imagecolorallocatealpha($im, 244, 244, 241, 0); + $trans = imagecolorallocatealpha($im, 255, 255, 255, 0); imagefill($im, 0, 0, $trans); imagelayereffect($im, IMG_EFFECT_ALPHABLEND); $i = 1; @@ -466,12 +489,12 @@ class wsStats { imageline($im, 0 , $y0, 944 , $y0 , $c0); imagepng($im, $img); } - $res = '
' . $maxpages . '
'; - $res .= '
' . $maxb . '
'; - $res .= '
' . $maxv . '
'; - $res .= '' . __('Statistiques globales') . ''; + $res = '
' . $maxpages . '
'; + $res .= '
' . $maxb . '
'; + $res .= '
' . $maxv . '
'; + $res .= '
'; $s = array_reverse(array_pad($s, 12, false), true); - $res .= ''; + $res .= '
'; foreach($s as $time => $val) { if (!$val) { $res .= ''; @@ -481,11 +504,11 @@ class wsStats { } $res .= ''; $res .= '
' . cubeMedia::spacer(75, 20) . '' . cubeMedia::spacer(44, 20) . '
'; - $res .= ''; + $res .= '
'; $res .= ''; $res .= ''; $res .= ''; - $res .= '
' . __('Pages vues') . '' . __('Visites') . '' . __('Visiteurs uniques') . '
'; + $res .= '
'; return $res; } @@ -501,12 +524,10 @@ class wsStats { return self::vue_globale($bid, $annee); } - public static function getQ($bid, $max, &$maxp, &$maxpages, &$s) + public static function getQ($book, $max, &$maxp, &$maxpages, &$s) { - global $core; - $rrr = $core->con->select('SELECT pages FROM book WHERE bid=' . $bid); $maxpages = $maxp; - $q = max($rrr->pages / 5, 1); + $q = max($book->pages / 5, 1); $maxp /= $q; $maxp = max($max * 4, $maxp); $q = $maxpages / $maxp; @@ -517,10 +538,8 @@ class wsStats { public static function graph_annuel($bid, $a, $stats) { - wsDroits::viewBook($bid); - global $core; - $img = ROOT . '/images/stats/annuel-' . $a . '-' . $bid . '.png'; - $imgw = WEBROOT . '/images/stats/annuel-' . $a . '-' . $bid . '.png'; + $img = SYSIMG . '/stats/annuel-' . $a . '-' . $bid . '.png'; + $imgw = IMG . '/stats/annuel-' . $a . '-' . $bid . '.png'; $maxv = 0; $maxp = 0; $maxb = 0; @@ -545,7 +564,7 @@ class wsStats { if (!file_exists($img) || filemtime($img) < cubeDate::round(null, 'H')) { $im = imagecreatetruecolor(944, 306); imagelayereffect($im, IMG_EFFECT_REPLACE); - $trans = imagecolorallocatealpha($im, 244, 244, 241, 0); + $trans = imagecolorallocatealpha($im, 255, 255, 255, 0); imagefill($im, 0, 0, $trans); imagelayereffect($im, IMG_EFFECT_ALPHABLEND); $i = 1; @@ -595,11 +614,11 @@ class wsStats { imageline($im, 0 , $y0, 944 , $y0 , $c0); imagepng($im, $img); } - $res = '
' . $maxpages . '
'; - $res .= '
' . $maxb . '
'; - $res .= '
' . $maxv . '
'; - $res .= '' . __('Statistiques annuelles') . ''; - $res .= ''; + $res = '
' . $maxpages . '
'; + $res .= '
' . $maxb . '
'; + $res .= '
' . $maxv . '
'; + $res .= '
'; + $res .= '
'; foreach($months as $m => $t) { $res .= ''; } @@ -609,37 +628,37 @@ class wsStats { $res .= ''; $res .= ''; $res .= ''; - $res .= '
' . strftime('%b %y', $t) . '' . __('Pages vues') . '' . __('Visites') . '' . __('Visiteurs uniques') . '
'; + $res .= ''; return $res; } public static function vue_mensuelle($bid, $annee, $mois) { - wsDroits::viewBook($bid); $datestocorrect = array(mktime(0, 0, 0, 11, 23, 2009), mktime(0, 0, 0, 12, 8, 2009), mktime(0, 0, 0, 12, 9, 2009)); global $core; - $rr = $core->con->select('SELECT *,book.date AS date FROM book,user WHERE user.uid=book.uid AND bid=' . $bid); - $extra = self::getExtra($rr->extras); + + $book = self::getBook($bid); + + $extra = self::getExtra($book->extras); $stats = self::load_stats($bid, $annee, $mois); if (is_null($stats)) { return self::indisponible(); } - self::getActives($stats, $rr, $aextra, $adown, $adownp, $aprint, $afriend); + self::getActives($stats, $book, $aextra, $adown, $adownp, $aprint, $afriend); $time_page = mktime(0, 0, 0, $mois, 15, $annee); - $res = wsPage::bh('stats_global'); - $titre = ($_SESSION['white'])?__('Statistiques de la publication « %s »'):__('Statistiques du fluidbook « %s »'); - $date_creation = ($_SESSION['white'])? __('Date de création de la publication'): __('Date de création du fluidbook'); - $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(sprintf($titre, $rr->titre) . ' - ' . strftime('%B %Y', $time_page))), 'hache2'); - $res .= self::globalDatas($date_creation, $rr, $stats, $afriend, $aprint, $adown, $adownp, $aextra); - $res .= wsPage::bf(); - $res .= wsPage::bh('stats_detail_mois'); - $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Détail par jour') . ' - ' . strftime('%B %Y', $time_page))), 'hache2'); - $res .= '
' . self::graph_mensuel($bid, $annee, $mois, $stats) . '
'; + $res = extranetPage::bh('stats_global'); + $titre = __('Statistiques de la publication « %s »'); + $date_creation = __('Date de création de la publication'); + $res .= self::globalDatas(sprintf($titre, $book->nom), $date_creation, $book, $stats, $afriend, $aprint, $adown, $adownp, $aextra); + $res .= extranetPage::bf(); + $res .= extranetPage::bh('stats_detail_mois'); + $res .= '
' . self::graph_mensuel($bid, $annee, $mois, $stats) . '
'; $res .= ''; - $res .= ''; + $res .= ''; + $res .= ''; $res .= ''; @@ -649,8 +668,10 @@ class wsStats { $res .= ''; $res .= ''; + $i=0; foreach ($stats->days->day as $day) { - $res .= ''; + $odd=cubeMath::isOdd($i)?' class="odd"':''; + $res .= ''; $res .= ''; $res .= ''; @@ -658,57 +679,61 @@ class wsStats { $res .= ''; $res .= ''; $res .= ''; + $i++; } $res .= '
' . __('Jour') . '
' . $core->typo->Titre(__('Détail par jour') . ' - ' . strftime('%B %Y', $time_page)) . '
' . __('Jour') . '' . __('Lieux de visite') . '' . __('Liens cliqués') . '
' . strftime('%A %d', mktime(0, 0, 0, $mois, (string)$day['day'], $annee)) . '' . strftime('%A %d', mktime(0, 0, 0, $mois, (string)$day['day'], $annee)) . '' . $day['places'] . '' . $day['visitors'] . '' . $day['views'] . '' . $day['links'] . '
'; - $res .= wsPage::bf(); - $res .= wsPage::bh('stats_detail_pages'); - $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Pages les plus vues') . ' - ' . strftime('%B %Y', $time_page))), 'hache2'); + $res .= extranetPage::bf(); + $res .= extranetPage::bh('stats_detail_pages'); $res .= ''; - $res .= ''; - if ($rr->stats_score == 1) { + $res .= ''; + $res .= ''; + if ($book->parametres->stats_score) { $res .= ''; } $res .= ''; $res .= ''; - if ($rr->bookmark == 1) { + if ($book->parametres->bookmark) { $res .= ''; } - if ($rr->print == 1) { + if ($book->parametres->print) { $res .= ''; } + $i=0; foreach ($stats->pages->page as $page) { $p = (string)$page['page']; - if ($p > $rr->pages || cubeMath::isOdd($p)) { + if ($p > $book->pages || cubeMath::isOdd($p)) { continue; } if ($p == 0) { $pagen = '1'; - } elseif ($p == $rr->pages) { + } elseif ($p == $book->parametres->pages) { $pagen = $p; } else { $pagen = $p; $pagen .= '-'; $pagen .= ($p + 1); } - $res .= ''; - if ($rr->stats_score == 1) { + $odd=cubeMath::isOdd($i)?' class="odd"':''; + $res .= ''; + if ($book->parametres->stats_score == 1) { $res .= ''; } $res .= ''; $res .= ''; - if ($rr->bookmark == 1) { + if ($book->parametres->bookmark == 1) { $res .= ''; } - if ($rr->print == 1) { + if ($book->parametres->print == 1) { $res .= ''; } + $i++; } $res .= '
' . __('Pages') . '
' . $core->typo->Titre(__('Détail par page') . ' - ' . strftime('%B %Y', $time_page)) . '
' . __('Pages') . '' . __('Score') . '' . __('Vues') . '' . __('Zooms') . '' . __('Marques-pages') . '' . __('Impressions') . '
' . $pagen . '' . $pagen . '' . $page['score'] . '' . $page['views'] . '' . $page['zooms'] . '' . $page['bookmarks'] . '' . $page['prints'] . '
'; - $res .= wsPage::bf(); - if ($rr->search == 0) { + $res .= extranetPage::bf(); + if ($book->parametres->search == 0) { $idl = 'stats_links_2'; $idc = 'stats_country_2'; } else { @@ -717,10 +742,12 @@ class wsStats { } $res .= '
'; - $res .= wsPage::bh($idl); - $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Liens les plus cliqués'))), 'hache2'); + $res .= extranetPage::bh($idl); + $res .= ''; + $res .= ''; $res .= ''; + $i = 0; foreach ($stats->links->link as $link) { $uurl = (string)$link['url']; $nb = (string)$link['click']; @@ -732,47 +759,58 @@ class wsStats { if (strlen($url) > 30) { $url = substr($url, 0, 30) . '...'; } - $res .= ''; + $odd = cubeMath::isOdd($i)?' class="odd"':''; + $res .= ''; + $i++; } $res .= '
' . $core->typo->Titre(__('Liens les plus cliqués')) . '
' . __('URL') . '' . __('Clics') . '
' . $url . '' . $nb . '
' . $url . '' . $nb . '
'; - $res .= wsPage::bf(); - if ($rr->search == 1) { - $res .= wsPage::bh('stats_search'); - $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Mots les plus recherchés'))), 'hache2'); + $res .= extranetPage::bf(); + if ($book->parametres->search == 1) { + $res .= extranetPage::bh('stats_search'); $res .= ''; + $res .= ''; $res .= ''; + $i = 0; foreach ($stats->searches->search as $search) { - $res .= ''; + $q=$search['query']; + if(strlen($q)>25){ + $q=''.substr($q,0,25).' ...'; + } + + $odd = cubeMath::isOdd($i)?' class="odd"':''; + $res .= ''; + $i++; } $res .= '
' . $core->typo->Titre(__('Mots les plus recherchés')) . '
' . __('Mot') . '' . __('Recherches') . '
' . $search['query'] . '' . $search['count'] . '
' . $q . '' . $search['count'] . '
'; - $res .= wsPage::bf(); + $res .= extranetPage::bf(); } - $res .= wsPage::bh($idc); - $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Origine des visiteurs'))), 'hache2'); + $res .= extranetPage::bh($idc); $res .= ''; + $res .= ''; $res .= ''; + $i = 0; foreach ($stats->countries->country as $country) { $pays = $country['code']; + $odd = cubeMath::isOdd($i)?' class="odd"':''; if (!$c = cubeCountry::getCountry($pays)) { $c = __('Origine inconnue'); } - $res .= ''; + $res .= ''; + $i++; } $res .= '
' . $core->typo->Titre(__('Origine des visiteurs')) . '
' . __('Pays') . '' . __('Visiteurs') . '
' . cubeCountry::getFlag($pays) . ' ' . ucfirst(mb_strtolower($c)) . '' . $country['visitors'] . '
' . cubeCountry::getFlag($pays) . ' ' . ucfirst(mb_strtolower($c)) . '' . $country['visitors'] . '
'; - $res .= wsPage::bf(); + $res .= extranetPage::bf(); $res .= '
'; return $res; } public static function graph_mensuel($bid, $a, $m, $stats) { - wsDroits::viewBook($bid); - global $core; - $img = ROOT . '/images/stats/mensuel-' . $a . '-' . $m . '-' . $bid . '.png'; - $imgw = WEBROOT . '/images/stats/mensuel-' . $a . '-' . $m . '-' . $bid . '.png'; + $img = SYSIMG . '/stats/mensuel-' . $a . '-' . $m . '-' . $bid . '.png'; + $imgw = IMG . '/stats/mensuel-' . $a . '-' . $m . '-' . $bid . '.png'; $lm = cubeDate::limitMonth($a, $m); $datestocorrect = array(mktime(0, 0, 0, 11, 23, 2009), mktime(0, 0, 0, 12, 8, 2009), mktime(0, 0, 0, 12, 9, 2009)); $maxv = 0; @@ -801,7 +839,7 @@ class wsStats { // Création de l'image $im = imagecreatetruecolor(944, 306); imagelayereffect($im, IMG_EFFECT_REPLACE); - $trans = imagecolorallocatealpha($im, 244, 244, 241, 0); + $trans = imagecolorallocatealpha($im, 255, 255, 255, 0); imagefill($im, 0, 0, $trans); imagelayereffect($im, IMG_EFFECT_ALPHABLEND); $i = 1; @@ -851,22 +889,22 @@ class wsStats { imageline($im, 0 , $y0, 944 , $y0 , $c0); imagepng($im, $img); } - $res = '
' . $maxpages . '
'; - $res .= '
' . $maxb . '
'; - $res .= '
' . $maxv . '
'; - $res .= '' . __('Statistiques mensuelles') . ''; - $res .= ''; + $res = '
' . $maxpages . '
'; + $res .= '
' . $maxb . '
'; + $res .= '
' . $maxv . '
'; + $res .= '
'; + $res .= '
'; foreach($days as $d => $t) { $res .= ''; } $spacef = 944 - (count($days) * (20 + ($space * 2))); $res .= ''; $res .= '
' . $d . '' . cubeMedia::spacer($spacef, 20) . '
'; - $res .= ''; + $res .= '
'; $res .= ''; $res .= ''; $res .= ''; - $res .= '
' . __('Pages vues') . '' . __('Visites') . '' . __('Visiteurs uniques') . '
'; + $res .= ''; return $res; } } diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index d6e88e228..942e6c624 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -105,6 +105,14 @@ html{height:100%}' . "\n"; echo $res; } + public static function stats($args) + { + $bid = (isset($args[1]))?$args[1]:null; + $annee = (isset($args[2]))?$args[2]:null; + $mois = (isset($args[3]))?$args[3]:null; + return wsStats::display($bid, $annee, $mois); + } + public static function editComposition($args) { $fv = array(session_name() => session_id(), diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index ec08478b6..0732bdd4a 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -70,8 +70,10 @@ class wsBookParametres extends wsParametres { $this->fields['stats'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Activer les statistiques'), 'extra' => false, 'grade' => 1); $this->fields['statsWeborama'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Statistiques Weborama'), 'size' => 10, 'extra' => true, 'grade' => 1); $this->fields['googleAnalytics'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Code Google Analytics'), 'size' => 10, 'extra' => true, 'grade' => 1); + $this->fields['stats_score']= array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Affiche le score dans les statistiques'), 'extra' => false, 'grade' => 1); $this->forms['stats'] = array('label' => __('Statistiques'), 'fieldsnames' => array('stats', 'statsWeborama')); + // . $this->fields['displayChaptersAtStart'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __("Afficher le sommaire au chargement de la publication"), 'extra' => true, 'grade' => 4); $this->fields['chaptersPosition'] = array('type' => 'combo', diff --git a/style/ws/style.css b/style/ws/style.css index 172ef2931..cd9999f47 100644 --- a/style/ws/style.css +++ b/style/ws/style.css @@ -434,4 +434,62 @@ display:none; .gris{background-color:#ecedf0;} -#listeBooks{width:100%;height:100%;} \ No newline at end of file +#listeBooks{width:100%;height:100%;} + +/* Stats */ +.graphStats table{ + width:auto !important; +} +.graphStats td,.graphStats th{ + padding:0px; + background:none transparent; + height:auto; +} +.graphStats .echelle td{ + text-align:center; +} + +.graphStats .graph-note{ + position:absolute; + left:900px; + color:#f54d00; + padding-left:2px; + padding-right:2px; + background:#fff; +} + +.graphStats .legende{ + margin-top:10px; + margin-bottom:10px; +} + +.graphStats .legende td{ + margin-top:10px; + margin-bottom:10px; +} + +.graphStats .graph-container{ + width:944px; + height:306px; +} + +th.stats_col,td.stats_col{ + text-align:center; +} + +th.stats_col{ + width:130px; +} +.stats_col.max{ + width:600px; + text-align:left; +} + +.stats_links .liste,.stats_country .liste,.stats_search .liste{ + min-width:307px;width:307px;max-height:400px; +} + +.stats_links,.stats_country,.stats_search{ + float:left; + margin-left:0px; +} -- 2.39.5