Please specify your interest in this question
0

CVT form posting articles

Hello dear Community,

I want to make a form allowing users to submit content. I’ve followed the CVT guide before for creating user signups, and now I’m looking for a similar function to allow for creating articles (getting title, texte, etc from POST fields, saving it in database after some checks.

What whould be the equivalent of this function for making articles?

function formulaires_xxx_traiter_dist() {
        $res = array();
        $surname = _request('surname');
        $firstname = _request('firstname');
        $email = _request('email');
       
        include_spip('action/editer_auteur');
        if ($id_auteur = insert_auteur()) {
                auteurs_set($id_auteur,array('surname'=>"$surname $firstname",'email'=>$email));
                $res['message_ok'] = "Save successful!";
                $res['id_auteur'] = $id_auteur;
        }
        else
                $res['message_erreur'] = "A problem occurred - it was not possible to save your data";

        return $res;
}

Thank you,
magahugu