-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrss.php
More file actions
137 lines (117 loc) · 4.06 KB
/
Copy pathrss.php
File metadata and controls
137 lines (117 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
// Page d'accueil publique du programmes ExpoActes
// Copyright (C) : André Delacharlerie, 2005-2006
// Ce programme est libre, vous pouvez le redistribuer et/ou le modifier selon les termes de la
// Licence Publique Générale GNU, version 2 (GPLv2), publiée par la Free Software Foundation
// Texte de la licence : https://www.gnu.org/licenses/old-licenses/gpl-2.0.fr.html
// Corrigé 07/09/2014 ADLC : Codage caractères pour XML (HTML)
// Adapté 06/10/2014 EL : Corrigé l'appel à la table des utilisateurs EA_UDB ligne 45, Remis le département dans le lien ligne 111, Mis le port du serveur lignes 66 et 119
//-------------------------------------------------------------------
if (file_exists('tools/_COMMUN_env.inc.php')){
$EA_Appel_dOu = '';
} else {
$EA_Appel_dOu = '../';
}
include($EA_Appel_dOu.'tools/_COMMUN_env.inc.php');
include('tools/MakeRss/MakeRss.class.php');
function antispam($email)
{
return str_replace(array("@"), array("@anti.spam.com@"),$email);
}
$root = "";
$path = "";
$max = 10;
$xtyp = getparam('type');
$xall = getparam('all');
$xcomm=$xpatr=$page="";
pathroot($root,$path,$xcomm,$xpatr,$page);
$request = "";
if ($xall=="")
$limit = ' LIMIT '.$max;
else
{
$limit = '';
$max = 1E4;
}
if ($xtyp=="" or $xtyp=="A")
$condit = "";
else
$condit = " WHERE TYPACT = '".$xtyp."'";
/*
$request .="SELECT TYPACT as TYP, sum(NB_TOT) as CPT, COMMUNE, DEPART, concat(PRENOM,' ',u.NOM) as DEPO, EMAIL, DTDEPOT as DTE, AN_MIN as DEB, AN_MAX as FIN"
. " FROM ".EA_DB."_sums as a left join ".EA_UDB."_user3 as u on (a.deposant=u.id)"
. $condit
. ' GROUP BY COMMUNE, DEPART, TYP, PRENOM, NOM, email, dtdepot, an_min, an_max '
. ' ORDER BY DTE desc '
. $limit;
*/
$request ="SELECT TYPACT as TYP, sum(NB_TOT) as CPT, COMMUNE, DEPART, max(DTDEPOT) as DTE, min(AN_MIN) as DEB, max(AN_MAX) as FIN"
. " FROM ".EA_DB."_sums as a "
. $condit
. ' GROUP BY COMMUNE, DEPART, TYP '
. ' ORDER BY DTE desc, COMMUNE, DEPART '
. $limit;
//echo $request;
$result = EA_sql_query($request);
optimize($request);
/* CHARGEMENT DU GENERATEUR */
$rss = new GenRSS();
/* OUVERTURE DU FIL */
$rss->Load();
$titre = 'Actes de '.SITENAME;
/* LES PARAMETRES OBLIGATOIRES */
$rss->SetTitre(htmlspecialchars($titre, ENTITY_REPLACE_FLAGS, ENTITY_CHARSET));
$rss->SetLink(EA_URL_CE_SERVEUR . $root.'/index.php');
$rss->SetDetails("Dépouillement de tables et actes d'état-civil ou de registres paroissiaux");
/* LES PARAMETRES FACULTATIFS (Mettez // devant les paramètres que vous ne voulez pas renseigner) */
$rss->SetLanguage('fr');
//$rss->SetRights('copyright');
//$rss->SetEditor(EMAIL);
//$rss->SetMaster('email tech');
//$rss->SetImage('http://'.$_SERVER['SERVER_NAME'].DIR_VIGNET.$row["FICHIER"],'','lien');
/* AJOUT DES ARTICLES AU FIL */
$cpt = 0;
while ($row = EA_sql_fetch_array($result) and $cpt<$max)
{
$cpt++;
$titre = $row["COMMUNE"];
if ($row["DEPART"] != "") $titre .= ' ['.$row["DEPART"].']' ;
$date_rss = date_rss($row["DTE"]);
switch ($row["TYP"])
{
case "N" :
$typ="Naissances/Baptêmes";
$prog = "tab_naiss";
break;
case "D" :
$typ="Décès/Sépultures";
$prog = "tab_deces";
break;
case "M" :
$typ="Mariages";
$prog = "tab_mari";
break;
case "V" :
$typ="Actes divers"; // : ".$row["LIBELLE"];
$prog = "tab_bans";
break;
}
$titre = htmlspecialchars($row["COMMUNE"], ENTITY_REPLACE_FLAGS, ENTITY_CHARSET);
if ($row["DEPART"] != "") $titre .= ' ['.htmlspecialchars($row["DEPART"], ENTITY_REPLACE_FLAGS, ENTITY_CHARSET).']' ;
$titre .= ' : '.$typ;
$description = $row["CPT"].' '.$typ.' de '.$row["DEB"].' à '.$row["FIN"];
$auteur = "";
$url = $root.'/'.$prog.".php?args=".urlencode($row["COMMUNE"].' ['.$row["DEPART"].']');
/* $rss->AddItem('Titre','Descripton','Auteur','Catégorie','date','http://'); */
$rss->AddItem( htmlspecialchars($titre),
htmlspecialchars($description),
htmlspecialchars($auteur),
$typ,
$date_rss,
EA_URL_CE_SERVEUR . $url);
}
/* FERMETURE DU FIL */
$rss->Close();
/* GENERATION DU RSS */
$rss->Generer();
?>