[ar] [ca] [cpf] [de] [en] [es] [fr] [it]

This is where you can ask questions about the SPIP cms.

Topics : 254 Topics solved :  31 %

45 visitors now


Home > Forums about SPIP >  Creating your templates > CVT form posting articles

CVT form posting articles

by magahugu - 21 January 2016 22:40No reply

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




Answering the question

« CVT form posting articles »

Keywords

You can tag this forum page with the keywords that you think are the most appropriate. This will help future visitors to find answers more quickly.


Installation, updates

Using the private area

Administration, management and configuration of your site

Creating your templates

Who are you?
  • Log in Register