Hi Piotras,

On Tue, 24 Jul 2001, pp wrote:
> > > R> mgd_is_article_in_topic_tree($topic,$id)
> > > R> Can I use name of article in place of $topic?
> > > 
> > > I meant mgd_is_in_topic_tree($topic,$id)
> > 
> > Both work with IDs only.

> Ok, Emile, so how list articles or topics when You have 
> _plenty_ of them, and show them filtered with the first letter?
> I do not mean list with "alpha".
> It should looks like You have topics with alphabet letters names,
> and each topic has articles which names begins with topic's  letter.

Let me give it a shot:

topic 'letters' --- topic 'a' ---- article 'apple'
                 |             |---article 'anny'
                 -- topic 'b' ---- article 'bear'
                 ...
                 ...
                 -- topic 'z' ---- article 'zero'

assuming you have the id for topic 'letters' :

<?php
  if($argc == 0) {
    /* code to pick a letter */
  } else if($argc == 1) {
    $letter = $argv[0]; /* we get a letter from the url
                           of an active page */
    $tltopic = 13;  /* id of topic 'letters', you should
                       pick a more repligard-safe way to
                       get this id, actually */
    $topic = mgd_get_topic_by_name($tltopic, $letter);
    $article = mgd_list_topic_articles($topic->id);
    while($article && $article->fetch()){
      ?>title: &(article.title);<br><?php
    }
  } else {
    /* IEKS! I should not get here!
       send some error message */
  }
?>

Hope this helps,

-- 
'The joy of my life is in Zion - Lauryn Hill'
Armand A. Verstappen * <[EMAIL PROTECTED]> *


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to