diff --git a/base/soyezcreateurs.php b/base/soyezcreateurs.php index d30c7679903aad1ad89e21700b64c716bc798279..1aea8270ebbdfe1c330cf4b7b11400027765b046 100644 --- a/base/soyezcreateurs.php +++ b/base/soyezcreateurs.php @@ -232,16 +232,7 @@ function create_mot($groupe, $mot, $descriptif='', $texte='') { //fonction qui permet de mettre à jour un mot clé function remplacer_mot($id_mot, $mot, $descriptif, $texte, $id_groupe, $groupe) { include_spip('action/editer_objet'); - // objet_modifier("spip_mots", array($mot, $descriptif, $texte, $id_groupe, $groupe), "id_mot=$id_mot"); - sql_updateq( - "spip_mots", array( - "titre" => $mot, - "descriptif" => $descriptif, - "texte" => $texte, - "id_groupe" => $id_groupe, - "type" => $groupe - ), "id_mot=$id_mot" - ); + objet_modifier("spip_mots", array($mot, $descriptif, $texte, $id_groupe, $groupe), "id_mot=$id_mot"); return true; } @@ -302,21 +293,8 @@ function create_rubrique($titre, $id_parent='0', $descriptif='') { include_spip('action/editer_objet'); $id_rubrique = find_rubrique($titre); if ($id_rubrique == 0) { - // $id_rubrique = objet_inserer('spip_rubriques', array("titre" => $titre, "id_parent" => $id_parent, "descriptif" => $descriptif, "lang" => "fr")); - // objet_modifier('spip_rubriques', array("id_secteur" => $id_rubrique), "id_rubrique=$id_rubrique"); - $id_rubrique = sql_insertq( - "spip_rubriques", array( - "titre" => $titre, - "id_parent" => $id_parent, - "descriptif" => $descriptif, - "lang" => 'fr' - ) - ); - sql_updateq( - "spip_rubriques", array( - "id_secteur" => $id_rubrique - ), "id_rubrique=$id_rubrique" - ); + $id_rubrique = objet_inserer('spip_rubriques', array("titre" => $titre, "id_parent" => $id_parent, "descriptif" => $descriptif, "lang" => "fr")); + objet_modifier('spip_rubriques', array("id_secteur" => $id_rubrique), "id_rubrique=$id_rubrique"); spip_log("1. (create_rubrique) rubrique cree : id = $id_rubrique, titre = $titre", _LOG_DEBUG); } else if ($id_rubrique > 0) { @@ -370,45 +348,8 @@ function create_article($texte, $rubrique, $lang='fr') { spip_log("1. (create_article) insertion d'un article : ".$texte['titre'], _LOG_DEBUG); $statut = (isset($texte['statut']) ? $texte['statut'] : 'publie'); $date = date("Y-m-d H:i:s"); - // $id_article = objet_inserer("spip_articles", array("id_article" => "", $texte['surtitre'], $texte['titre'], $texte['soustitre'], $id_rubrique, $texte['descriptif'], $texte['chapo'], $texte['texte'], $texte['ps'], $date, $statut, $id_rubrique, $date, "export" => '', "date_redac" => '0000-00-00 00:00:00', "visites" => 0, "referers" => 0, "popularite" => 0, "accepter_forum" => '', $date, $lang, "langue_choisie" => 'non', "id_trad" => 0, $texte['nom_site'], $texte['url_site'], $texte['virtuel'])); - // objet_inserer("spip_auteur_liens", array("id_auteur" => 1, $id_article, "objet" => 'article')); - $id_article = sql_insertq( - "spip_articles", array( - "id_article" => '', - "surtitre" => $texte['surtitre'], - "titre" => $texte['titre'], - "soustitre" => $texte['soustitre'], - "id_rubrique" => $id_rubrique, - "descriptif" => $texte['descriptif'], - "chapo" => $texte['chapo'], - "texte" => $texte['texte'], - "ps" => $texte['ps'], - "date" => $date, - "statut" => $statut, - "id_secteur" => $id_rubrique, - "maj" => $date, - "export" => '', - "date_redac" => '0000-00-00 00:00:00', - "visites" => 0, - "referers" => 0, - "popularite" => 0, - "accepter_forum" => '', - "date_modif" => $date, - "lang" => $lang, - "langue_choisie" => 'non', - "id_trad" => 0, - "nom_site" => $texte['nom_site'], - "url_site" => $texte['url_site'], - "virtuel" => $texte['virtuel'] - ) - ); - sql_insertq( - "spip_auteurs_liens", array( - "id_auteur" => 1, - "id_objet" => $id_article, - "objet" => 'article' - ) - ); + $id_article = objet_inserer("spip_articles", array("id_article" => "", $texte['surtitre'], $texte['titre'], $texte['soustitre'], $id_rubrique, $texte['descriptif'], $texte['chapo'], $texte['texte'], $texte['ps'], $date, $statut, $id_rubrique, $date, "export" => '', "date_redac" => '0000-00-00 00:00:00', "visites" => 0, "referers" => 0, "popularite" => 0, "accepter_forum" => '', $date, $lang, "langue_choisie" => 'non', "id_trad" => 0, $texte['nom_site'], $texte['url_site'], $texte['virtuel'])); + objet_inserer("spip_auteur_liens", array("id_auteur" => 1, $id_article, "objet" => 'article')); include_spip('inc/rubriques'); calculer_rubriques(); propager_les_secteurs();