stats.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /***************************************************************************\
  3. * SPIP, Systeme de publication pour l'internet *
  4. * *
  5. * Copyright (c) 2001-2014 *
  6. * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
  7. * *
  8. * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
  9. * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
  10. \***************************************************************************/
  11. if (!defined("_ECRIRE_INC_VERSION")) return;
  12. function stats_declarer_tables_auxiliaires($tables_auxiliaires){
  13. $spip_visites = array(
  14. "date" => "DATE NOT NULL",
  15. "visites" => "int UNSIGNED DEFAULT '0' NOT NULL",
  16. "maj" => "TIMESTAMP");
  17. $spip_visites_key = array(
  18. "PRIMARY KEY" => "date");
  19. $spip_visites_articles = array(
  20. "date" => "DATE NOT NULL",
  21. "id_article" => "int UNSIGNED NOT NULL",
  22. "visites" => "int UNSIGNED DEFAULT '0' NOT NULL",
  23. "maj" => "TIMESTAMP");
  24. $spip_visites_articles_key = array(
  25. "PRIMARY KEY" => "date, id_article");
  26. $spip_referers = array(
  27. "referer_md5" => "bigint UNSIGNED NOT NULL",
  28. "date" => "DATE NOT NULL",
  29. "referer" => "VARCHAR (255)",
  30. "visites" => "int UNSIGNED NOT NULL",
  31. "visites_jour" => "int UNSIGNED NOT NULL",
  32. "visites_veille"=> "int UNSIGNED NOT NULL",
  33. "maj" => "TIMESTAMP");
  34. $spip_referers_key = array(
  35. "PRIMARY KEY" => "referer_md5");
  36. $spip_referers_articles = array(
  37. "id_article" => "int UNSIGNED NOT NULL",
  38. "referer_md5" => "bigint UNSIGNED NOT NULL",
  39. "referer" => "VARCHAR (255) DEFAULT '' NOT NULL",
  40. "visites" => "int UNSIGNED NOT NULL",
  41. "maj" => "TIMESTAMP");
  42. $spip_referers_articles_key = array(
  43. "PRIMARY KEY" => "id_article, referer_md5",
  44. "KEY referer_md5" => "referer_md5");
  45. $tables_auxiliaires['spip_visites'] = array(
  46. 'field' => &$spip_visites,
  47. 'key' => &$spip_visites_key);
  48. $tables_auxiliaires['spip_visites_articles'] = array(
  49. 'field' => &$spip_visites_articles,
  50. 'key' => &$spip_visites_articles_key);
  51. $tables_auxiliaires['spip_referers'] = array(
  52. 'field' => &$spip_referers,
  53. 'key' => &$spip_referers_key);
  54. $tables_auxiliaires['spip_referers_articles'] = array(
  55. 'field' => &$spip_referers_articles,
  56. 'key' => &$spip_referers_articles_key);
  57. return $tables_auxiliaires;
  58. }
  59. ?>