From 0d46ac67ef14bcea76d9a6029a66dcd900d5f98b Mon Sep 17 00:00:00 2001 From: "ben.spip@gmail.com" <> Date: Sat, 30 May 2009 14:38:35 +0000 Subject: [PATCH] _plugins_/_core_ vers _core_/plugins --- .gitattributes | 28 + base/delete_statistiques.php | 34 + base/stats.php | 65 + base/stats_upgrade.php | 33 + engines-list.txt | 274 ++++ exec/statistiques_lang.php | 123 ++ exec/statistiques_referers.php | 77 + exec/statistiques_repartition.php | 180 +++ exec/statistiques_visites.php | 179 +++ formulaires/configurer_compteur.html | 42 + formulaires/configurer_compteur.php | 44 + genie/popularites.php | 83 + genie/visites.php | 224 +++ inc/referenceurs.php | 241 +++ inc/statistiques.php | 502 ++++++ javascript/excanvas.js | 785 ++++++++++ javascript/jquery.flot.js | 2136 ++++++++++++++++++++++++++ javascript/jquery.tflot.js | 714 +++++++++ plugin.xml | 87 ++ prive/bouton/statistiques.html | 3 + prive/configurer/compteur.html | 3 + prive/images/statistiques-48.png | Bin 0 -> 2795 bytes prive/stats/visites.html | 78 + prive/style_prive_plugin_stats.html | 76 + public/stats.php | 92 ++ stats_autoriser.php | 34 + stats_options.php | 5 + stats_pipelines.php | 127 ++ 28 files changed, 6269 insertions(+) create mode 100644 .gitattributes create mode 100644 base/delete_statistiques.php create mode 100644 base/stats.php create mode 100644 base/stats_upgrade.php create mode 100644 engines-list.txt create mode 100644 exec/statistiques_lang.php create mode 100644 exec/statistiques_referers.php create mode 100644 exec/statistiques_repartition.php create mode 100644 exec/statistiques_visites.php create mode 100644 formulaires/configurer_compteur.html create mode 100644 formulaires/configurer_compteur.php create mode 100644 genie/popularites.php create mode 100644 genie/visites.php create mode 100644 inc/referenceurs.php create mode 100644 inc/statistiques.php create mode 100644 javascript/excanvas.js create mode 100644 javascript/jquery.flot.js create mode 100644 javascript/jquery.tflot.js create mode 100644 plugin.xml create mode 100644 prive/bouton/statistiques.html create mode 100644 prive/configurer/compteur.html create mode 100644 prive/images/statistiques-48.png create mode 100644 prive/stats/visites.html create mode 100644 prive/style_prive_plugin_stats.html create mode 100644 public/stats.php create mode 100644 stats_autoriser.php create mode 100644 stats_options.php create mode 100644 stats_pipelines.php diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d94f874 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,28 @@ +* text=auto !eol +base/delete_statistiques.php -text +base/stats.php -text +base/stats_upgrade.php -text +/engines-list.txt -text +exec/statistiques_lang.php -text +exec/statistiques_referers.php -text +exec/statistiques_repartition.php -text +exec/statistiques_visites.php -text +formulaires/configurer_compteur.html -text +formulaires/configurer_compteur.php -text +genie/popularites.php -text +genie/visites.php -text +inc/referenceurs.php -text +inc/statistiques.php -text +javascript/excanvas.js -text +javascript/jquery.flot.js -text +javascript/jquery.tflot.js -text +/plugin.xml -text +prive/bouton/statistiques.html -text +prive/configurer/compteur.html -text +prive/images/statistiques-48.png -text +prive/stats/visites.html -text +prive/style_prive_plugin_stats.html -text +public/stats.php -text +/stats_autoriser.php -text +/stats_options.php -text +/stats_pipelines.php -text diff --git a/base/delete_statistiques.php b/base/delete_statistiques.php new file mode 100644 index 0000000..0277411 --- /dev/null +++ b/base/delete_statistiques.php @@ -0,0 +1,34 @@ +0, 'referers'=>0, 'popularite'=>0)); + + // un pipeline pour detruire les tables de stats installees par les plugins + pipeline('delete_statistiques', ''); + spip_log("raz des stats operee redirige vers " . _request('redirect')); +} +?> diff --git a/base/stats.php b/base/stats.php new file mode 100644 index 0000000..37579d5 --- /dev/null +++ b/base/stats.php @@ -0,0 +1,65 @@ + "DATE NOT NULL", + "visites" => "int UNSIGNED DEFAULT '0' NOT NULL", + "maj" => "TIMESTAMP"); + + $spip_visites_key = array( + "PRIMARY KEY" => "date"); + + $spip_visites_articles = array( + "date" => "DATE NOT NULL", + "id_article" => "int UNSIGNED NOT NULL", + "visites" => "int UNSIGNED DEFAULT '0' NOT NULL", + "maj" => "TIMESTAMP"); + + $spip_visites_articles_key = array( + "PRIMARY KEY" => "date, id_article"); + + + + $spip_referers = array( + "referer_md5" => "bigint UNSIGNED NOT NULL", + "date" => "DATE NOT NULL", + "referer" => "VARCHAR (255)", + "visites" => "int UNSIGNED NOT NULL", + "visites_jour" => "int UNSIGNED NOT NULL", + "visites_veille"=> "int UNSIGNED NOT NULL", + "maj" => "TIMESTAMP"); + + $spip_referers_key = array( + "PRIMARY KEY" => "referer_md5"); + + $spip_referers_articles = array( + "id_article" => "int UNSIGNED NOT NULL", + "referer_md5" => "bigint UNSIGNED NOT NULL", + "referer" => "VARCHAR (255) DEFAULT '' NOT NULL", + "visites" => "int UNSIGNED NOT NULL", + "maj" => "TIMESTAMP"); + + $spip_referers_articles_key = array( + "PRIMARY KEY" => "id_article, referer_md5", + "KEY referer_md5" => "referer_md5"); + + $tables_auxiliaires['spip_visites'] = array( + 'field' => &$spip_visites, + 'key' => &$spip_visites_key); + $tables_auxiliaires['spip_visites_articles'] = array( + 'field' => &$spip_visites_articles, + 'key' => &$spip_visites_articles_key); + $tables_auxiliaires['spip_referers'] = array( + 'field' => &$spip_referers, + 'key' => &$spip_referers_key); + $tables_auxiliaires['spip_referers_articles'] = array( + 'field' => &$spip_referers_articles, + 'key' => &$spip_referers_articles_key); + + return $tables_auxiliaires; +} + +?> diff --git a/base/stats_upgrade.php b/base/stats_upgrade.php new file mode 100644 index 0000000..d8b3fff --- /dev/null +++ b/base/stats_upgrade.php @@ -0,0 +1,33 @@ + diff --git a/engines-list.txt b/engines-list.txt new file mode 100644 index 0000000..62ccc1a --- /dev/null +++ b/engines-list.txt @@ -0,0 +1,274 @@ +# ----------------------------------------------------------------------------- +# Les Visiteurs - Engines List +# ----------------------------------------------------------------------------- +# [Engine Name] +# word= | word => query | directory +# host 1 +# host 2 +# hots ... +# ----------------------------------------------------------------------------- +# sort the list according your visits (see your referrers). +# ----------------------------------------------------------------------------- + +[IP] +rien= +[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ + +[Google] +(^q|\&q|as_q)= +(www\.|ww\.|maps\.)?(google|gogole)\.(.*) +(web|www).toile.com +www\.cegetel\.net +search\.conduit\.com +search\.sweetim\.com +chello\.fr + +[Voila] +(kw|rdata)= +(search|moteur)(.*)\.voila\.(fr|com) + +[Yahoo!] +p= +(.*)(search|ink|dir|google)\.yahoo\.([a-z]+)$ + +[AltaVista] +q= +(.*)altavista\.com + +[Ask] +q= +(.*)\.ask\.com + +[HotBot] +query= +www\.hotbot\.com + +[Freeserve] +q= +search\.freeserve\.com + +[Skeech] +query= +skeech\.com + +[Dogpile] +query= +(.*)dogpile\.com + +[Metacrawler] +query= +metacrawler\.com + +[Mirago] +qry= +www.mirago\.([a-z]+)$ + +[Nomade] +s= +(.*)\.nomade\.fr +(.*)\.nomade\.tiscali\.fr +(.*)\.nomade\.aliceadsl\.fr + +[Alice] +qs= +\.aliceadsl\. + +[Lycos] +query= +search\.lycos\.com +vachercher\.lycos\.fr + +[Francite] +name= +recherche\.francite\.com + +[MSN] +(q|s)= +search(.*)\.msn\.([a-z.]+)$ +leguide(.*)\.msn\.([a-z]+)$ +search\.ninemsn\.com\.au + +[Live] +q= +search\.live\.com + +[Excite] +search= +www\.excite\.fr +(.*)\.excite\.co\.jp + +[AOL France] +(query|q|r)= +(.*)recherchet?\.aol\.fr + +[AOLsearch] +query= +(.*)search\.aol\.(.*) + +[AllTheWeb] +q= +www\.alltheweb\.com + +[ixquick] +query= +ixquick\.com + +[Netscape] +search= +search-intl\.netscape\.com +search\.netscape\.com +www\.netscape\.fr + +[Free] +q= +search(.*)\.free\.fr + +[9online] +query= +www\.9online\.fr + +[Naver] +query= +search\.naver\.com + +[Club Internet] +q= +recherche\.club-internet\.fr + +[Sympatico] +query= +search\.sli\.sympatico\.ca + +[Overture] +Keywords= +www\.overture\.com + +[moteur-recherche.net] +keyword= +www\.moteur-recherche\.net + +[Reacteur.com] +kw= +www\.reacteur\.com + +[francesurf] +q= +www\.francesurf\.net + +[n9uf] +((K|k)eywords|query)= +(www\.)?neuf\.fr + +[MozBot] +q= +www\.mozbot\.([a-z]+)$ + +[Cegetel] +q= +(www\.)?cegetel\.([a-z]+)$ + +[MyWay] +searchfor= +kf\.mysearch\.myway\.com +www\.mywebsearch\.com +(.*)\.mysearch\.com + +[MonGenie] +Keywords= +www\.mongenie\.com + +[Need2Find] +searchfor= +kx\.search\.need2find\.com + +[Exalead] +q= +www\.exalead\.fr +www\.exalead\.com + +[Virgilio.it] +qs= +search\.virgilio\.it + +[Libero.it] +query= +arianna\.libero\.it + +[LemmeFind] +t= +www\.lemmefind\.fr + +[NovoNeo] +q= +www\.novoneo\.com + +[MyWebSearch] +searchfor= +search\.mywebsearch\.com + +[Copernic] +query= +find\.copernic\.com + +[Seek] +qry_str= +\.seek\.fr + +[Orange, le moteur] +rdata= +www\.lemoteur\.fr + +[alOt] +q= +search\.alot\.com + +# +# Dmoz +# +[dmoz.org] +rien= +(.*\.)?dmoz\.org + +[FoxRef] +key= +www\.foxref\.org + +[OneBigWorld] +Keywords= +fr\.onebigworld\.com + +[BlueWin] +query= +search\.bluewin\.ch + +[EO] +q= +www\.eo\.st + +[HooSeek] +recherche= +(www\.)?hooseek\.com + +[Lost] +x_query= +(www\.)?lo\.st + +[Babylon] +q= +search\.babylon\.com + +# +# Services de mail +# + +[(email)] +rien= +imp(.*)\.free\.fr +fc\.kayenta\.com +courrielweb\.cmaisonneuve\.qc\.ca +(.*)mail\.(.*)\.([a-z]+)$ +webmail([0-9]*)\.wanadoo\.fr +www\.laposte\.net +mail([0-9]*)\.voila\.fr +\/(web)?mail\/ + diff --git a/exec/statistiques_lang.php b/exec/statistiques_lang.php new file mode 100644 index 0000000..c3376fb --- /dev/null +++ b/exec/statistiques_lang.php @@ -0,0 +1,123 @@ +
$pourcent%".traduire_nom_langue($lang)." | "; + + echo "";
+ echo "\n
| ";
+ echo "
"._T('texte_signification').""; + + echo fin_cadre_enfonce(true); + + echo "
"; + echo _T('info_gauche_statistiques_referers'); + echo "
"; + echo fin_boite_info(true); + echo debut_droite('', true); + echo barre_onglets("stat_referers", $jour . '_referers'); // attention a pas avoir le meme id d'onglet... + + if ($res) { + echo "";
+
+
+ if ( $largeur_rouge > 2)
+ echo bouton_block_depliable("$titre","incertain", "stats$id_rubrique");
+ else
+ echo " ",
+ "$titre",
+ " ";
+ echo " | ";
+
+
+ if ($niveau==0 OR 1==1){
+ $pourcent = round($nombre_vis[$id_rubrique]/$abs_total*1000)/10;
+ echo "\n$pourcent% | "; + } + else { echo ""; } + + + echo "\n | ";
+
+
+ echo "\n
|
";
+ $critere = _request('critere');
+
+ if ($critere == "debut") {
+ $critere = "visites";
+ echo ""._T('icone_repartition_actuelle').'';
+ echo " | "._T('onglet_repartition_debut').'';
+ }
+ else {
+ $critere = "popularite";
+ echo ""._T('icone_repartition_actuelle').'';
+ echo " | "._T('onglet_repartition_debut').'';
+ }
+
+ $abs_total=enfants(0, $critere);
+ if ($abs_total<1) $abs_total=1;
+ $nombre_vis[0] = 0;
+
+ echo debut_cadre_relief("statistiques-24.gif",true);
+ echo " ";
+ enfants_aff(0,$taille, $critere);
+ echo " ", + " ",
+ _T('texte_signification'),
+ " ";
+ echo fin_cadre_relief(true);
+ echo " |