Alan,


> Sounds like an A level maths question :)

ROTFL!

> One way of doing it - off the top of my head

Ahh, what kind of a head do you have?! ;-)

> 1. build an an array of the available articles
> $o = mgd_list_topic_articles(x)
> $a = array();
while ($o->>fetch()) $a[]= $o->id;

Maybe I should give up...

> 2. build a list of articles from that list (using random numbers?)

> function randomint($max = 100) { 
>     static $startseed = 0; 
>     if (!$startseed) {
>         $startseed = (double)microtime()*getrandmax(); 
>         srand($startseed);
>     } 
>     return (rand()%$max); 
> } 
> $b=array()
> while (count($b)<4) {
>   $n = randomint(count($a));
>   if (!$b[$a[$n]]) $b[$a[$n]] = "USEME";
> }

Ok, I couldn't say that this looks great to me as I don't understand
anything here... Oh, wait, there is a four! :-) = four articles
displayed?

> 3. print them
> while (list($k,v) = each($b)) {
>   mgd_get_article($k)
>  // print it!
> }

Would that print all of them? Or just 4?
Would I put this whole list that way into my script? I.e. instead of
my old

> <?
>  $article = mgd_list_topic_articles_all($topic_id); {
>  $displayed = 0;
>   while ($displayed < 4 && $article && $article->fetch()) {
>    if (mgd_is_article_in_topic_tree(94, $article->id)) { continue; }
>    if (mgd_is_article_in_topic_tree(111, $article->id)) { continue; }
>    $displayed++;
> ?>

?
Where would I then put this part

>    if (mgd_is_article_in_topic_tree(94, $article->id)) { continue; }

?
This is well beyond my comprehension, I must say :-( Thanks for your
patience!

Alexander



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

Reply via email to