<?php\r
class wsStats {\r
public static $datestocorrect = array(array(22, 11, 2009), array(23, 11, 2009), array(8, 12, 2009), array(9, 12, 2009));\r
- /*\r
- if (in_array($dd, $datestocorrect)) {\r
- $d->book = round($d->visitor * 1.2);\r
- }*/\r
+\r
public static function display($bid, $annee = null, $mois = null)\r
{\r
- wsDroits::viewBook($bid);\r
cubePHP::set_memory('512M');\r
+\r
+ $res = extranetPage::barre();\r
+ $res .= extranetPage::tMain();\r
if (is_null($annee) && is_null($mois)) {\r
- return self::vue_globale($bid);\r
- }\r
- if (is_null($mois)) {\r
- return self::vue_annuelle($bid, $annee);\r
+ $res .= self::vue_globale($bid);\r
+ } elseif (is_null($mois)) {\r
+ $res .= self::vue_annuelle($bid, $annee);\r
+ } else {\r
+ $res .= self::vue_mensuelle($bid, $annee, $mois);\r
}\r
- return self::vue_mensuelle($bid, $annee, $mois);\r
+ $res .= extranetPage::bMain();\r
+ return $res;\r
}\r
\r
public static function getExtra($extra)\r
if ($date[2] != $y || $date[1] != $m) {\r
continue;\r
}\r
- fb($y, $m);\r
$days = $x->xpath("//day[@day=" . $date[0] . "]");\r
foreach($days as $day) {\r
break;\r
}\r
}\r
\r
- public static function getActives($stats, $rr, &$aextra, &$adown, &$adownp, &$aprint, &$afriend)\r
+ public static function getActives($stats, $book, &$aextra, &$adown, &$adownp, &$aprint, &$afriend)\r
{\r
- $extra = self::getExtra($rr->extras);\r
+ $extra = self::getExtra($book->extras);\r
$aextra = ($extra != null && $stats['extras'] > 0);\r
- $adown = ($rr->pdf == 1 && $stats['downloads'] > 0);\r
- $adownp = ($rr->pdf == 1 && $rr->pdfComplex == 1 && $stats['partDownloads'] > 0);\r
- $aprint = ($rr->print == 1);\r
- $afriend = ($rr->friend == 1);\r
+ $adown = ($book->parametres->pdf == 1 && $stats['downloads'] > 0);\r
+ $adownp = ($book->parametres->pdf == 1 && $book->parametres->pdfComplex == 1 && $stats['partDownloads'] > 0);\r
+ $aprint = ($book->parametres->print == 1);\r
+ $afriend = ($book->parametres->friend == 1);\r
}\r
\r
- public static function globalDatas($date_creation, $rr, $stats, $afriend, $aprint, $adown, $adownp, $aextra)\r
+ public static function globalDatas($titre, $date_creation, $book, $stats, $afriend, $aprint, $adown, $adownp, $aextra)\r
{\r
+ global $core;\r
$res = '<table class="liste max">';\r
- $res .= '<tr><td>' . $date_creation . '</td><td class="stats_col">' . date(__('d-m-Y'), $rr->date) . '</td></tr>';\r
+ $res .= '<tr><th colspan="2">' . $core->typo->Titre($titre) . '</th></tr>';\r
+ $res .= '<tr><td>' . $date_creation . '</td><td class="stats_col">' . date(__('d-m-Y'), $book->date) . '</td></tr>';\r
\r
- $res .= '<tr><td>' . __('Nombre de lieux de visite') . '</td><td class="stats_col">' . $stats['places'] . '</td></tr>';\r
+ $res .= '<tr class="odd"><td>' . __('Nombre de lieux de visite') . '</td><td class="stats_col">' . $stats['places'] . '</td></tr>';\r
$res .= '<tr><td>' . __('Nombre de visiteurs uniques') . '</td><td class="stats_col">' . $stats['visitors'] . '</td></tr>';\r
- $res .= '<tr><td>' . __('Nombre de visites') . '</td><td class="stats_col">' . $stats['visits'] . '</td></tr>';\r
+ $res .= '<tr class="odd"><td>' . __('Nombre de visites') . '</td><td class="stats_col">' . $stats['visits'] . '</td></tr>';\r
\r
$res .= '<tr><td>' . __('Nombre de pages vues') . '</td><td class="stats_col">' . $stats['pages'] . '</td></tr>';\r
+ $i = 1;\r
if ($afriend) {\r
- $res .= '<tr><td>' . __('Nombre de liens envoyés') . '</td><td class="stats_col">' . $stats['friends'] . '</td></tr>';\r
+ $odd = $i % 2 == 1?' class="odd"':'';\r
+ $i++;\r
+ $res .= '<tr' . $odd . '><td>' . __('Nombre de liens envoyés') . '</td><td class="stats_col">' . $stats['friends'] . '</td></tr>';\r
}\r
- $res .= '<tr><td>' . __('Nombre de liens cliqués') . '</td><td class="stats_col">' . $stats['links'] . '</td></tr>';\r
+ $odd = $i % 2 == 1?' class="odd"':'';\r
+ $i++;\r
+ $res .= '<tr' . $odd . '><td>' . __('Nombre de liens cliqués') . '</td><td class="stats_col">' . $stats['links'] . '</td></tr>';\r
if ($aprint) {\r
- $res .= '<tr><td>' . __("Nombre d'impressions") . '</td><td class="stats_col">' . $stats['prints'] . '</td></tr>';\r
+ $odd = $i % 2 == 1?' class="odd"':'';\r
+ $i++;\r
+ $res .= '<tr' . $odd . '><td>' . __("Nombre d'impressions") . '</td><td class="stats_col">' . $stats['prints'] . '</td></tr>';\r
}\r
if ($adown) {\r
- $res .= '<tr><td>' . __('Nombre de téléchargements') . '</td><td class="stats_col">' . $stats['downloads'] . '</td></tr>';\r
+ $odd = $i % 2 == 1?' class="odd"':'';\r
+ $i++;\r
+ $res .= '<tr' . $odd . '><td>' . __('Nombre de téléchargements') . '</td><td class="stats_col">' . $stats['downloads'] . '</td></tr>';\r
}\r
if ($adownp) {\r
- $res .= '<tr><td>' . __('Nombre de téléchargements partiels') . '</td><td class="stats_col">' . $stats['partDownloads'] . '</td></tr>';\r
+ $odd = $i % 2 == 1?' class="odd"':'';\r
+ $i++;\r
+ $res .= '<tr' . $odd . '><td>' . __('Nombre de téléchargements partiels') . '</td><td class="stats_col">' . $stats['partDownloads'] . '</td></tr>';\r
}\r
if ($aextra) {\r
- $res .= '<tr><td>' . __('Accès à la rubrique') . ' ' . $extra . '</td><td class="stats_col">' . $stats['extras'] . '</td></tr>';\r
+ $odd = $i % 2 == 1?' class="odd"':'';\r
+ $i++;\r
+ $res .= '<tr' . $odd . '><td>' . __('Accès à la rubrique') . ' ' . $extra . '</td><td class="stats_col">' . $stats['extras'] . '</td></tr>';\r
}\r
$res .= '</table>';\r
return $res;\r
\r
public static function indisponible()\r
{\r
- $res = wsPage::bh('stats_global');\r
+ $res = extranetPage::bh('stats_global');\r
$res .= '<p class="center">' . __('Les statistiques concernant cette période ne sont actuellement pas disponibles') . '</p>';\r
- $res .= wsPage::bf();\r
+ $res .= extranetPage::bf();\r
return $res;\r
}\r
\r
+ public static function getBook($bid)\r
+ {\r
+ global $core;\r
+ $daoBook = new wsDAOBook($core->con);\r
+ return $daoBook->selectById($bid);\r
+ }\r
+\r
public static function vue_globale($bid, $annee = null)\r
{\r
global $core;\r
- $rr = $core->con->select('SELECT * FROM book WHERE bid=' . $bid);\r
\r
- $extra = self::getExtra($rr->extras);\r
+ $book = self::getBook($bid);\r
+ $extra = self::getExtra($book->extras);\r
\r
if (is_null($annee)) {\r
$stats = self::load_stats($bid);\r
return self::indisponible();\r
}\r
\r
- self::getActives($stats, $rr, $aextra, $adown, $adownp, $aprint, $afriend);\r
+ self::getActives($stats, $book, $aextra, $adown, $adownp, $aprint, $afriend);\r
+\r
+ $res = extranetPage::bh('stats_global');\r
+\r
+ $titre = __('Statistiques de la publication « %s »');\r
+ $date_creation = __('Date de création de la publication');\r
\r
- $res = wsPage::bh('stats_global');\r
- $titre = ($_SESSION['white'])?__('Statistiques de la publication « %s »'):__('Statistiques du fluidbook « %s »');\r
- $date_creation = ($_SESSION['white'])? __('Date de création de la publication'): __('Date de création du fluidbook');\r
- $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(sprintf($titre, $rr->titre))), 'hache2');\r
- $res .= self::globalDatas($date_creation, $rr, $stats, $afriend, $aprint, $adown, $adownp, $aextra);\r
- $res .= wsPage::bf();\r
+ $res .= self::globalDatas(sprintf($titre, $book->nom), $date_creation, $book, $stats, $afriend, $aprint, $adown, $adownp, $aextra);\r
+ $res .= extranetPage::bf();\r
\r
- $res .= wsPage::bh('stats_detail_mois');\r
- $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(sprintf(__('Détail par mois'), $rr->titre))), 'hache2');\r
+ $res .= extranetPage::bh('stats_detail_mois');\r
+ $res .= '<table class="liste max">';\r
+ $res .= '<tr><th colspan="10">' . $core->typo->Titre(__('Détail par mois')) . '</th></tr>';\r
+ $res .= '<tr><th colspan="10">';\r
$res .= '<div class="center" style="width:944px;margin:0 auto;position:relative;">' ;\r
if (is_null($annee)) {\r
$res .= self::graph_global($bid, $stats);\r
$res .= self::graph_annuel($bid, $annee, $stats);\r
}\r
$res .= '</div>';\r
- $res .= '<table class="liste max">';\r
- $res .= '<tr><th>' . __('Période') . '</th>';\r
+ $res .= '</th></tr>';\r
+\r
+ $res .= '<tr><th class="stats_col max">' . __('Période') . '</th>';\r
$res .= '<th class="stats_col">' . __('Lieux de visite') . '</th>';\r
$res .= '<th class="stats_col">' . __('Visiteurs uniques') . '</th>';\r
$res .= '<th class="stats_col">' . __('Visites') . '</th>';\r
if ($afriend) {\r
$res .= '<td class="stats_col"><strong>' . $year['friends'] . '</strong></td>';\r
}\r
- $res .= '<td class="stats_col"><strong>' . $year['links'] . '<strong></td>';\r
+ $res .= '<td class="stats_col"><strong>' . $year['links'] . '</strong></td>';\r
if ($aprint) {\r
$res .= '<td class="stats_col"><strong>' . $year['prints'] . '</strong></td>';\r
}\r
$res .= '</tr>';\r
}\r
foreach($year->month as $month) {\r
- $res .= '<tr><td><a href="' . SITE_PATH . 'stats/' . $bid . '/' . $month['year'] . '/' . $month['month'] . '">' . strftime('%B %Y', mktime(0, 0, 0, (string)$month['month'], 15, (string)$month['year'])) . '</a></td>';\r
+ $res .= '<tr class="odd"><td><a href="' . SITE_PATH . 'stats/' . $bid . '/' . $month['year'] . '/' . $month['month'] . '">' . strftime('%B %Y', mktime(0, 0, 0, (string)$month['month'], 15, (string)$month['year'])) . '</a></td>';\r
\r
$res .= '<td class="stats_col">' . $month['places'] . '</td>';\r
$res .= '<td class="stats_col">' . $month['visitors'] . '</td>';\r
}\r
}\r
$res .= '</table>';\r
- $res .= wsPage::bf();\r
+ $res .= extranetPage::bf();\r
return $res;\r
}\r
\r
public static function graph_global($bid, $stats)\r
{\r
- wsDroits::viewBook($bid);\r
global $core;\r
- $img = ROOT . '/images/stats/global-' . $bid . '.png';\r
- $imgw = WEBROOT . '/images/stats/global-' . $bid . '.png';\r
+ $img = SYSIMG . '/stats/global-' . $bid . '.png';\r
+ $imgw = IMG . '/stats/global-' . $bid . '.png';\r
\r
$s = array();\r
foreach ($stats->year as $year) {\r
$s[$time]['visit'] = $month['visitors'];\r
}\r
}\r
- fb($s);\r
+\r
krsort($s);\r
$s = array_slice($s, 0, 12, true);\r
- // $s = array_reverse($s);\r
- fb($s);\r
$maxv = 0;\r
$maxp = 0;\r
$maxb = 0;\r
if (!file_exists($img) || filemtime($img) < cubeDate::round(null, 'H')) {\r
$im = imagecreatetruecolor(944, 306);\r
imagelayereffect($im, IMG_EFFECT_REPLACE);\r
- $trans = imagecolorallocatealpha($im, 244, 244, 241, 0);\r
+ $trans = imagecolorallocatealpha($im, 255, 255, 255, 0);\r
imagefill($im, 0, 0, $trans);\r
imagelayereffect($im, IMG_EFFECT_ALPHABLEND);\r
$i = 1;\r
imageline($im, 0 , $y0, 944 , $y0 , $c0);\r
imagepng($im, $img);\r
}\r
- $res = '<div style="position:absolute;top:' . $mhp . 'px;left:900px;color:#514e49;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxpages . '</div>';\r
- $res .= '<div style="position:absolute;top:' . $mhb . 'px;left:900px;color:#f54d00;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxb . '</div>';\r
- $res .= '<div style="position:absolute;top:' . $mhv . 'px;left:900px;color:#c2d313;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxv . '</div>';\r
- $res .= '<img src="' . $imgw . '" alt="' . __('Statistiques globales') . '" />';\r
+ $res = '<div class="graphStats"><div class="graph-note" style="top:' . $mhp . 'px;color:#514e49;">' . $maxpages . '</div>';\r
+ $res .= '<div class="graph-note" style="top:' . $mhb . 'px;color:#f54d00">' . $maxb . '</div>';\r
+ $res .= '<div class="graph-note" style="top:' . $mhv . 'px;color:#c2d313;">' . $maxv . '</div>';\r
+ $res .= '<div class="graph-container" style="background:url(' . $imgw . ')"></div>';\r
$s = array_reverse(array_pad($s, 12, false), true);\r
- $res .= '<table style="width:944px;max-width:944px;"><tr>';\r
+ $res .= '<table style="width:944px;max-width:944px;" class="echelle"><tr>';\r
foreach($s as $time => $val) {\r
if (!$val) {\r
$res .= '<td style="width:75px;max-width:75px;">' . cubeMedia::spacer(75, 20) . '</td>';\r
}\r
$res .= '<td style="width:44px;">' . cubeMedia::spacer(44, 20) . '</td>';\r
$res .= '</tr></table>';\r
- $res .= '<table style="margin-top:10px;margin-bottom:10px;"><tr>';\r
+ $res .= '<table class="legende"><tr>';\r
$res .= '<td style="width:12px;background:#514e49;height:12px;"></td><td style="width:10px;"></td><td>' . __('Pages vues') . '</td><td style="width:10px;"></td>';\r
$res .= '<td style="width:12px;background:#f54d00;height:12px;"></td><td style="width:10px;"></td><td>' . __('Visites') . '</td><td style="width:10px;"></td>';\r
$res .= '<td style="width:12px;background:#c2d313;height:12px;"></td><td style="width:10px;"></td><td>' . __('Visiteurs uniques') . '</td><td style="width:10px;"></td>';\r
- $res .= '</tr></table>';\r
+ $res .= '</tr></table></div>';\r
return $res;\r
}\r
\r
return self::vue_globale($bid, $annee);\r
}\r
\r
- public static function getQ($bid, $max, &$maxp, &$maxpages, &$s)\r
+ public static function getQ($book, $max, &$maxp, &$maxpages, &$s)\r
{\r
- global $core;\r
- $rrr = $core->con->select('SELECT pages FROM book WHERE bid=' . $bid);\r
$maxpages = $maxp;\r
- $q = max($rrr->pages / 5, 1);\r
+ $q = max($book->pages / 5, 1);\r
$maxp /= $q;\r
$maxp = max($max * 4, $maxp);\r
$q = $maxpages / $maxp;\r
\r
public static function graph_annuel($bid, $a, $stats)\r
{\r
- wsDroits::viewBook($bid);\r
- global $core;\r
- $img = ROOT . '/images/stats/annuel-' . $a . '-' . $bid . '.png';\r
- $imgw = WEBROOT . '/images/stats/annuel-' . $a . '-' . $bid . '.png';\r
+ $img = SYSIMG . '/stats/annuel-' . $a . '-' . $bid . '.png';\r
+ $imgw = IMG . '/stats/annuel-' . $a . '-' . $bid . '.png';\r
$maxv = 0;\r
$maxp = 0;\r
$maxb = 0;\r
if (!file_exists($img) || filemtime($img) < cubeDate::round(null, 'H')) {\r
$im = imagecreatetruecolor(944, 306);\r
imagelayereffect($im, IMG_EFFECT_REPLACE);\r
- $trans = imagecolorallocatealpha($im, 244, 244, 241, 0);\r
+ $trans = imagecolorallocatealpha($im, 255, 255, 255, 0);\r
imagefill($im, 0, 0, $trans);\r
imagelayereffect($im, IMG_EFFECT_ALPHABLEND);\r
$i = 1;\r
imageline($im, 0 , $y0, 944 , $y0 , $c0);\r
imagepng($im, $img);\r
}\r
- $res = '<div style="position:absolute;top:' . $mhp . 'px;left:900px;color:#514e49;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxpages . '</div>';\r
- $res .= '<div style="position:absolute;top:' . $mhb . 'px;left:900px;color:#f54d00;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxb . '</div>';\r
- $res .= '<div style="position:absolute;top:' . $mhv . 'px;left:900px;color:#c2d313;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxv . '</div>';\r
- $res .= '<img src="' . $imgw . '" alt="' . __('Statistiques annuelles') . '" />';\r
- $res .= '<table style="width:944px;max-width:944px;table-layout:fixed;"><tr>';\r
+ $res = '<div class="graphStats"><div class="graph-note" style="top:' . $mhp . 'px;color:#514e49;">' . $maxpages . '</div>';\r
+ $res .= '<div class="graph-note" style="top:' . $mhb . 'px;color:#f54d00;">' . $maxb . '</div>';\r
+ $res .= '<div class="graph-note" style="top:' . $mhv . 'px;color:#c2d313;">' . $maxv . '</div>';\r
+ $res .= '<div class="graph-container" style="background:url(' . $imgw . ')"></div>';\r
+ $res .= '<table style="width:944px;max-width:944px;table-layout:fixed;" class="echelle"><tr>';\r
foreach($months as $m => $t) {\r
$res .= '<td style="width:75px;max-width:75px;">' . strftime('%b %y', $t) . '</td>';\r
}\r
$res .= '<td style="width:12px;background:#514e49;height:12px;"></td><td style="width:10px;"></td><td>' . __('Pages vues') . '</td><td style="width:10px;"></td>';\r
$res .= '<td style="width:12px;background:#f54d00;height:12px;"></td><td style="width:10px;"></td><td>' . __('Visites') . '</td><td style="width:10px;"></td>';\r
$res .= '<td style="width:12px;background:#c2d313;height:12px;"></td><td style="width:10px;"></td><td>' . __('Visiteurs uniques') . '</td><td style="width:10px;"></td>';\r
- $res .= '</tr></table>';\r
+ $res .= '</tr></table></div>';\r
return $res;\r
}\r
\r
public static function vue_mensuelle($bid, $annee, $mois)\r
{\r
- wsDroits::viewBook($bid);\r
$datestocorrect = array(mktime(0, 0, 0, 11, 23, 2009), mktime(0, 0, 0, 12, 8, 2009), mktime(0, 0, 0, 12, 9, 2009));\r
global $core;\r
- $rr = $core->con->select('SELECT *,book.date AS date FROM book,user WHERE user.uid=book.uid AND bid=' . $bid);\r
- $extra = self::getExtra($rr->extras);\r
+\r
+ $book = self::getBook($bid);\r
+\r
+ $extra = self::getExtra($book->extras);\r
$stats = self::load_stats($bid, $annee, $mois);\r
\r
if (is_null($stats)) {\r
return self::indisponible();\r
}\r
\r
- self::getActives($stats, $rr, $aextra, $adown, $adownp, $aprint, $afriend);\r
+ self::getActives($stats, $book, $aextra, $adown, $adownp, $aprint, $afriend);\r
\r
$time_page = mktime(0, 0, 0, $mois, 15, $annee);\r
- $res = wsPage::bh('stats_global');\r
- $titre = ($_SESSION['white'])?__('Statistiques de la publication « %s »'):__('Statistiques du fluidbook « %s »');\r
- $date_creation = ($_SESSION['white'])? __('Date de création de la publication'): __('Date de création du fluidbook');\r
- $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(sprintf($titre, $rr->titre) . ' - ' . strftime('%B %Y', $time_page))), 'hache2');\r
- $res .= self::globalDatas($date_creation, $rr, $stats, $afriend, $aprint, $adown, $adownp, $aextra);\r
- $res .= wsPage::bf();\r
- $res .= wsPage::bh('stats_detail_mois');\r
- $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Détail par jour') . ' - ' . strftime('%B %Y', $time_page))), 'hache2');\r
- $res .= '<div class="center" style="width:944px;margin-top:10px;position:relative;">' . self::graph_mensuel($bid, $annee, $mois, $stats) . '</div>';\r
+ $res = extranetPage::bh('stats_global');\r
+ $titre = __('Statistiques de la publication « %s »');\r
+ $date_creation = __('Date de création de la publication');\r
+ $res .= self::globalDatas(sprintf($titre, $book->nom), $date_creation, $book, $stats, $afriend, $aprint, $adown, $adownp, $aextra);\r
+ $res .= extranetPage::bf();\r
+ $res .= extranetPage::bh('stats_detail_mois');\r
+ $res .= '<div class="center" style="width:944px;position:relative;">' . self::graph_mensuel($bid, $annee, $mois, $stats) . '</div>';\r
$res .= '<table class="liste max">';\r
- $res .= '<tr><th>' . __('Jour') . '</th>';\r
+ $res .= '<tr><th colspan="5">' . $core->typo->Titre(__('Détail par jour') . ' - ' . strftime('%B %Y', $time_page)) . '</th></tr>';\r
+ $res .= '<tr><th class="stats_col max">' . __('Jour') . '</th>';\r
\r
$res .= '<th class="stats_col">' . __('Lieux de visite') . '</th>';\r
\r
$res .= '<th class="stats_col">' . __('Liens cliqués') . '</th>';\r
$res .= '</tr>';\r
\r
+ $i=0;\r
foreach ($stats->days->day as $day) {\r
- $res .= '<tr><td>' . strftime('%A %d', mktime(0, 0, 0, $mois, (string)$day['day'], $annee)) . '</td>';\r
+ $odd=cubeMath::isOdd($i)?' class="odd"':'';\r
+ $res .= '<tr'.$odd.'><td >' . strftime('%A %d', mktime(0, 0, 0, $mois, (string)$day['day'], $annee)) . '</td>';\r
\r
$res .= '<td class="stats_col">' . $day['places'] . '</td>';\r
$res .= '<td class="stats_col">' . $day['visitors'] . '</td>';\r
$res .= '<td class="stats_col">' . $day['views'] . '</td>';\r
$res .= '<td class="stats_col">' . $day['links'] . '</td>';\r
$res .= '</tr>';\r
+ $i++;\r
}\r
$res .= '</table>';\r
\r
- $res .= wsPage::bf();\r
- $res .= wsPage::bh('stats_detail_pages');\r
- $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Pages les plus vues') . ' - ' . strftime('%B %Y', $time_page))), 'hache2');\r
+ $res .= extranetPage::bf();\r
+ $res .= extranetPage::bh('stats_detail_pages');\r
$res .= '<table class="liste max">';\r
- $res .= '<tr><th>' . __('Pages') . '</th>';\r
- if ($rr->stats_score == 1) {\r
+ $res .= '<tr><th colspan="5">' . $core->typo->Titre(__('Détail par page') . ' - ' . strftime('%B %Y', $time_page)) . '</th></tr>';\r
+ $res .= '<tr><th class="stats_col max">' . __('Pages') . '</th>';\r
+ if ($book->parametres->stats_score) {\r
$res .= '<th class="stats_col">' . __('Score') . '</th>';\r
}\r
$res .= '<th class="stats_col">' . __('Vues') . '</th>';\r
$res .= '<th class="stats_col">' . __('Zooms') . '</th>';\r
- if ($rr->bookmark == 1) {\r
+ if ($book->parametres->bookmark) {\r
$res .= '<th class="stats_col">' . __('Marques-pages') . '</th>';\r
}\r
- if ($rr->print == 1) {\r
+ if ($book->parametres->print) {\r
$res .= '<th class="stats_col">' . __('Impressions') . '</th></tr>';\r
}\r
\r
+ $i=0;\r
foreach ($stats->pages->page as $page) {\r
$p = (string)$page['page'];\r
- if ($p > $rr->pages || cubeMath::isOdd($p)) {\r
+ if ($p > $book->pages || cubeMath::isOdd($p)) {\r
continue;\r
}\r
if ($p == 0) {\r
$pagen = '1';\r
- } elseif ($p == $rr->pages) {\r
+ } elseif ($p == $book->parametres->pages) {\r
$pagen = $p;\r
} else {\r
$pagen = $p;\r
$pagen .= '-';\r
$pagen .= ($p + 1);\r
}\r
- $res .= '<tr><td>' . $pagen . '</td>';\r
- if ($rr->stats_score == 1) {\r
+ $odd=cubeMath::isOdd($i)?' class="odd"':'';\r
+ $res .= '<tr'.$odd.'><td>' . $pagen . '</td>';\r
+ if ($book->parametres->stats_score == 1) {\r
$res .= '<td class="center">' . $page['score'] . '</td>';\r
}\r
$res .= '<td class="center">' . $page['views'] . '</td>';\r
$res .= '<td class="center">' . $page['zooms'] . '</td>';\r
- if ($rr->bookmark == 1) {\r
+ if ($book->parametres->bookmark == 1) {\r
$res .= '<td class="center">' . $page['bookmarks'] . '</td>';\r
}\r
- if ($rr->print == 1) {\r
+ if ($book->parametres->print == 1) {\r
$res .= '<td class="center">' . $page['prints'] . '</td></tr>';\r
}\r
+ $i++;\r
}\r
$res .= '</table>';\r
\r
- $res .= wsPage::bf();\r
- if ($rr->search == 0) {\r
+ $res .= extranetPage::bf();\r
+ if ($book->parametres->search == 0) {\r
$idl = 'stats_links_2';\r
$idc = 'stats_country_2';\r
} else {\r
}\r
\r
$res .= '<div id="stats_30">';\r
- $res .= wsPage::bh($idl);\r
- $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Liens les plus cliqués'))), 'hache2');\r
+ $res .= extranetPage::bh($idl);\r
+\r
$res .= '<table class="liste max">';\r
+ $res .= '<tr><th colspan="2">' . $core->typo->Titre(__('Liens les plus cliqués')) . '</th></tr>';\r
$res .= '<tr><th class="max">' . __('URL') . '</th><th class="nowrap">' . __('Clics') . '</th></tr>';\r
+ $i = 0;\r
foreach ($stats->links->link as $link) {\r
$uurl = (string)$link['url'];\r
$nb = (string)$link['click'];\r
if (strlen($url) > 30) {\r
$url = substr($url, 0, 30) . '...';\r
}\r
- $res .= '<tr><td class="max"><a href="' . $uurl . '" class="blank" title="' . $uurl . '">' . $url . '</a></td><td class="nowrap center">' . $nb . '</td></tr>';\r
+ $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+ $res .= '<tr' . $odd . '><td class="max"><a href="' . $uurl . '" class="blank" title="' . $uurl . '">' . $url . '</a></td><td class="nowrap center">' . $nb . '</td></tr>';\r
+ $i++;\r
}\r
$res .= '</table>';\r
\r
- $res .= wsPage::bf();\r
- if ($rr->search == 1) {\r
- $res .= wsPage::bh('stats_search');\r
- $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Mots les plus recherchés'))), 'hache2');\r
+ $res .= extranetPage::bf();\r
+ if ($book->parametres->search == 1) {\r
+ $res .= extranetPage::bh('stats_search');\r
$res .= '<table class="liste max">';\r
+ $res .= '<tr><th colspan="2">' . $core->typo->Titre(__('Mots les plus recherchés')) . '</th></tr>';\r
$res .= '<tr><th class="max">' . __('Mot') . '</th><th class="nowrap">' . __('Recherches') . '</th></tr>';\r
+ $i = 0;\r
foreach ($stats->searches->search as $search) {\r
- $res .= '<tr><td class="max">' . $search['query'] . '</td><td class="nowrap center">' . $search['count'] . '</td></tr>';\r
+ $q=$search['query'];\r
+ if(strlen($q)>25){\r
+ $q='<abbr title="'.$q.'">'.substr($q,0,25).' ...</abbr>';\r
+ }\r
+\r
+ $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
+ $res .= '<tr' . $odd . '><td class="max">' . $q . '</td><td class="nowrap center">' . $search['count'] . '</td></tr>';\r
+ $i++;\r
}\r
$res .= '</table>';\r
- $res .= wsPage::bf();\r
+ $res .= extranetPage::bf();\r
}\r
\r
- $res .= wsPage::bh($idc);\r
- $res .= cubeTypographp::typographp(array('texte' => mb_strtoupper(__('Origine des visiteurs'))), 'hache2');\r
+ $res .= extranetPage::bh($idc);\r
$res .= '<table class="liste max">';\r
+ $res .= '<tr><th colspan="2">' . $core->typo->Titre(__('Origine des visiteurs')) . '</th></tr>';\r
$res .= '<tr><th class="max">' . __('Pays') . '</th><th class="nowrap">' . __('Visiteurs') . '</th></tr>';\r
\r
+ $i = 0;\r
foreach ($stats->countries->country as $country) {\r
$pays = $country['code'];\r
+ $odd = cubeMath::isOdd($i)?' class="odd"':'';\r
if (!$c = cubeCountry::getCountry($pays)) {\r
$c = __('Origine inconnue');\r
}\r
- $res .= '<tr><td class="max">' . cubeCountry::getFlag($pays) . ' ' . ucfirst(mb_strtolower($c)) . '</td><td class="nowrap center">' . $country['visitors'] . '</td></tr>';\r
+ $res .= '<tr' . $odd . '><td class="max">' . cubeCountry::getFlag($pays) . ' ' . ucfirst(mb_strtolower($c)) . '</td><td class="nowrap center">' . $country['visitors'] . '</td></tr>';\r
+ $i++;\r
}\r
$res .= '</table>';\r
- $res .= wsPage::bf();\r
+ $res .= extranetPage::bf();\r
$res .= '</div>';\r
return $res;\r
}\r
\r
public static function graph_mensuel($bid, $a, $m, $stats)\r
{\r
- wsDroits::viewBook($bid);\r
- global $core;\r
- $img = ROOT . '/images/stats/mensuel-' . $a . '-' . $m . '-' . $bid . '.png';\r
- $imgw = WEBROOT . '/images/stats/mensuel-' . $a . '-' . $m . '-' . $bid . '.png';\r
+ $img = SYSIMG . '/stats/mensuel-' . $a . '-' . $m . '-' . $bid . '.png';\r
+ $imgw = IMG . '/stats/mensuel-' . $a . '-' . $m . '-' . $bid . '.png';\r
$lm = cubeDate::limitMonth($a, $m);\r
$datestocorrect = array(mktime(0, 0, 0, 11, 23, 2009), mktime(0, 0, 0, 12, 8, 2009), mktime(0, 0, 0, 12, 9, 2009));\r
$maxv = 0;\r
// Création de l'image\r
$im = imagecreatetruecolor(944, 306);\r
imagelayereffect($im, IMG_EFFECT_REPLACE);\r
- $trans = imagecolorallocatealpha($im, 244, 244, 241, 0);\r
+ $trans = imagecolorallocatealpha($im, 255, 255, 255, 0);\r
imagefill($im, 0, 0, $trans);\r
imagelayereffect($im, IMG_EFFECT_ALPHABLEND);\r
$i = 1;\r
imageline($im, 0 , $y0, 944 , $y0 , $c0);\r
imagepng($im, $img);\r
}\r
- $res = '<div style="position:absolute;top:' . $mhp . 'px;left:900px;color:#514e49;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxpages . '</div>';\r
- $res .= '<div style="position:absolute;top:' . $mhb . 'px;left:900px;color:#f54d00;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxb . '</div>';\r
- $res .= '<div style="position:absolute;top:' . $mhv . 'px;left:900px;color:#c2d313;background:#f4f4f1;padding-left:2px;padding-right:2px;">' . $maxv . '</div>';\r
- $res .= '<img src="' . $imgw . '" alt="' . __('Statistiques mensuelles') . '" />';\r
- $res .= '<table style="width:944px;max-width:944px;margin:0px;table-layout:fixed;"><tr>';\r
+ $res = '<div class="graphStats"><div class="graph-note" style="top:' . $mhp . 'px;color:#514e49;">' . $maxpages . '</div>';\r
+ $res .= '<div class="graph-note" style="top:' . $mhb . 'px;color:#f54d00;">' . $maxb . '</div>';\r
+ $res .= '<div class="graph-note" style="top:' . $mhv . 'px;color:#c2d313;">' . $maxv . '</div>';\r
+ $res .= '<div class="graph-container" style="background:url(' . $imgw . ')"></div>';\r
+ $res .= '<table style="width:944px;max-width:944px;margin:0px;table-layout:fixed;" class="echelle"><tr>';\r
foreach($days as $d => $t) {\r
$res .= '<td style="width:' . (20 + $space * 2) . 'px;max-width:' . (20 + $space * 2) . 'px;text-align:center;">' . $d . '</td>';\r
}\r
$spacef = 944 - (count($days) * (20 + ($space * 2)));\r
$res .= '<td style="width:' . $spacef . 'px;">' . cubeMedia::spacer($spacef, 20) . '</td>';\r
$res .= '</tr></table>';\r
- $res .= '<table style="margin-top:10px;margin-bottom:10px;"><tr>';\r
+ $res .= '<table style="margin-top:10px;margin-bottom:10px;" class="legende"><tr>';\r
$res .= '<td style="width:12px;background:#514e49;height:12px;"></td><td style="width:10px;"></td><td>' . __('Pages vues') . '</td><td style="width:10px;"></td>';\r
$res .= '<td style="width:12px;background:#f54d00;height:12px;"></td><td style="width:10px;"></td><td>' . __('Visites') . '</td><td style="width:10px;"></td>';\r
$res .= '<td style="width:12px;background:#c2d313;height:12px;"></td><td style="width:10px;"></td><td>' . __('Visiteurs uniques') . '</td><td style="width:10px;"></td>';\r
- $res .= '</tr></table>';\r
+ $res .= '</tr></table></div>';\r
return $res;\r
}\r
}\r