Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > compter_contributions_auteur

compter_contributions_auteur

This pipeline is used to insert content onto the author list page showing the volume of each author’s contributions.

It is called as shown below from ecrire/inc/formater_auteur.php:

  1. $contributions = pipeline('compter_contributions_auteur', array(
  2. 'args' => array('id_auteur' => $id_auteur, 'row' => $row),
  3. 'data' => $contributions));

Download

Example

The "Forum" plugin adds the number of messages written by an author:

  1. function forum_compter_contributions_auteur($flux){
  2. $id_auteur = intval($flux['args']['id_auteur']);
  3. if ($cpt = sql_countsel("spip_forum AS F", "F.id_auteur=".intval($flux['args']['id_auteur']))){
  4. // manque "1 message de forum"
  5. $contributions = ($cpt>1) ? $cpt . ' '. _T('public:messages_forum') : '1 ' . _T('public:message');
  6. $flux['data'] .= ($flux['data']?", ":"") . $contributions;
  7. }
  8. return $flux;
  9. }

Download

  • Author :
  • Published :
  • Updated : 12/05/17
  • Translations : English, français