4 |
david |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************\
|
|
|
4 |
* SPIP, Systeme de publication pour l'internet *
|
|
|
5 |
* *
|
|
|
6 |
* Copyright (c) 2001-2005 *
|
|
|
7 |
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
|
|
|
8 |
* *
|
|
|
9 |
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
|
|
|
10 |
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
|
|
|
11 |
\***************************************************************************/
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
include ("inc.php3");
|
|
|
15 |
include_ecrire("inc_statistiques.php3");
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
if ($id_article = intval($id_article)){
|
|
|
19 |
$query = "SELECT titre, visites, popularite FROM spip_articles WHERE statut='publie' AND id_article ='$id_article'";
|
|
|
20 |
$result = spip_query($query);
|
|
|
21 |
|
|
|
22 |
if ($row = spip_fetch_array($result)) {
|
|
|
23 |
$titre = typo($row['titre']);
|
|
|
24 |
$total_absolu = $row['visites'];
|
|
|
25 |
$val_popularite = round($row['popularite']);
|
|
|
26 |
}
|
|
|
27 |
}
|
|
|
28 |
else {
|
|
|
29 |
$query = "SELECT SUM(visites) AS total_absolu FROM spip_visites";
|
|
|
30 |
$result = spip_query($query);
|
|
|
31 |
|
|
|
32 |
if ($row = spip_fetch_array($result)) {
|
|
|
33 |
$total_absolu = $row['total_absolu'];
|
|
|
34 |
}
|
|
|
35 |
}
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
if ($titre) $pourarticle = " "._T('info_pour')." « $titre »";
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
debut_page(_T('titre_page_statistiques_referers'), "suivi", "referers");
|
|
|
42 |
echo "<br><br><br>";
|
|
|
43 |
|
|
|
44 |
gros_titre(_T('titre_liens_entrants'));
|
|
|
45 |
|
|
|
46 |
//barre_onglets("statistiques", "referers");
|
|
|
47 |
|
|
|
48 |
debut_gauche();
|
|
|
49 |
debut_boite_info();
|
|
|
50 |
echo "<FONT FACE='Verdana,Arial,Sans,sans-serif' SIZE=2>";
|
|
|
51 |
echo "<P align=left>"._T('info_gauche_statistiques_referers')."</P></FONT>";
|
|
|
52 |
fin_boite_info();
|
|
|
53 |
|
|
|
54 |
debut_droite();
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
if ($connect_statut != '0minirezo') {
|
|
|
58 |
echo _T('avis_non_acces_page');
|
|
|
59 |
fin_page();
|
|
|
60 |
exit;
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
//
|
|
|
65 |
// Affichage des referers
|
|
|
66 |
//
|
|
|
67 |
|
|
|
68 |
// nombre de referers a afficher
|
|
|
69 |
$limit = intval($limit); //secu
|
|
|
70 |
if ($limit == 0) $limit = 100;
|
|
|
71 |
|
|
|
72 |
if ($jour<>'veille')
|
|
|
73 |
$jour='jour';
|
|
|
74 |
|
|
|
75 |
barre_onglets("stat_referers", $jour);
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
// afficher quels referers ?
|
|
|
79 |
$where = "visites_$jour>0";
|
|
|
80 |
$vis = "visites_$jour";
|
|
|
81 |
|
|
|
82 |
$table_ref = "spip_referers";
|
|
|
83 |
|
|
|
84 |
$query = "SELECT referer, $vis AS vis FROM $table_ref WHERE $where ORDER BY $vis DESC";
|
|
|
85 |
|
|
|
86 |
echo "<p><font face='Verdana,Arial,Sans,sans-serif' size=2>";
|
|
|
87 |
echo aff_referers ($query, $limit);
|
|
|
88 |
echo "</font></p>";
|
|
|
89 |
|
|
|
90 |
echo "</font>";
|
|
|
91 |
|
|
|
92 |
fin_page();
|
|
|
93 |
|
|
|
94 |
?>
|