diff --git a/content/article.html b/content/article.html index d361bf7..b5a2133 100644 --- a/content/article.html +++ b/content/article.html @@ -2,24 +2,16 @@ #SET{id_grpe_tags, #ID_GROUPE} #SET{grpes_importants,#GET{grpes_importants}|push{#ID_GROUPE}} -#SET{id_mot_statut_bien,0} - - - #SET{id_mot_statut_bien, #ID_MOT} - - - - [(#AUTORISER{modifier, article, #ID_ARTICLE}) - [(#INFO_STATUT{article,#ID_ARTICLE}|=={publie}|non) - Éditer - ] - ] - - [(#INCLURE{fond=inclure/bouton_une,id_article=#ENV{id_article}})] - +
+ + [(#AUTORISER{modifier, article, #ID_ARTICLE}) + + ]

#TITRE

@@ -49,7 +41,7 @@ +
- diff --git a/content/editer_article.html b/content/editer_article.html index 01e22c8..b4cf94d 100644 --- a/content/editer_article.html +++ b/content/editer_article.html @@ -3,9 +3,7 @@
[(#ENV{id_article}|?{ - [(#INCLURE{fond=inclure/bouton_supprimer,id_article=#ENV{id_article}})] - [(#INCLURE{fond=inclure/bouton_une,id_article=#ENV{id_article}})] -

Éditer l'article n°[(#ENV{id_article})]

+

Éditer un article

,

Rédiger un article

})] @@ -14,7 +12,7 @@ [(#ENV{id_article}|oui) [(#AUTORISER{modifier, article, #ENV{id_article}}|?{
- [(#FORMULAIRE_EDITER_ARTICLE{#ENV{id_article}})]
+ [(#FORMULAIRE_EDITER_POST{#ENV{id_article}})]
,
Votre compte ne fait pas partie des auteurs autorisés à modifier cet article.
@@ -23,7 +21,7 @@ [(#ENV{id_article}|non) [(#AUTORISER{creer, article}|?{
- [(#FORMULAIRE_EDITER_ARTICLE)] + [(#FORMULAIRE_EDITER_POST)]
,
Votre compte n'a pas les droits suffisants pour créer un article.
@@ -37,7 +35,7 @@

ou

- [(#FORMULAIRE_INSCRIPTION{#SELF})] + [(#FORMULAIRE_INSCRIPTION{6forum,0,#SELF})]
] diff --git a/content/editer_groupe.html b/content/editer_groupe.html new file mode 100644 index 0000000..c26adf6 --- /dev/null +++ b/content/editer_groupe.html @@ -0,0 +1,44 @@ +
+ +
+ + [(#ENV{id_article}|?{ +

Mettre à jour un groupe

+ , +

Créer un nouveau groupe

+ })] + + [(#SESSION{id_auteur}|oui) + [(#ENV{id_article}|oui) + [(#AUTORISER{modifier, article, #ENV{id_article}}|?{ +
+ [(#FORMULAIRE_EDITER_GROUPE{#ENV{id_article}})]
+
+ , +
Votre compte ne fait pas partie des auteurs autorisés à modifier cet article.
+ })] + ] + [(#ENV{id_article}|non) + [(#AUTORISER{creer, article}|?{ +
+ [(#FORMULAIRE_EDITER_GROUPE)] +
+ , +
Votre compte n'a pas les droits suffisants pour créer un article.
+ })] + ] + ] + [(#SESSION{id_auteur}|non) +
+
+ [(#FORMULAIRE_LOGIN{#SELF})] +
+

ou

+
+ [(#FORMULAIRE_INSCRIPTION{#SELF})] +
+
+ ] +
+ +
diff --git a/css/_sq_balint.scss b/css/_sq_balint.scss index b3c12f9..f2843e3 100644 --- a/css/_sq_balint.scss +++ b/css/_sq_balint.scss @@ -29,6 +29,12 @@ a, a:hover { color: $couleur-liens; } +/* images */ +img{ + max-width: 100%; + height: auto; +} + /* body */ body{ background: $bg-body; @@ -60,8 +66,6 @@ body{ width: 200px; transition: all 1s ease; img{ - width: 100%; - height: auto; transition: all 1s ease; } } @@ -199,13 +203,6 @@ body{ position: relative; } - .photo_article{ - img{ - width: 100%; - height: auto; - } - } - .bloc-textes{ padding: 1.5rem; flex-grow: 1; @@ -227,9 +224,6 @@ body{ font-weight: 700; padding: 1rem; } - img{ - max-width: 100%; - } .formulaire_nous_contacter{ background: none; input, textarea{ @@ -396,32 +390,50 @@ body{ .asso-image{ margin: 1.5rem 0; - img{ - width: 100%; - height: auto; - } } /**********************************************************************/ /**************** TOUS LES FORMULAIRES DE CONNEXION *******************/ /**********************************************************************/ -.boutons .submit { - font-size: 1.5rem; - line-height: 1rem; - padding: 1rem; - border: solid 1px $light; - border-radius: 0.5rem; - background-color: #4f56cd; - color: $light; - &:hover{ - background-color: #7276ee; - cursor: pointer; +.formulaire_spip .boutons, .boutons{ + margin: 1rem 0; + .btn{ + font-size: 1.2rem; + line-height: 1rem; + padding: 1rem; + border: solid 1px $light; + border-radius: 0.5rem; + margin-left: 1rem; + background: $dark; + color: $light; + &:hover{ + color: white; + } } + &.a-droite{ + display: flex; + flex-direction: row; + justify-content: flex-end; + } + .btn_supprimer{ + background: none; + color: $red; + border: solid 1px $red; + &:hover{ + background: rgb(214, 72, 72) + } + } + .submit { + background-color: #4f56cd; + color: $light; + &:hover{ + background-color: #7276ee; + cursor: pointer; + } + } } -.btn.pull-right, .une_OK { - margin-left: 2rem; -} + .formulaire_spip{ background: $fond-formulaires; @@ -439,7 +451,7 @@ body{ /**********************************************************************/ /*************** FORMULAIRE DE SAISIE D'ARTICLE ***********************/ /**********************************************************************/ -.formulaire_editer_article { +.formulaire_editer_post { clear: none; .resume textarea { min-height: 25rem; } .upload_vignette { @@ -451,27 +463,44 @@ body{ } } } - - - .photo_bien { + .photo_article { justify-content: left; + display: flex; .une_photo { margin-right: 1rem; display: flex; flex-direction: column; max-width: 320px; } + .btn_poubelle{ + color: red; + :hover{ + color: #ee9e9e; + } + } + .btn_une{ + color: black; + :hover{ + color: grey; + } + } .boutons_actions { width: 100%; display: flex; justify-content: space-around; - + background-color: #e0e0e0; i.green { - padding: .6rem 1.5rem; + padding: .6rem; + color: rgb(28, 158, 28); } a { margin: 0; } + .premier-plan{ + display: flex; + flex-direction: row; + align-items: center; + } } } legend { @@ -479,6 +508,22 @@ body{ } } +.photo-premier-plan{ + margin-bottom: 1.5rem; + border: solid 1px #BBB; +} + +.container fieldset { + clear: none; + margin-bottom: 1.5rem; + border: solid 1px #BBB; + padding: 1.5rem; + background-color:#FCFCFC; + &> div{ + margin-bottom: 1.2rem; + } +} + /**********************************************************************/ /****************************** spip_admin ****************************/ /**********************************************************************/ diff --git a/css/mon_site.css b/css/mon_site.css index 1c950a3..8826171 100644 --- a/css/mon_site.css +++ b/css/mon_site.css @@ -11858,6 +11858,12 @@ a, a:hover { color: #dc7544; } +/* images */ +img { + max-width: 100%; + height: auto; +} + /* body */ body { background: url("../images/bg-web.jpg"); @@ -11895,8 +11901,6 @@ body { } #menu-principal .navbar-brand img { - width: 100%; - height: auto; -webkit-transition: all 1s ease; transition: all 1s ease; } @@ -12052,11 +12056,6 @@ body { position: relative; } -.liste-articles .photo_article img { - width: 100%; - height: auto; -} - .liste-articles .bloc-textes { padding: 1.5rem; -webkit-box-flex: 1; @@ -12082,10 +12081,6 @@ body { padding: 1rem; } -#nous-contacter img { - max-width: 100%; -} - #nous-contacter .formulaire_nous_contacter { background: none; } @@ -12293,33 +12288,58 @@ body { margin: 1.5rem 0; } -.asso-image img { - width: 100%; - height: auto; -} - /**********************************************************************/ /**************** TOUS LES FORMULAIRES DE CONNEXION *******************/ /**********************************************************************/ -.boutons .submit { - font-size: 1.5rem; +.formulaire_spip .boutons, .boutons { + margin: 1rem 0; +} + +.formulaire_spip .boutons .btn, .boutons .btn { + font-size: 1.2rem; line-height: 1rem; padding: 1rem; border: solid 1px #f8f9fa; border-radius: 0.5rem; + margin-left: 1rem; + background: #595959; + color: #f8f9fa; +} + +.formulaire_spip .boutons .btn:hover, .boutons .btn:hover { + color: white; +} + +.formulaire_spip .boutons.a-droite, .boutons.a-droite { + display: -webkit-box; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + flex-direction: row; + -webkit-box-pack: end; + justify-content: flex-end; +} + +.formulaire_spip .boutons .btn_supprimer, .boutons .btn_supprimer { + background: none; + color: #dc3545; + border: solid 1px #dc3545; +} + +.formulaire_spip .boutons .btn_supprimer:hover, .boutons .btn_supprimer:hover { + background: #d64848; +} + +.formulaire_spip .boutons .submit, .boutons .submit { background-color: #4f56cd; color: #f8f9fa; } -.boutons .submit:hover { +.formulaire_spip .boutons .submit:hover, .boutons .submit:hover { background-color: #7276ee; cursor: pointer; } -.btn.pull-right, .une_OK { - margin-left: 2rem; -} - .formulaire_spip { background: rgba(255, 255, 255, 0.8); border-radius: 0.5rem; @@ -12338,34 +12358,36 @@ body { /**********************************************************************/ /*************** FORMULAIRE DE SAISIE D'ARTICLE ***********************/ /**********************************************************************/ -.formulaire_editer_article { +.formulaire_editer_post { clear: none; } -.formulaire_editer_article .resume textarea { +.formulaire_editer_post .resume textarea { min-height: 25rem; } -.formulaire_editer_article .upload_vignette label { +.formulaire_editer_post .upload_vignette label { display: block; } -.formulaire_editer_article .upload_vignette .ajaxbloc { +.formulaire_editer_post .upload_vignette .ajaxbloc { clear: both; } @media (min-width: 992px) { - .formulaire_editer_article .upload_vignette .ajaxbloc { + .formulaire_editer_post .upload_vignette .ajaxbloc { clear: initial; } } -.formulaire_editer_article .photo_bien { +.formulaire_editer_post .photo_article { -webkit-box-pack: left; justify-content: left; + display: -webkit-box; + display: flex; } -.formulaire_editer_article .photo_bien .une_photo { +.formulaire_editer_post .photo_article .une_photo { margin-right: 1rem; display: -webkit-box; display: flex; @@ -12375,25 +12397,70 @@ body { max-width: 320px; } -.formulaire_editer_article .photo_bien .boutons_actions { +.formulaire_editer_post .photo_article .btn_poubelle { + color: red; +} + +.formulaire_editer_post .photo_article .btn_poubelle :hover { + color: #ee9e9e; +} + +.formulaire_editer_post .photo_article .btn_une { + color: black; +} + +.formulaire_editer_post .photo_article .btn_une :hover { + color: grey; +} + +.formulaire_editer_post .photo_article .boutons_actions { width: 100%; display: -webkit-box; display: flex; justify-content: space-around; + background-color: #e0e0e0; } -.formulaire_editer_article .photo_bien .boutons_actions i.green { - padding: .6rem 1.5rem; +.formulaire_editer_post .photo_article .boutons_actions i.green { + padding: .6rem; + color: #1c9e1c; } -.formulaire_editer_article .photo_bien .boutons_actions a { +.formulaire_editer_post .photo_article .boutons_actions a { margin: 0; } -.formulaire_editer_article legend { +.formulaire_editer_post .photo_article .boutons_actions .premier-plan { + display: -webkit-box; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + flex-direction: row; + -webkit-box-align: center; + align-items: center; +} + +.formulaire_editer_post legend { width: auto; } +.photo-premier-plan { + margin-bottom: 1.5rem; + border: solid 1px #BBB; +} + +.container fieldset { + clear: none; + margin-bottom: 1.5rem; + border: solid 1px #BBB; + padding: 1.5rem; + background-color: #FCFCFC; +} + +.container fieldset > div { + margin-bottom: 1.2rem; +} + /**********************************************************************/ /****************************** spip_admin ****************************/ /**********************************************************************/ diff --git a/footer/dist.html b/footer/dist.html index 47a0d54..614a1cd 100644 --- a/footer/dist.html +++ b/footer/dist.html @@ -19,56 +19,69 @@ -
- + diff --git a/formulaires/editer_groupe.html b/formulaires/editer_groupe.html new file mode 100644 index 0000000..46f0c9c --- /dev/null +++ b/formulaires/editer_groupe.html @@ -0,0 +1,164 @@ + +
+ +
+ + #ACTION_FORMULAIRE{#ENV{action}} + +
+ [(#ENV{id_article}|>{0}|oui) + [(#INCLURE{fond=inclure/bouton_supprimer,id_article=#ENV{id_article}})] + ] + + Voir la page du groupe +
+ + [

(#ENV*{message_erreur})

] + [

(#ENV*{message_ok})

] + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + [(#REM) champ_1 en attente +
+ + + OU + +
+ ] + [(#REM) champ_2 en attente +
+ + + OU + +
+ ] + [(#REM) les champs non utilisés +
+ + +
+ +
+ + +
+ +
+ + +
+ ] +
+ +
+ Photos + +
+ +
+ +
+ + [(#REM) +
+ Localisation + + [(#SAISIE{carte,editer_gis_oui,env})] + + [(#SAISIE{input,lat, + label=<:gis:lat:>, + defaut=#ENV{lat,#CONFIG{gis/lat,0}}, + obligatoire=oui})] + [(#SAISIE{input,lon, + label=<:gis:lon:>, + defaut=#ENV{lon,#CONFIG{gis/lon,0}}, + obligatoire=oui})] +
+ ] +
+ + +
+ + [(#SET{T_id_auteurs, #ENV{T_id_auteurs}|sinon{#ARRAY}})] + +
+ Responsables + + +
+ +
+ +
+ +
+
+
+ + +
+ + + + + + diff --git a/formulaires/editer_groupe.php b/formulaires/editer_groupe.php new file mode 100644 index 0000000..f6415b9 --- /dev/null +++ b/formulaires/editer_groupe.php @@ -0,0 +1,273 @@ + 'image_web','taille_max'=>'2000','largeur_max'=>'2048','hauteur_max'=>'2048']; + $bigform($options,$erreurs); + + return $erreurs; +} + +function formulaires_editer_groupe_traiter_dist($id_article=0, $redirect=''){ + $new = $id_article; + if (!intval($id_article)) { + + $id_rubrique = intval(_request('id_rubrique')); + include_spip('action/editer_article'); + $set = array( + 'statut' => 'publie' + ); + $id_article = article_inserer($id_rubrique,$set); + } + + // enregistrement de l'image + if (!intval($new)) { + $where = array( + 'objet="article"', + 'id_objet='.intval(session_get('id_auteur')) * -1 + ); + sql_updateq('spip_documents_liens',array('id_objet' => intval($id_article)), $where); + } + + // maj de l'article + $set = array( + 'titre' => _request('titre'), + 'texte' => _request('texte'), + 'soustitre' => _request('soustitre'), + 'date' => date("Y-m-d H:i:s"), +// 'champ_1' => _request('champ_1'), +// 'champ_2' => _request('champ_2'), + 'descriptif' => _request('descriptif'), +// 'chapo' => _request('chapo'), + 'surtitre' => _request('surtitre') + ); + sql_updateq('spip_articles',$set,'id_article='.intval($id_article)); + + // maj rubrique si besoin + $id_rubrique = intval(_request('id_rubrique')); + $id_rub = sql_getfetsel('id_rubrique', 'spip_articles', 'id_article='.$id_article); + if ($id_rub != $id_rubrique) { + include_spip('action/editer_article'); + article_instituer($id_article, array('id_parent' => $id_rubrique)); + } + + // maj association article -> auteurs + include_spip('action/editer_liens'); + $where = array( + 'id_objet='.intval($id_article), + 'objet="article"', + ); + $ids_auteurs = sql_allfetsel('id_auteur', 'spip_auteurs_liens', $where); + $ids_auteurs = array_column($ids_auteurs, 'id_auteur'); + $Tauteurs = _request('Tauteurs'); + + if (count($Tauteurs)) { + $associer = array_diff($Tauteurs, $ids_auteurs); + $dissocier = array_diff($ids_auteurs, $Tauteurs); + + objet_associer( array('auteur' => $associer),array('article' => intval($id_article) )); + objet_dissocier( array('auteur' => $dissocier) , array('article' =>intval($id_article) )); + } + + // maj des mots fermes + $T_id_groupe = sql_allfetsel('id_groupe','spip_groupes_mots','grigri!="tags"'); + $T_id_groupe = array_column($T_id_groupe,'id_groupe'); + + foreach ($T_id_groupe as $id_groupe) { + $from = array( + 'spip_mots as M', + 'spip_mots_liens as L' + ); + $where = array( + 'L.id_objet='.intval($id_article), + 'L.objet="article"', + 'L.id_mot=M.id_mot', + 'M.id_groupe='.$id_groupe + ); + + $ids_mots = sql_allfetsel('M.id_mot AS id_mot', $from, $where); + $ids_mots = array_column($ids_mots, 'id_mot'); + $coches = _request('id_groupe_'.$id_groupe); + if (count($coches)) { + $associer = array_diff($coches, $ids_mots); + $dissocier = array_diff($ids_mots, $coches); + + objet_associer(array('mot' => $associer),array('article' => intval($id_article))); + objet_dissocier(array('mot' => $dissocier), array('article' => intval($id_article))); + } + } + + include_spip('action/editer_objet'); + // GIS + $lat_def = lire_config('gis/lat'); + $lon_def = lire_config('gis/lon'); + $lat = _request('lat'); + $lon = _request('lon'); + // 1. recup id_gis si present + $from = array( + 'spip_gis as G', + 'spip_gis_liens as L', + 'spip_articles as A' + ); + $where = array( + 'L.id_objet='.intval($id_article), + 'L.objet="article"', + 'L.id_gis=G.id_gis' + ); + $id_gis = sql_getfetsel('G.id_gis', $from, $where); + $set = array( + 'titre' => _request('titre'), + 'lat' => $lat, + 'lon' => $lon, + 'zoom' => 15 + ); + + if (!$id_gis) { + $id_gis = sql_insertq('spip_gis',$set); + $set = array( + 'id_gis' => $id_gis, + 'id_objet' => intval($id_article), + 'objet' => 'article' + ); + sql_insertq('spip_gis_liens',$set); + } else { + if ($lat !== $lat_def and $lon !== $lon_def) { + objet_modifier('gis', $id_gis, $set); + } + } + + // SEO title et description: créer ou mettre à jour, y compris si les valeurs postées sont vides (= vidage du champ) + $id_article = intval($id_article); + $seo_titre = _request('seo_titre'); + $set = array('id_objet' => $id_article, 'objet' => 'article', 'meta_name' => 'title', 'meta_content' => $seo_titre); + $where = array("id_objet = $id_article", "objet = 'article'", "meta_name = 'title'"); + $res = sql_getfetsel('meta_content', 'spip_seo', $where); + if ((!$res AND $seo_titre != '') + OR ($res != $seo_titre)) { + sql_replace('spip_seo', $set, $where); + } + $seo_descriptif = _request('seo_descriptif'); + $set = array('id_objet' => $id_article, 'objet' => 'article', 'meta_name' => 'description', 'meta_content' => $seo_descriptif); + $where = array("id_objet = $id_article", "objet = 'article'", "meta_name = 'description'"); + $res = sql_getfetsel('meta_content', 'spip_seo', $where); + if ((!$res AND $seo_descriptif != '') + OR ($res != $seo_descriptif)) { + sql_replace('spip_seo', $set, $where); + } + + include_spip('inc/invalideur'); + suivre_invalideur("id='id_article/1'"); + + $retour = array(); + $retour['message_ok'] = "Le groupe est bien enregistré."; + + //$retour['redirect'] = 'spip.php?page=article&id_article='.$id_article; + + $bigform = charger_fonction('bigform_traiter','inc'); + $bigform($id_article, 'article'); + + + return $retour; +} diff --git a/formulaires/editer_post.html b/formulaires/editer_post.html new file mode 100644 index 0000000..1928594 --- /dev/null +++ b/formulaires/editer_post.html @@ -0,0 +1,197 @@ + +
+ +
+ + #ACTION_FORMULAIRE{#ENV{action}} +
+ [(#ENV{id_article}|>{0}|oui) + [(#INCLURE{fond=inclure/bouton_supprimer,id_article=#ENV{id_article}})] + ] + + Voir l'article +
+ + [

(#ENV*{message_erreur})

] + [

(#ENV*{message_ok})

] + +
+
+
+ Texte +
+ + +
+ +
+ + +
+ +
+ + +
+ + [(#SAISIE{input,date_agenda,label=Date affichée dans l'agenda,obligatoire=non})] + +
+ + +
+ + [(#REM) champ_1 en attente +
+ + + OU + +
+ ] + [(#REM) champ_2 en attente +
+ + + OU + +
+ ] + [(#REM) les champs non utilisés +
+ + +
+ +
+ + +
+ +
+ + +
+ ] +
+ +
+ Photos + +
+ +
+ +
+ + [(#REM) +
+ Localisation + + [(#SAISIE{carte,editer_gis_oui,env})] + + [(#SAISIE{input,lat, + label=<:gis:lat:>, + defaut=#ENV{lat,#CONFIG{gis/lat,0}}, + obligatoire=oui})] + [(#SAISIE{input,lon, + label=<:gis:lon:>, + defaut=#ENV{lon,#CONFIG{gis/lon,0}}, + obligatoire=oui})] +
+ ] +
+ + +
+ +
+ [(#FICHIER|image_recadre{320:180,-,focus}|image_reduire{320,180})] +
+ + +
+ Statut + +
+ +
+ Groupe + + +
+ + +
+ Emplacements + +
+ +
+ +
+
+ +
+ +
+ +
+ +
+
+ + +
+ + + + + + diff --git a/formulaires/editer_post.php b/formulaires/editer_post.php new file mode 100644 index 0000000..391ad08 --- /dev/null +++ b/formulaires/editer_post.php @@ -0,0 +1,260 @@ + 'image_web','taille_max'=>'2000','largeur_max'=>'2048','hauteur_max'=>'2048']; + $bigform($options,$erreurs); + + return $erreurs; +} + +function formulaires_editer_post_traiter_dist($id_article = 0, $redirect = ''){ + $new = $id_article; + + $id_rubrique = lire_config('balint/id_rub_articles'); + + if (!intval($id_article)) { + + include_spip('action/editer_article'); + $set = array( + 'statut' => 'prepa' + ); + $id_article = article_inserer($id_rubrique,$set); + } + + // enregistrement de l'image + if (!intval($new)) { + $where = array( + 'objet="article"', + 'id_objet='.intval(session_get('id_auteur')) * -1 + ); + sql_updateq('spip_documents_liens',array('id_objet' => intval($id_article)), $where); + } + + // maj de l'article + $set = array( + 'titre' => _request('titre'), + 'texte' => _request('texte'), + 'soustitre' => _request('soustitre'), + 'date' => date("Y-m-d H:i:s"), + 'descriptif' => _request('descriptif'), + 'date_agenda' => _request('date_agenda'), + 'statut' => _request('statut'), + 'id_groupe' => _request('id_groupe') +// 'champ_1' => _request('champ_1'), +// 'champ_2' => _request('champ_2'), +// 'chapo' => _request('chapo'), +// 'surtitre' => _request('surtitre') + ); + sql_updateq('spip_articles',$set,'id_article='.intval($id_article)); + + // maj association article -> auteurs + include_spip('action/editer_liens'); + $where = array( + 'id_objet='.intval($id_article), + 'objet="article"', + ); + $ids_auteurs = sql_allfetsel('id_auteur', 'spip_auteurs_liens', $where); + $ids_auteurs = array_column($ids_auteurs, 'id_auteur'); + $Tauteurs = _request('Tauteurs'); + if (count($Tauteurs)) { + $associer = array_diff($Tauteurs, $ids_auteurs); + $dissocier = array_diff($ids_auteurs, $Tauteurs); + + objet_associer( array('auteur' => $associer),array('article' => intval($id_article) )); + objet_dissocier( array('auteur' => $dissocier) , array('article' =>intval($id_article) )); + } + + // maj des mots fermes + $T_id_groupe = sql_allfetsel('id_groupe','spip_groupes_mots','grigri!="tags"'); + $T_id_groupe = array_column($T_id_groupe,'id_groupe'); + + foreach ($T_id_groupe as $id_groupe) { + $from = array( + 'spip_mots as M', + 'spip_mots_liens as L' + ); + $where = array( + 'L.id_objet='.intval($id_article), + 'L.objet="article"', + 'L.id_mot=M.id_mot', + 'M.id_groupe='.$id_groupe + ); + + $ids_mots = sql_allfetsel('M.id_mot AS id_mot', $from, $where); + $ids_mots = array_column($ids_mots, 'id_mot'); + $coches = _request('id_groupe_'.$id_groupe); + if (count($coches)) { + $associer = array_diff($coches, $ids_mots); + $dissocier = array_diff($ids_mots, $coches); + + objet_associer(array('mot' => $associer),array('article' => intval($id_article))); + objet_dissocier(array('mot' => $dissocier), array('article' => intval($id_article))); + } + } + + include_spip('action/editer_objet'); + // GIS + $lat_def = lire_config('gis/lat'); + $lon_def = lire_config('gis/lon'); + $lat = _request('lat'); + $lon = _request('lon'); + // 1. recup id_gis si present + $from = array( + 'spip_gis as G', + 'spip_gis_liens as L', + 'spip_articles as A' + ); + $where = array( + 'L.id_objet='.intval($id_article), + 'L.objet="article"', + 'L.id_gis=G.id_gis' + ); + $id_gis = sql_getfetsel('G.id_gis', $from, $where); + $set = array( + 'titre' => _request('titre'), + 'lat' => $lat, + 'lon' => $lon, + 'zoom' => 15 + ); + + if (!$id_gis) { + $id_gis = sql_insertq('spip_gis',$set); + $set = array( + 'id_gis' => $id_gis, + 'id_objet' => intval($id_article), + 'objet' => 'article' + ); + sql_insertq('spip_gis_liens',$set); + } else { + if ($lat !== $lat_def and $lon !== $lon_def) { + objet_modifier('gis', $id_gis, $set); + } + } + + // SEO title et description: créer ou mettre à jour, y compris si les valeurs postées sont vides (= vidage du champ) + $id_article = intval($id_article); + $seo_titre = _request('seo_titre'); + $set = array('id_objet' => $id_article, 'objet' => 'article', 'meta_name' => 'title', 'meta_content' => $seo_titre); + $where = array("id_objet = $id_article", "objet = 'article'", "meta_name = 'title'"); + $res = sql_getfetsel('meta_content', 'spip_seo', $where); + if ((!$res AND $seo_titre != '') + OR ($res != $seo_titre)) { + sql_replace('spip_seo', $set, $where); + } + $seo_descriptif = _request('seo_descriptif'); + $set = array('id_objet' => $id_article, 'objet' => 'article', 'meta_name' => 'description', 'meta_content' => $seo_descriptif); + $where = array("id_objet = $id_article", "objet = 'article'", "meta_name = 'description'"); + $res = sql_getfetsel('meta_content', 'spip_seo', $where); + if ((!$res AND $seo_descriptif != '') + OR ($res != $seo_descriptif)) { + sql_replace('spip_seo', $set, $where); + } + + include_spip('inc/invalideur'); + suivre_invalideur("id='id_article/1'"); + + $retour = array(); + $retour['message_ok'] = "L'article est bien enregistré."; + + $bigform = charger_fonction('bigform_traiter','inc'); + $bigform($id_article, 'article'); + + + return $retour; +} diff --git a/formulaires/inscription.php b/formulaires/inscription.php index 6fa5df8..3cf58bd 100644 --- a/formulaires/inscription.php +++ b/formulaires/inscription.php @@ -140,7 +140,7 @@ function formulaires_inscription_traiter_dist($mode = '', $id = 0) { } // 1. On cree l'auteur en BDD : - // statut = 1comite + // statut = 6forum $nom = _request('nom_inscription'); $mail_complet = _request('mail_inscription'); $password = _request('password'); @@ -153,7 +153,7 @@ function formulaires_inscription_traiter_dist($mode = '', $id = 0) { // on modifie aussi le statut $set = array( 'pass' => $password, - 'statut' => '1comite' + 'statut' => '6forum' ); auteur_modifier($id_auteur, $set); } diff --git a/inclure/bouton_supprimer.html b/inclure/bouton_supprimer.html index df90e6a..39cefdc 100644 --- a/inclure/bouton_supprimer.html +++ b/inclure/bouton_supprimer.html @@ -1,4 +1,4 @@ - + Supprimer diff --git a/inclure/photos_article.html b/inclure/photos_article.html new file mode 100644 index 0000000..062bb48 --- /dev/null +++ b/inclure/photos_article.html @@ -0,0 +1,26 @@ +#CACHE{0} +[(#ENV{id_article}|=={0}|oui) [(#SESSION{id_auteur}|mult{-1}|setenv{id_article})] ] + +
+ +
+ [(#FICHIER|image_recadre{320:180,-,focus}|image_reduire{320,180})] + + [(#SESSION{statut}|=={0minirezo}|oui) +
+ + + + [(#CREDITS*|=={une}|?{ +
Au premier plan
+ , + + Mettre au premier plan + + })] +
+ ] + [
(#TITRE|sinon{[(#SESSION{statut}|=={0minirezo}|oui)Double cliquez pour ajouter un titre]})
] +
+ +