Get articles published by a certain author

Hello again,

I know that you can get a list of x articles published by an author by
using something like this:

<BOUCLEn(AUTEURS){2/2}>
  <BOUCLEn1(ARTICLES){id_auteur}...>
    HTML-code
  </BOUCLEn1>
</BOUCLEn>

What I would like to have is a link under an article directing the users
to other articles published by the same author. The above code works
when I define which author SPIP should generate a list for. Can this
been done automatically depending on the id_autuer for each article?

BTW, http://www.uzine.net seems to be down right now?

Best regards,

What I would like to have is a link under an article directing the users
to other articles published by the same author. The above code works
when I define which author SPIP should generate a list for. Can this
been done automatically depending on the id_autuer for each article?

Yes, of course.

Something like:

<BOUCLE_main_article{id_article}{doublons}>

      #TITRE
      #TEXTE...

      <BOUCLE_authors{id_article}>

      -> #NOM

           <BOUCLE_other_articles{id_auteur}{doublons}>
           #TITRE
           </BOUCLE_other_articles>

      </BOUCLE_authors>

</BOUCLE_main_article>

The loop "main_article" is the main loop for your page. It retrieves the article with "id_article" passed in the URL, and show the title and the main body of the article (#TITRE and #TEXTE); add whatever is needed (#SURTITRE...).

In this loop, somewhere in the page, le loop "authors" shows the name of the authors of the article (as this loop depends on "id_article"). Lets just show the authors names (of course, you can create a link with their email).

In the authors loop (so that it's executed for each author), the loop "other_articles" shows every articles by this auther (as it depends on "id_auteur"). Of course, you could restrict this list to the most recent articles.

The only subtle thing is the use of "doublons", so articles cannot be selected more than one time. In "main_article", the main article is selected and, because of "doublons", will not be shown again (in another "doublons" loop). In "other articles", because of the "doublons", not only the "main article" will not be shown again, but also the articles of each author will be shown only once (if some authrs have written some articles together, these articles will appear only for 1 author, this way you will avoid multiple links to a same page).

ARNO*

--
Le Scarabée : http://www.scarabee.com
uZine 2 : http://www.minirezo.net

DH/DSS, 0x11930F0B, DEEB 602D B344 644B AF88 BF73 85F4 2297 1193 0F0B

Thank you for your help!

However, when I tried as you suggested, I get following error message:

"Syntaxe boucle incorrecte"

Something I have missed?

Best regards,

-----Ursprungligt meddelande-----
Från: ARNO* [mailto:arno@scarabee.com]
Skickat: den 28 juli 2001 20:10
Till: Hi-Young Kim; spip@rezo.net
Ämne: Re: [Spip] Get articles published by a certain author

What I would like to have is a link under an article directing the
users to other articles published by the same author. The above code
works when I define which author SPIP should generate a list

for. Can

this been done automatically depending on the id_autuer for each
article?

Yes, of course.

Something like:

<BOUCLE_main_article{id_article}{doublons}>

     #TITRE
     #TEXTE...

     <BOUCLE_authors{id_article}>

     -> #NOM

          <BOUCLE_other_articles{id_auteur}{doublons}>
          #TITRE
          </BOUCLE_other_articles>

     </BOUCLE_authors>

</BOUCLE_main_article>

The loop "main_article" is the main loop for your page. It retrieves
the article with "id_article" passed in the URL, and show the title
and the main body of the article (#TITRE and #TEXTE); add whatever is
needed (#SURTITRE...).

In this loop, somewhere in the page, le loop "authors" shows the name
of the authors of the article (as this loop depends on "id_article").
Lets just show the authors names (of course, you can create a link
with their email).

In the authors loop (so that it's executed for each author), the loop
"other_articles" shows every articles by this auther (as it depends
on "id_auteur"). Of course, you could restrict this list to the most
recent articles.

The only subtle thing is the use of "doublons", so articles cannot be
selected more than one time. In "main_article", the main article is
selected and, because of "doublons", will not be shown again (in
another "doublons" loop). In "other articles", because of the
"doublons", not only the "main article" will not be shown again, but
also the articles of each author will be shown only once (if some
authrs have written some articles together, these articles will
appear only for 1 author, this way you will avoid multiple links to a
same page).

ARNO*

--
Le Scarabée : http://www.scarabee.com
uZine 2 : http://www.minirezo.net

DH/DSS, 0x11930F0B, DEEB 602D B344 644B AF88 BF73 85F4 2297 1193 0F0B

Hello again,

I think I got it working using this:

I can now display the authors previous articles on the article pages
using:

<BOUCLE_authors(AUTEURS){id_article}>
  <BOUCLE_other_articles(ARTICLES){id_auteur}{doublons}>
           #TITRE
  </BOUCLE_other_articles>
</BOUCLE_authors>

However, when I create a separate file (auteurs.html/php3) with this
code (with the addition of <BOUCLE_main_article...>), so that the users
can get this info about the author on a new page via a link, all I´m
getting is a blank page. Should I add something?

Best regards,