1 |
<?php
|
1 |
<?php
|
2 |
/** baz_valeur_template() - Renvoi des valeurs inscrite dans le fichier de template
|
2 |
/** baz_valeur_template() - Renvoi des valeurs inscrite dans le fichier de template
|
3 |
*
|
3 |
*
|
4 |
* @param string nom du fichier de template
|
4 |
* @param string nom du fichier de template
|
5 |
*
|
5 |
*
|
6 |
* @return mixed tableau contenant les champs du fichier template
|
6 |
* @return mixed tableau contenant les champs du fichier template
|
7 |
*/
|
7 |
*/
|
8 |
function baz_valeurs_template($fichier_template) {
|
8 |
function baz_valeurs_template($fichier_template) {
|
9 |
//Parcours du fichier de templates, pour mettre les champs spécifiques
|
9 |
//Parcours du fichier de templates, pour mettre les champs spécifiques
|
10 |
$nblignes=0;
|
10 |
$nblignes=0;
|
11 |
$fichier=file_get_contents(BAZ_CHEMIN_APPLI.'templates/'.$fichier_template);
|
11 |
$fichier=file_get_contents(BAZ_CHEMIN_APPLI.'templates/'.$fichier_template);
|
12 |
$chaine = explode ("\n", $fichier);
|
12 |
$chaine = explode ("\n", $fichier);
|
13 |
array_pop($chaine);
|
13 |
array_pop($chaine);
|
14 |
foreach ($chaine as $ligne) {
|
14 |
foreach ($chaine as $ligne) {
|
15 |
$souschaine = explode ("***", $ligne) ;
|
15 |
$souschaine = explode ("***", $ligne) ;
|
16 |
$tableau[$nblignes]['type'] = trim($souschaine[0]) ;
|
16 |
$tableau[$nblignes]['type'] = trim($souschaine[0]) ;
|
17 |
if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);}
|
17 |
if (isset($souschaine[1])) {$tableau[$nblignes]['nom_bdd'] = trim($souschaine[1]);}
|
18 |
else {$tableau[$nblignes]['nom_bdd'] ='';}
|
18 |
else {$tableau[$nblignes]['nom_bdd'] ='';}
|
19 |
if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]);
|
19 |
if (isset($souschaine[2])) $tableau[$nblignes]['label'] = trim($souschaine[2]);
|
20 |
else {$tableau[$nblignes]['label'] ='';}
|
20 |
else {$tableau[$nblignes]['label'] ='';}
|
21 |
if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]);
|
21 |
if (isset($souschaine[3])) $tableau[$nblignes]['limite1'] = trim($souschaine[3]);
|
22 |
else {$tableau[$nblignes]['limite1'] ='';}
|
22 |
else {$tableau[$nblignes]['limite1'] ='';}
|
23 |
if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]);
|
23 |
if (isset($souschaine[4])) $tableau[$nblignes]['limite2'] = trim($souschaine[4]);
|
24 |
else {$tableau[$nblignes]['limite2'] ='';}
|
24 |
else {$tableau[$nblignes]['limite2'] ='';}
|
25 |
if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]);
|
25 |
if (isset($souschaine[5])) $tableau[$nblignes]['defaut'] = trim($souschaine[5]);
|
26 |
else {$tableau[$nblignes]['defaut'] ='';}
|
26 |
else {$tableau[$nblignes]['defaut'] ='';}
|
27 |
if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]);
|
27 |
if (isset($souschaine[6])) $tableau[$nblignes]['table_source'] = trim($souschaine[6]);
|
28 |
else {$tableau[$nblignes]['table_source'] ='';}
|
28 |
else {$tableau[$nblignes]['table_source'] ='';}
|
29 |
if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]);
|
29 |
if (isset($souschaine[7])) $tableau[$nblignes]['id_source'] = trim($souschaine[7]);
|
30 |
else {$tableau[$nblignes]['id_source'] ='';}
|
30 |
else {$tableau[$nblignes]['id_source'] ='';}
|
31 |
if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]);
|
31 |
if (isset($souschaine[8])) $tableau[$nblignes]['obligatoire'] = trim($souschaine[8]);
|
32 |
else {$tableau[$nblignes]['obligatoire'] ='';}
|
32 |
else {$tableau[$nblignes]['obligatoire'] ='';}
|
33 |
$nblignes++;
|
33 |
$nblignes++;
|
34 |
}
|
34 |
}
|
35 |
return $tableau;
|
35 |
return $tableau;
|
36 |
}
|
36 |
}
|
37 |
|
37 |
|
38 |
|
38 |
|
39 |
/** baz_voir_fiche() - Permet de visualiser en détail une fiche au format XHTML
|
39 |
/** baz_voir_fiche() - Permet de visualiser en détail une fiche au format XHTML
|
40 |
*
|
40 |
*
|
41 |
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli) si à 1
|
41 |
* @global boolean Rajoute des informations internes à l'application (date de modification, lien vers la page de départ de l'appli) si à 1
|
42 |
* @global integer Identifiant de la fiche à afficher
|
42 |
* @global integer Identifiant de la fiche à afficher
|
43 |
*
|
43 |
*
|
44 |
* @return string HTML
|
44 |
* @return string HTML
|
45 |
*/
|
45 |
*/
|
46 |
function baz_voir_fiche($danslappli, $idfiche='') {
|
46 |
function baz_voir_fiche($danslappli, $idfiche='') {
|
47 |
$res = '';
|
- |
|
48 |
if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
|
47 |
if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
|
49 |
if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche;
|
48 |
if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche;
|
- |
|
49 |
|
- |
|
50 |
//on met à jour le nb de visites pour la fiche
|
- |
|
51 |
$requete = 'UPDATE bazar_fiche SET bf_nb_consultations=bf_nb_consultations+1 WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
- |
|
52 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
50 |
|
53 |
|
51 |
//on cherche le type d'annonce
|
54 |
//on cherche le type d'annonce, l'annonceur et les stats
|
52 |
$requete = 'SELECT bn_label_nature FROM bazar_fiche, bazar_nature WHERE bn_id_nature=bf_ce_nature AND bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
55 |
$requete = 'SELECT bn_label_nature, bn_commentaire, bn_appropriation, bf_ce_utilisateur,bf_nb_consultations FROM bazar_fiche, bazar_nature WHERE bn_id_nature=bf_ce_nature AND bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
53 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
56 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
54 |
if (DB::isError($resultat)) {
|
57 |
if (DB::isError($resultat)) {
|
55 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
58 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
56 |
}
|
59 |
}
|
57 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
60 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
58 |
$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature'];
|
61 |
$GLOBALS['_BAZAR_']['typeannonce']=$ligne['bn_label_nature'];
|
- |
|
62 |
$GLOBALS['_BAZAR_']['commentaire']=$ligne['bn_commentaire'];
|
- |
|
63 |
$GLOBALS['_BAZAR_']['appropriation']=$ligne['bn_appropriation'];
|
- |
|
64 |
$GLOBALS['_BAZAR_']['annonceur']=$ligne['bf_ce_utilisateur'];
|
- |
|
65 |
$GLOBALS['_BAZAR_']['nb_consultations']=$ligne['bf_nb_consultations'];
|
59 |
}
|
66 |
}
|
60 |
$res = '<div id="BAZ_cadre_fiche">'."\n";
|
67 |
$res = '<div class="BAZ_cadre_fiche">'."\n";
|
61 |
$res .= '<div id="BAZ_cadre_fiche_haut">'."\n";
|
68 |
$res .= '<div class="BAZ_cadre_fiche_haut">'."\n";
|
62 |
$res .= ' </div>'."\n";
|
69 |
$res .= ' </div>'."\n";
|
63 |
$res .= '<div id="BAZ_cadre_fiche_corps">'."\n";
|
70 |
$res .= '<div class="BAZ_cadre_fiche_corps">'."\n";
|
64 |
|
71 |
|
65 |
//si le template existe, on génère le template
|
72 |
//si le template existe, on génère le template
|
66 |
if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
|
73 |
if ((file_exists(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php'))) {
|
67 |
include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
|
74 |
include_once(BAZ_CHEMIN_APPLI.'templates/'.$GLOBALS['_BAZAR_']['typeannonce'].'-fiche.php');
|
68 |
$res .=genere_fiche($GLOBALS['_BAZAR_']['id_fiche'],$danslappli);
|
75 |
$res .=genere_fiche($GLOBALS['_BAZAR_']['id_fiche']);
|
69 |
}
|
76 |
}
|
70 |
//on affiche ligne par ligne sinon
|
77 |
//on affiche ligne par ligne sinon
|
71 |
else {
|
78 |
else {
|
72 |
$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
79 |
$requete = 'SELECT * FROM bazar_fiche WHERE bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
73 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
80 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
74 |
if (DB::isError ($resultat)) {
|
81 |
if (DB::isError ($resultat)) {
|
75 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
82 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
76 |
}
|
83 |
}
|
77 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
|
84 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
|
- |
|
85 |
|
- |
|
86 |
if (isset($ligne['bf_url_image'])) {
|
78 |
|
87 |
$res .= '<div id="fiche_image">'."\n";
|
- |
|
88 |
$res .= '<img src="'.'http://'.$_SERVER['HTTP_HOST'].'/client/bazar/images/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" />'."\n";
|
79 |
if (isset($ligne['bf_url_image'])) $res .= '<img src="'.'http://'.$_SERVER['HTTP_HOST'].'/client/bazar/images/'.$ligne['bf_url_image'].'" border=0 alt="'.BAZ_TEXTE_IMG_ALTERNATIF.'" align="left" style="padding:0 10px 5px 0;" />'."\n";
|
89 |
$res .= '</div>'."\n";
|
- |
|
90 |
$res .= '<div id="fiche_titre_image">'.$ligne['bf_titre'];
|
- |
|
91 |
}
|
80 |
$res .= '<h2>'.$ligne['bf_titre'].'</h2>'."\n" ;
|
92 |
else {
|
81 |
if (isset($ligne['bf_description'])) $res .= '<br />'.$ligne['bf_description'].'<br /><br />'."\n";
|
93 |
$res .= '<div id="fiche_titre">'.$ligne['bf_titre'];
|
- |
|
94 |
}
|
- |
|
95 |
$res .= '</div>'."\n";
|
82 |
|
96 |
$res .= '<div id="BAZ_description">'.$ligne['bf_description'].'</div>'."\n";
|
83 |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['typeannonce'].'.tpl');
|
97 |
$tableau=baz_valeurs_template($GLOBALS['_BAZAR_']['typeannonce'].'.tpl');
|
84 |
for ($i=0; $i<count($tableau); $i++) {
|
98 |
for ($i=0; $i<count($tableau); $i++) {
|
85 |
if (isset($ligne[$tableau[$i]['nom_bdd']])) {
|
99 |
if (isset($ligne[$tableau[$i]['nom_bdd']])) {
|
86 |
//pour les champs renseignés par une liste, on va chercher le label de la liste, plutot que l'id
|
100 |
//pour les champs renseignés par une liste, on va chercher le label de la liste, plutot que l'id
|
87 |
if ($tableau[$i]['type']=='liste') {
|
101 |
if ($tableau[$i]['type']=='liste') {
|
88 |
$requete = 'SELECT '.$tableau[$i]['table_source'].'.* FROM bazar_fiche, '.$tableau[$i]['table_source'].
|
102 |
$requete = 'SELECT '.$tableau[$i]['table_source'].'.* FROM bazar_fiche, '.$tableau[$i]['table_source'].
|
89 |
' WHERE '.$tableau[$i]['nom_bdd'].'='.$tableau[$i]['id_source'].' AND bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
103 |
' WHERE '.$tableau[$i]['nom_bdd'].'='.$tableau[$i]['id_source'].' AND bf_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
90 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
104 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
91 |
if (DB::isError ($resultat)) {
|
105 |
if (DB::isError ($resultat)) {
|
92 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
106 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
93 |
}
|
107 |
}
|
94 |
while ($tab = $resultat->fetchRow()) {
|
108 |
while ($tab = $resultat->fetchRow()) {
|
95 |
$val=encoderChaine($tab[1]);
|
109 |
$val=$tab[1];
|
96 |
}
|
110 |
}
|
97 |
}
|
111 |
}
|
98 |
else {
|
112 |
else {
|
99 |
$val=encoderChaine($ligne[$tableau[$i]['nom_bdd']]);
|
113 |
$val=$ligne[$tableau[$i]['nom_bdd']];
|
100 |
}
|
114 |
}
|
101 |
if (($tableau[$i]['nom_bdd']!='bf_titre')and($tableau[$i]['nom_bdd']!='bf_description')) {
|
115 |
if (($tableau[$i]['nom_bdd']!='bf_titre')and($tableau[$i]['nom_bdd']!='bf_description')) {
|
- |
|
116 |
if ($val!='') {
|
102 |
if ($val!='') $res .= '<br /><strong>'.constant($tableau[$i]['label']).':</strong> '.$val.'<br />'."\n";
|
117 |
$res .= '<span class="rubrique">'.constant($tableau[$i]['label']).':</span>'."\n";
|
- |
|
118 |
$res .= '<span class="description"> '.$val.'</span>'."\n".'<br />'."\n";
|
- |
|
119 |
}
|
103 |
}
|
120 |
}
|
104 |
}
|
121 |
}
|
105 |
}
|
122 |
}
|
106 |
|
123 |
}
|
107 |
//afficher les liens pour l'annonce
|
124 |
//afficher les liens pour l'annonce
|
108 |
$requete = 'SELECT bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
125 |
$requete = 'SELECT bu_url, bu_descriptif_url FROM bazar_url WHERE bu_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
109 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
126 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
110 |
if (DB::isError($resultat)) {
|
127 |
if (DB::isError($resultat)) {
|
111 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
128 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
129 |
}
|
- |
|
130 |
if ($resultat->numRows()>0) {
|
- |
|
131 |
$res .= '<span class="rubrique">'.BAZ_LIEN_INTERNET.':</span>'."\n";
|
- |
|
132 |
$res .= '<span class="description">'."\n";
|
- |
|
133 |
$res .= '<ul>'."\n";
|
- |
|
134 |
while ($ligne1 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
135 |
$res .= '<li><a href="'.$ligne1['bu_url'].'" target="_blank">'.$ligne1['bu_descriptif_url'].'</a></li>'."\n";
|
112 |
}
|
136 |
}
|
- |
|
137 |
$res .= '</ul></span>'."\n";
|
- |
|
138 |
}
|
- |
|
139 |
|
- |
|
140 |
//afficher les fichiers pour l'annonce
|
- |
|
141 |
$requete = 'SELECT bfj_description, bfj_fichier FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
- |
|
142 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
143 |
if (DB::isError($resultat)) {
|
- |
|
144 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
145 |
}
|
113 |
if ($resultat->numRows()>0) {
|
146 |
if ($resultat->numRows()>0) {
|
114 |
$res .= '<br /><strong>'.BAZ_LIEN_INTERNET.':</strong>'."\n";
|
147 |
$res .= '<span class="rubrique">'.BAZ_LISTE_FICHIERS_JOINTS.':</span>'."\n";
|
- |
|
148 |
$res .= '<span class="description">'."\n";
|
115 |
$res .= '<ul>'."\n";
|
149 |
$res .= '<ul>'."\n";
|
116 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
150 |
while ($ligne2 = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
117 |
$res .= '<li><a href="'.$ligne['bu_url'].'" target="_blank">'.$ligne['bu_descriptif_url'].'</a></li>'."\n";
|
151 |
$res .= '<li><a href="http://'.$_SERVER['HTTP_HOST'].'/client/bazar/upload/'.$ligne2['bfj_fichier'].'">'.$ligne2['bfj_description'].'</a></li>'."\n";
|
- |
|
152 |
}
|
- |
|
153 |
$res .= '</ul></span>'."\n";
|
- |
|
154 |
}
|
- |
|
155 |
$res .= '<div id="bulle_haut"> </div>'."\n";
|
- |
|
156 |
$res .= '<div id="bulle_corps">'."\n";
|
- |
|
157 |
|
- |
|
158 |
//affichage du rédacteur de la fiche
|
- |
|
159 |
$requete = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.', '.BAZ_CHAMPS_EMAIL.' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$GLOBALS['_BAZAR_']['annonceur'];
|
- |
|
160 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
161 |
if (DB::isError($resultat)) {
|
- |
|
162 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
163 |
}
|
- |
|
164 |
while ($redacteur = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
- |
|
165 |
$res .= BAZ_FICHE_ECRITE.'<a href="mailto:'.$redacteur[BAZ_CHAMPS_EMAIL].'">'.$redacteur[BAZ_CHAMPS_PRENOM].' '.$redacteur[BAZ_CHAMPS_NOM].'</a><br />'."\n";
|
- |
|
166 |
}
|
- |
|
167 |
$res .= BAZ_NB_VUS.'<strong>'.$GLOBALS['_BAZAR_']['nb_consultations'].'</strong>'.BAZ_FOIS.'<br />'."\n";
|
- |
|
168 |
$res .= '</div>'."\n";
|
- |
|
169 |
$res .= '<div id="bulle_bas"> </div>'."\n";
|
- |
|
170 |
$res .= '<div id="BAZ_bas_page">';
|
- |
|
171 |
//informations complémentaires (id fiche, état publication,... )
|
- |
|
172 |
if ($danslappli==1) {
|
- |
|
173 |
$res .= '<span class="rubrique">'.BAZ_NUM_FICHE.':</span> '.$GLOBALS['_BAZAR_']['id_fiche'].'<br />'."\n";
|
- |
|
174 |
$res .= '<span class="rubrique">'.BAZ_NATURE.':</span> '.$GLOBALS['_BAZAR_']['typeannonce'].'<br />'."\n";
|
- |
|
175 |
if ($ligne['bf_statut_fiche']==1) {
|
- |
|
176 |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_OUI.'<br />'."\n";
|
- |
|
177 |
}
|
- |
|
178 |
else {
|
- |
|
179 |
$res .= '<span class="rubrique">'.BAZ_PUBLIEE.':</span> '.BAZ_NON.'<br />'."\n";
|
- |
|
180 |
}
|
- |
|
181 |
$res .= '<span class="rubrique">'.BAZ_DATE_CREATION.':</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_creation_fiche'])).'<br />'."\n";
|
- |
|
182 |
$res .= '<span class="rubrique">'.BAZ_DATE_MAJ.':</span> '.strftime('%d.%m.%Y à %H:%M',strtotime($ligne['bf_date_maj_fiche']));
|
- |
|
183 |
//pour les identifiés seulement, administrateurs de la rubrique ou superadmins
|
- |
|
184 |
if ($GLOBALS['AUTH']->getAuth()) {
|
- |
|
185 |
$est_admin=0;
|
- |
|
186 |
$requete='SELECT bn_id_nature FROM bazar_nature WHERE bn_label_nature="'.$GLOBALS['_BAZAR_']['typeannonce'].'"';
|
- |
|
187 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
- |
|
188 |
if (DB::isError($resultat)) {
|
- |
|
189 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
- |
|
190 |
}
|
- |
|
191 |
$result = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
- |
|
192 |
if ((niveau_droit($result['bn_id_nature'],$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID)))=='administrateur') {
|
- |
|
193 |
$est_admin=1;
|
- |
|
194 |
}
|
- |
|
195 |
if (($est_admin)or(niveau_droit($id_nature_offre='0',$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))=='superadministrateur')or($GLOBALS['_BAZAR_']['annonceur']==$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID))) {
|
- |
|
196 |
$lien_modifier=$GLOBALS['_BAZAR_']['url'];
|
- |
|
197 |
$lien_modifier->addQueryString('action', BAZ_ACTION_MODIFIER);
|
- |
|
198 |
$lien_modifier->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
|
- |
|
199 |
$lien_modifier->addQueryString('typeannonce', $GLOBALS['_BAZAR_']['typeannonce']);
|
- |
|
200 |
$res .= ' <a href="'.$lien_modifier->getURL().'">'.BAZ_MODIFIER_LA_FICHE.'</a>'."\n";
|
118 |
}
|
201 |
}
|
119 |
$res .= '</ul>'."\n";
|
- |
|
120 |
}
|
202 |
}
|
- |
|
203 |
}
|
- |
|
204 |
$res .= '</div>'."\n";
|
- |
|
205 |
$res .= '</div>'."\n";
|
- |
|
206 |
$res .= '<div class="BAZ_cadre_fiche_bas"> </div>'."\n";
|
- |
|
207 |
$res .= '</div>'."\n";
|
121 |
|
208 |
|
122 |
//afficher les fichiers pour l'annonce
|
209 |
//on ajoute les commentaires, s'il le faut
|
- |
|
210 |
if ($GLOBALS['_BAZAR_']['commentaire']==1) {
|
- |
|
211 |
$res .= '<div class="BAZ_cadre_fiche">'."\n";
|
- |
|
212 |
$res .= '<div class="BAZ_cadre_fiche_haut"> </div>'."\n";
|
- |
|
213 |
$res .= '<div class="BAZ_cadre_fiche_corps">'."\n";
|
- |
|
214 |
$res .= '<h3>'.BAZ_LES_COMMENTAIRES.'</h3>'."\n";
|
123 |
$requete = 'SELECT bfj_description, bfj_fichier FROM bazar_fichier_joint WHERE bfj_ce_fiche='.$GLOBALS['_BAZAR_']['id_fiche'];
|
215 |
$requete = 'SELECT * FROM bazar_commentaires WHERE bc_ce_id_fiche='.$GLOBALS['_BAZAR_']['id_fiche'].' ORDER BY bc_date ASC';
|
124 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
216 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
125 |
if (DB::isError($resultat)) {
|
217 |
if (DB::isError ($resultat)) {
|
126 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
218 |
die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
|
127 |
}
|
219 |
}
|
128 |
if ($resultat->numRows()>0) {
|
220 |
if ($resultat->numRows()>0) {
|
- |
|
221 |
$res .= 'Il y a '.$resultat->numRows();
|
129 |
$res .= '<br /><strong>'.BAZ_LISTE_FICHIERS_JOINTS.':</strong>'."\n";
|
222 |
if ($resultat->numRows()==1) $res .= 'commentaire : '.'<br />'."\n";
|
130 |
$res .= '<ul>'."\n";
|
223 |
else $res .= 'commentaires : '.'<br />'."\n";
|
131 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
224 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
132 |
$res .= '<li><a href="http://'.$_SERVER['HTTP_HOST'].'/client/bazar/upload/'.$ligne['bfj_fichier'].'">'.$ligne['bfj_description'].'</a></li>'."\n";
|
225 |
$res .= 'essai'."\n";
|
133 |
}
|
226 |
}
|
134 |
$res .= '</ul>'."\n";
|
- |
|
135 |
}
|
227 |
}
|
- |
|
228 |
else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br />'."\n";
|
- |
|
229 |
$res .= '</div>'."\n";
|
- |
|
230 |
$res .= '<div class="BAZ_cadre_fiche_bas"> </div>'."\n";
|
- |
|
231 |
$res .= '</div>'."\n";
|
- |
|
232 |
}
|
- |
|
233 |
|
- |
|
234 |
//on ajoute les appropriations, s'il le faut
|
- |
|
235 |
if ($GLOBALS['_BAZAR_']['appropriation']==1) {
|
- |
|
236 |
$res .= '<div class="BAZ_cadre_fiche">'."\n";
|
- |
|
237 |
$res .= '<div class="BAZ_cadre_fiche_haut"> </div>'."\n";
|
- |
|
238 |
$res .= '<div class="BAZ_cadre_fiche_corps">'."\n";
|
136 |
|
- |
|
137 |
//informations complémentaires (id fiche, état publication,... )
|
239 |
|
138 |
if ($danslappli==1) {
|
- |
|
139 |
$res .= '<br /><br /><strong>'.BAZ_NUM_FICHE.':</strong> '.$GLOBALS['_BAZAR_']['id_fiche'];
|
- |
|
140 |
$res .= '<br /><strong>'.BAZ_NATURE.':</strong> '.$GLOBALS['_BAZAR_']['typeannonce'];
|
- |
|
141 |
if ($ligne['bf_statut_fiche']==1) {
|
240 |
$res .= '</div>'."\n";
|
142 |
$res .= '<br /><strong>'.BAZ_PUBLIEE.':</strong> '.BAZ_OUI;
|
- |
|
143 |
}
|
- |
|
144 |
else {
|
241 |
$res .= '<div class="BAZ_cadre_fiche_bas"> </div>'."\n";
|
145 |
$res .= '<br /><strong>'.BAZ_PUBLIEE.':</strong> '.BAZ_NON;
|
- |
|
146 |
}
|
- |
|
147 |
$res .= '<br /><strong>'.BAZ_DATE_CREATION.':</strong> '.$ligne['bf_date_creation_fiche'];
|
- |
|
148 |
$res .= '<br /><strong>'.BAZ_DATE_MAJ.':</strong> '.$ligne['bf_date_maj_fiche'];
|
- |
|
149 |
$res .='<ul><li><a href="Javascript:history.go(-1)">'.BAZ_RETOUR.'</a></li></ul>'."\n";
|
- |
|
150 |
}
|
242 |
$res .= '</div>'."\n";
|
151 |
}
|
- |
|
152 |
$res .= '</div>'."\n";
|
- |
|
153 |
$res .= '<div id="BAZ_cadre_fiche_bas">'."\n";
|
- |
|
154 |
$res .= ' </div>'."\n";
|
- |
|
- |
|
243 |
}
|
155 |
$res .= '</div>'."\n";
|
244 |
|
156 |
return $res ;
|
245 |
return $res ;
|
157 |
}
|
246 |
}
|
158 |
|
247 |
|
159 |
|
248 |
|
160 |
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
|
249 |
/** RSSversHTML () transforme un flux RSS (en XML) en page HTML
|
161 |
*
|
250 |
*
|
162 |
* On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
|
251 |
* On passe en paramètre le contenu du flux RSS, on affiche ou non la description,
|
163 |
* et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher
|
252 |
* et on choisit de format de la date à l'affichage. On a en sortie du code HTML à afficher
|
164 |
*
|
253 |
*
|
165 |
* @param string le contenu du flux RSS
|
254 |
* @param string le contenu du flux RSS
|
166 |
* @param boolean afficher ou non la description
|
255 |
* @param boolean afficher ou non la description
|
167 |
* @param string choisir le format de date: jmah (12/02/2004 12h34) jmh (12/02 12h34) jma (12/02/2004) jm (12/02) ou rien
|
256 |
* @param string choisir le format de date: jmah (12/02/2004 12h34) jmh (12/02 12h34) jma (12/02/2004) jm (12/02) ou rien
|
168 |
*
|
257 |
*
|
169 |
* @return string le code HTML
|
258 |
* @return string le code HTML
|
170 |
*/
|
259 |
*/
|
171 |
|
260 |
|
172 |
function RSSversHTML($rss, $voirdesc, $formatdate) {
|
261 |
function RSSversHTML($rss, $voirdesc, $formatdate) {
|
173 |
if ($rss!='') {
|
262 |
if ($rss!='') {
|
174 |
$res='';
|
263 |
$res='';
|
175 |
if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) {
|
264 |
if( eregi('<item>(.*)</item>', $rss, $rawitems ) ) {
|
176 |
$items = explode('<item>', $rawitems[0]);
|
265 |
$items = explode('<item>', $rawitems[0]);
|
177 |
$res.='<ul>'."\n";
|
266 |
$res.='<ul>'."\n";
|
178 |
for( $i = 0; $i < count($items)-1; $i++ ) {
|
267 |
for( $i = 0; $i < count($items)-1; $i++ ) {
|
179 |
eregi('<title>(.*)</title>',$items[$i+1], $title );
|
268 |
eregi('<title>(.*)</title>',$items[$i+1], $title );
|
180 |
eregi('<link>(.*)</link>',$items[$i+1], $url );
|
269 |
eregi('<link>(.*)</link>',$items[$i+1], $url );
|
181 |
eregi('<description>(.*)</description>',$items[$i+1], $cat);
|
270 |
eregi('<description>(.*)</description>',$items[$i+1], $cat);
|
182 |
eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date);
|
271 |
eregi('<pubDate>(.*)</pubDate>',$items[$i+1], $date);
|
183 |
$res.='<li>';
|
272 |
$res.='<li>';
|
184 |
if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';}
|
273 |
if ($formatdate=='jm') {$res.=strftime('%d.%m',strtotime($date[1])).': ';}
|
185 |
if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';}
|
274 |
if ($formatdate=='jma') {$res.=strftime('%d.%m.%Y',strtotime($date[1])).': ';}
|
186 |
if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';}
|
275 |
if ($formatdate=='jmh') {$res.=strftime('%d.%m %H:%M',strtotime($date[1])).': ';}
|
187 |
if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';}
|
276 |
if ($formatdate=='jmah') {$res.=strftime('%d.%m.%Y %H:%M',strtotime($date[1])).': ';}
|
188 |
$res.='<a href="'.preg_replace ('/&/', '&', $url[1]).'">'.$title[1].'</a><br />';
|
277 |
$res.='<a href="'.preg_replace ('/&/', '&', $url[1]).'">'.$title[1].'</a><br />';
|
189 |
if ($voirdesc) {$res.=$cat[1];}
|
278 |
if ($voirdesc) {$res.=$cat[1];}
|
190 |
$res.='</li>'."\n";
|
279 |
$res.='</li>'."\n";
|
191 |
}
|
280 |
}
|
192 |
$res.='</ul>'."\n";
|
281 |
$res.='</ul>'."\n";
|
193 |
}
|
282 |
}
|
194 |
}
|
283 |
}
|
195 |
else $res = BAZ_PAS_D_ANNONCES;
|
284 |
else $res = BAZ_PAS_D_ANNONCES;
|
196 |
return $res;
|
285 |
return $res;
|
197 |
}
|
286 |
}
|
198 |
|
287 |
|
199 |
/** gen_RSS() - générer un fichier de flux RSS par type d'annonce
|
288 |
/** gen_RSS() - générer un fichier de flux RSS par type d'annonce
|
200 |
*
|
289 |
*
|
201 |
* @param string Le type de l'annonce (laisser vide pour tout type d'annonce)
|
290 |
* @param string Le type de l'annonce (laisser vide pour tout type d'annonce)
|
202 |
* @param integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
|
291 |
* @param integer Le nombre d'annonces a regrouper dans le fichier XML (laisser vide pour toutes)
|
203 |
* @param integer L'identifiant de l'emetteur (laisser vide pour tous)
|
292 |
* @param integer L'identifiant de l'emetteur (laisser vide pour tous)
|
204 |
* @param integer L'état de validation de l'annonce (laisser 1 pour les annonces validées, 0 pour les non-validées)
|
293 |
* @param integer L'état de validation de l'annonce (laisser 1 pour les annonces validées, 0 pour les non-validées)
|
205 |
* @param string La requète SQL personnalisée
|
294 |
* @param string La requète SQL personnalisée
|
206 |
*
|
295 |
*
|
207 |
* @return string Le code du flux RSS
|
296 |
* @return string Le code du flux RSS
|
208 |
*/
|
297 |
*/
|
209 |
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='') {
|
298 |
function gen_RSS($typeannonce='', $nbitem='', $emetteur='', $valide=1, $requeteSQL='') {
|
210 |
// génération de la requete MySQL personnalisée
|
299 |
// génération de la requete MySQL personnalisée
|
211 |
$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bn_label_nature FROM bazar_fiche, bazar_nature';
|
300 |
$requete = 'SELECT DISTINCT bf_id_fiche, bf_titre, bf_date_debut_validite_fiche, bn_label_nature FROM bazar_fiche, bazar_nature';
|
212 |
$requete .= ' WHERE bf_statut_fiche='.$valide;
|
301 |
$requete .= ' WHERE bf_statut_fiche='.$valide;
|
213 |
$nomflux=BAZ_DERNIERE_ACTU;
|
302 |
$nomflux=BAZ_DERNIERE_ACTU;
|
214 |
if (($typeannonce!='')and($typeannonce!='toutes')) {
|
303 |
if (($typeannonce!='')and($typeannonce!='toutes')) {
|
215 |
$requete .= ' AND bn_label_nature="'.$typeannonce.'"';
|
304 |
$requete .= ' AND bn_label_nature="'.$typeannonce.'"';
|
216 |
//le nom du flux devient le type d'annonce
|
305 |
//le nom du flux devient le type d'annonce
|
217 |
$nomflux = $typeannonce;
|
306 |
$nomflux = $typeannonce;
|
218 |
}
|
307 |
}
|
219 |
if ($valide!=0) $requete .= ' AND bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() AND bn_id_nature=bf_ce_nature';
|
308 |
if ($valide!=0) $requete .= ' AND bf_date_debut_validite_fiche<=NOW() AND bf_date_fin_validite_fiche>=NOW() AND bn_id_nature=bf_ce_nature';
|
220 |
else $nomflux .= BAZ_A_MODERER;
|
309 |
else $nomflux .= BAZ_A_MODERER;
|
221 |
if (($emetteur!='')and($emetteur!='tous')) {
|
310 |
if (($emetteur!='')and($emetteur!='tous')) {
|
222 |
$requete .= ' AND bf_ce_utilisateur='.$emetteur;
|
311 |
$requete .= ' AND bf_ce_utilisateur='.$emetteur;
|
223 |
//requete pour afficher le nom de la structure
|
312 |
//requete pour afficher le nom de la structure
|
224 |
$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
|
313 |
$requetenom = 'SELECT '.BAZ_CHAMPS_NOM.', '.BAZ_CHAMPS_PRENOM.' FROM '.BAZ_ANNUAIRE.' WHERE '.BAZ_CHAMPS_ID.'='.$emetteur;
|
225 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
|
314 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requetenom) ;
|
226 |
if (DB::isError($resultat)) {
|
315 |
if (DB::isError($resultat)) {
|
227 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
316 |
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
|
228 |
}
|
317 |
}
|
229 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
318 |
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
|
230 |
$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
|
319 |
$nomflux .= ' ('.$ligne[BAZ_CHAMPS_NOM].' '.$ligne[BAZ_CHAMPS_PRENOM].')';
|
231 |
}
|
320 |
}
|
232 |
if ($requeteSQL!='') $requete .= ' AND ('.$requeteSQL.')';
|
321 |
if ($requeteSQL!='') $requete .= ' AND ('.$requeteSQL.')';
|
233 |
$requete .= ' ORDER BY bf_date_debut_validite_fiche, bf_date_fin_validite_fiche, bf_date_maj_fiche DESC';
|
322 |
$requete .= ' ORDER BY bf_date_debut_validite_fiche, bf_date_fin_validite_fiche, bf_date_maj_fiche DESC';
|
234 |
if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
|
323 |
if ($nbitem!='') {$requete .= ' LIMIT 0,'.$nbitem;}
|
235 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
324 |
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
|
236 |
if (DB::isError($resultat)) {
|
325 |
if (DB::isError($resultat)) {
|
237 |
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS["db"]->getDebugInfo()) ;
|
326 |
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS["db"]->getDebugInfo()) ;
|
238 |
}
|
327 |
}
|
239 |
// En-tête du flux RSS version 2.0
|
328 |
// En-tête du flux RSS version 2.0
|
240 |
$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n".'<rss version="2.0">'."\n";
|
329 |
$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>'."\n".'<rss version="2.0">'."\n";
|
241 |
$xml .= '<channel>'."\n".'<title>'.$nomflux.'</title>'."\n".'<link>'.BAZ_RSS_ADRESSESITE.'</link>'."\n";
|
330 |
$xml .= '<channel>'."\n".'<title>'.$nomflux.'</title>'."\n".'<link>'.BAZ_RSS_ADRESSESITE.'</link>'."\n";
|
242 |
$xml .= '<description>'.BAZ_RSS_DESCRIPTIONSITE.'</description>'."\n".'<language>fr-FR</language>'."\n".
|
331 |
$xml .= '<description>'.BAZ_RSS_DESCRIPTIONSITE.'</description>'."\n".'<language>fr-FR</language>'."\n".
|
243 |
'<copyright>Copyright 2005 '.BAZ_RSS_NOMSITE.'</copyright>'."\n";
|
332 |
'<copyright>Copyright 2005 '.BAZ_RSS_NOMSITE.'</copyright>'."\n";
|
244 |
// Ajout de la date actuelle de publication (suivant la DTD RSS)
|
333 |
// Ajout de la date actuelle de publication (suivant la DTD RSS)
|
245 |
$xml .= '<lastBuildDate>'.strftime('%d %b %Y %H:%M:%S GMT').'</lastBuildDate>'."\n";
|
334 |
$xml .= '<lastBuildDate>'.strftime('%d %b %Y %H:%M:%S GMT').'</lastBuildDate>'."\n";
|
246 |
// En-tête suite et fin
|
335 |
// En-tête suite et fin
|
247 |
$xml .= '<docs>http://www.stervinou.com/projets/rss/</docs>'."\n".'<category>'.BAZ_RSS_CATEGORIE.'</category>'."\n".
|
336 |
$xml .= '<docs>http://www.stervinou.com/projets/rss/</docs>'."\n".'<category>'.BAZ_RSS_CATEGORIE.'</category>'."\n".
|
248 |
'<managingEditor>'.BAZ_RSS_MANAGINGEDITOR.'</managingEditor>'."\n".'<webMaster>'.BAZ_RSS_WEBMASTER.'</webMaster>'."\n";
|
337 |
'<managingEditor>'.BAZ_RSS_MANAGINGEDITOR.'</managingEditor>'."\n".'<webMaster>'.BAZ_RSS_WEBMASTER.'</webMaster>'."\n";
|
249 |
$xml .= '<ttl>60</ttl>'."\n".'<image>'."\n".'<title>'.BAZ_RSS_NOMSITE.'</title>'."\n".'<url>'.BAZ_RSS_LOGOSITE.'</url>'."\n".
|
338 |
$xml .= '<ttl>60</ttl>'."\n".'<image>'."\n".'<title>'.BAZ_RSS_NOMSITE.'</title>'."\n".'<url>'.BAZ_RSS_LOGOSITE.'</url>'."\n".
|
250 |
'<link>'.BAZ_RSS_ADRESSESITE.'</link>'."\n".'</image>'."\n";
|
339 |
'<link>'.BAZ_RSS_ADRESSESITE.'</link>'."\n".'</image>'."\n";
|
251 |
if ($resultat->numRows()>0) {
|
340 |
if ($resultat->numRows()>0) {
|
252 |
// Creation des items : titre + lien + description + date de publication
|
341 |
// Creation des items : titre + lien + description + date de publication
|
253 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
342 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
|
254 |
$xml .= '<item>'."\n";
|
343 |
$xml .= '<item>'."\n";
|
255 |
$xml .= '<title>'.$ligne['bf_titre'].'</title>'."\n";
|
344 |
$xml .= '<title>'.$ligne['bf_titre'].'</title>'."\n";
|
256 |
$lien=$GLOBALS['_BAZAR_']['url'];
|
345 |
$lien=$GLOBALS['_BAZAR_']['url'];
|
257 |
$lien->addQueryString('action', BAZ_VOIR_FICHE);
|
346 |
$lien->addQueryString('action', BAZ_VOIR_FICHE);
|
258 |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
|
347 |
$lien->addQueryString('id_fiche', $ligne['bf_id_fiche']);
|
259 |
$xml .= '<link>'.str_replace ('&', '&', $lien->getURL()).'</link>'."\n";
|
348 |
$xml .= '<link>'.str_replace ('&', '&', $lien->getURL()).'</link>'."\n";
|
260 |
$xml .= '<description>'."\n".'<![CDATA['.baz_voir_fiche(0,$ligne['bf_id_fiche']).']]>'."\n".'</description>'."\n";
|
349 |
$xml .= '<description>'."\n".'<![CDATA['.baz_voir_fiche(0,$ligne['bf_id_fiche']).']]>'."\n".'</description>'."\n";
|
261 |
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime($ligne['bf_date_debut_validite_fiche'])).'</pubDate>'."\n";
|
350 |
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime($ligne['bf_date_debut_validite_fiche'])).'</pubDate>'."\n";
|
262 |
$xml .= '</item>'."\n";
|
351 |
$xml .= '</item>'."\n";
|
263 |
}
|
352 |
}
|
264 |
}
|
353 |
}
|
265 |
else {//pas d'annonces
|
354 |
else {//pas d'annonces
|
266 |
$xml .= '<item>'."\n";
|
355 |
$xml .= '<item>'."\n";
|
267 |
$xml .= '<title> </title>'."\n";
|
356 |
$xml .= '<title> </title>'."\n";
|
268 |
$xml .= '<link>http://test.educ-envir.org</link>'."\n";
|
357 |
$xml .= '<link>http://test.educ-envir.org</link>'."\n";
|
269 |
$xml .= '<description> </description>'."\n";
|
358 |
$xml .= '<description> </description>'."\n";
|
270 |
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004')).'</pubDate>'."\n";
|
359 |
$xml .= '<pubDate>'.strftime('%d %b %Y %H:%M:%S GMT',strtotime('12/12/2004')).'</pubDate>'."\n";
|
271 |
$xml .= '</item>'."\n";
|
360 |
$xml .= '</item>'."\n";
|
272 |
}
|
361 |
}
|
273 |
$xml .= '</channel>'."\n".'</rss>'."\n";
|
362 |
$xml .= '</channel>'."\n".'</rss>'."\n";
|
274 |
return $xml;
|
363 |
return $xml;
|
275 |
}
|
364 |
}
|
276 |
|
365 |
|
277 |
|
366 |
|
278 |
/** baz_liste() Formate la liste de toutes les annonces actuelles
|
367 |
/** baz_liste() Formate la liste de toutes les annonces actuelles
|
279 |
*
|
368 |
*
|
280 |
* @return string le code HTML à afficher
|
369 |
* @return string le code HTML à afficher
|
281 |
*/
|
370 |
*/
|
282 |
function baz_liste($typeannonce='toutes') {
|
371 |
function baz_liste($typeannonce='toutes') {
|
283 |
if ($typeannonce=='toutes') $res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2>'."\n";
|
372 |
if ($typeannonce=='toutes') $res= '<h2>'.BAZ_TOUTES_LES_ANNONCES.'</h2>'."\n";
|
284 |
else $res= '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.$typeannonce.'</h2>'."\n";
|
373 |
else $res= '<h2>'.BAZ_TOUTES_LES_ANNONCES_DE_TYPE.$typeannonce.'</h2>'."\n";
|
285 |
$res.=RSSversHTML(gen_RSS($typeannonce, '', '', 1, ''), 0, 'jm') ;
|
374 |
$res.=RSSversHTML(gen_RSS($typeannonce, '', '', 1, ''), 0, 'jm') ;
|
286 |
return $res;
|
375 |
return $res;
|
287 |
}
|
376 |
}
|
288 |
|
377 |
|
289 |
?>
|
378 |
?>
|