[prev in list] [next in list] [prev in thread] [next in thread] 

List:       midgard-user
Subject:    [midgard-user] problem with mgd_list_topic_articles_all
From:       James Gifford <james.gifford () wilderness ! org ! au>
Date:       2003-07-26 9:03:51
[Download RAW message or body]

Hi

I can't work out how to filter using the Up field without using the Type 
field.

The function reference says:
||*mgd_list_topic_articles_all*| (int topic, string /[sort]/, int 
/[type]/, int /[up]/)|
||
I tried various combinations:

This is fine:
mgd_list_topic_articles_all( 28, "reverse created", 1)

and this is fine:
mgd_list_topic_articles_all( 15, "reverse created", 1, 25)

but this returns nothing:
mgd_list_topic_articles_all( 15, "reverse created", "",25)

I looked up the MySQL logs and found that when I put an empty string as 
the type, it defaults to zero. the relevant fragment is:
WHERE (article.type=0 AND article.topic IN (55) AND (article.up=25 OR 1=0)

This behaviour goes against what is in the comments in the annotated 
manual at
http://midgard-project.org/manual/en/function.list-topic-articles-all.php

Does anyone know what's going on here?

Thanks
James


[Attachment #3 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body>
Hi <br>
<br>
I can't work out how to filter using the Up field without using the Type
field.<br>
<br>
The function reference says:<br>
<code><code class="FUNCDEF"><b \
class="function">mgd_list_topic_articles_all</b></code> (int topic, string \
<i>[sort]</i>, int <i>[type]</i>, int <i>[up]</i>)</code><br> <code></code><br>
I tried various combinations:<br>
<br>
This is fine:<br>
mgd_list_topic_articles_all( 28, "reverse created", 1)<br>
<br>
and this is fine:<br>
mgd_list_topic_articles_all( 15, "reverse created", 1, 25)<br>
<br>
but this returns nothing:<br>
mgd_list_topic_articles_all( 15, "reverse created", "",25)<br>
<br>
I looked up the MySQL logs and found that when I put an empty string as the
type, it defaults to zero. the relevant fragment is:<br>
WHERE (article.type=0 AND article.topic IN (55) AND (article.up=25 OR 1=0)
<br>
<br>
This behaviour goes against what is in the comments in the annotated manual
at <br>
<a class="moz-txt-link-freetext" \
href="http://midgard-project.org/manual/en/function.list-topic-articles-all.php">http://midgard-project.org/manual/en/function.list-topic-articles-all.php</a><br>
 <br>
Does anyone know what's going on here?<br>
<br>
Thanks<br>
James<br>
<br>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic