Greets Ken!

Ken Pooley wrote:

> >>They're included in every page since they're part of midgard-root.php3
>
> So I shouldn't want to mess with them...I need to go read the function
> section...that probably is where I will find what I want to know about
>
> >>What fields?
>
> Type
> IDs
> Extra 1
> Extra 2
> Extra 3
>

I'm working on the content management section of the documentation, so I'll do
a little research and see what I can come up with on these fields.


>
> I am guessing that these can be used for filters but  I am trying to figure
> out to start...I am also guessing that they need to be built into the PHP
> and the query....I am also curious about what the score on the article
> admin does and how to use the approved and locked fields....
>

Probably a good guess at this time.. *grin*  The score on the article admin
does indeed allow for sorting of your articles.  When you use the function
mgd_list_articles(int id, string [sort], int [type]); the brackets mean that
its an optional field..  If you do include it, you can specify how the
returned objects are displayed by specifying how they are sorted.  Current
options are:

alpha
reverse alpha
name
reverse name
score
reverse score
and created

(*slaps forehead at this point*)  Just occured to me what you can do with the
type.  You can set the type field as an integer to represent different "types"
of pages.  Perhaps a set of member's pages?  or help pages?  If your normal
pages are type "0", members pages are type "1" and help pages are type "2"
that would allow you to list only those type pages under a topic tree.  Would
prevent needless cluttering of a selection menu while still maintaining an
entire topic under a single branch.

As for a coding example, when you set up your links, you'd probably only want
to show items that have been approved for viewing.  Something along the lines
of:

(stolen shamelessly from the midgard docs (function refs) and modified)
<?php
$topic = 123;
               $article = mgd_list_topic_articles( $topic, "score" );
               if( $article->N == 0 ) {
                 echo "No article";
               } else {
                 while( $article->fetch() ) {
                      if ($article->approved) {                       /*
checks for approval of article before displaying it onscreen */
                   ?> &($article.name); <br> <?php
                 }}
                 echo "$article->N article", ( $article->N == 1 ) ? '' : 's';
               }
 ?>

>
> Again this is as much me sort of being public about where I get stuck and
> when, so that you know where to look as docs get written...I am just
> starting to look at the actualities of admin at this level and anticipating
> the need to use features which are obviously meant to do what I want...

I'm with you here.. *smile*  Helping out with the docs are part of the way I'm
learning the Midgard system (see previous paragraph *grin*).  If you are stuck
at a particular point, give me a yell and I'll look into incorporating it into
the documentation.  Chances are, if you are having problems with it, so is
someone else.

Jamie


--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to