What if you....

 <? $topicnum = $topic->id; ?>
      ?><DIV 
align="center"><P>&(topic.code:h);</P></DIV><br><br>&(topic.id);<?
      $article = mgd_list_topic_articles ($topicnum);

kp




-----Original Message-----
From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, August 09, 2000 2:57 PM
To:     [EMAIL PROTECTED]
Subject:        [midgard] variable "... is not an object ..." error problem

Hi all,

Working towards mapping all topic structure to pages I am comletely stumped 
by this output error:

Warning: $topic is not an object in dynamiccontent on line 25

dynamiccontent is a style element as included below.  I use the 
mgd_get_..._by_name functions which I have preincluded.

When I output $topic fields using the &(topic.code); syntax, the contents 
of the code field are displayed fine.  However whener I try to access 
$topic fields within php code I get the error above.  I also experience the 
same problems when using the $midgard object to access uri.  I seem to 
access these vars same as in examples but to no avail.

particluar offending code(excerpted from below):
      ?><DIV 
align="center"><P>&(topic.code:h);</P></DIV><br><br>&(topic.id);<?
      $article = mgd_list_topic_articles($topic->id);



Much thanks for any help,
Robert Murray

dynamiccontent element:

<?
/* show this topic's code and list all articles or show all of one article 
requested*/
  $page=mgd_get_page($midgard->page);
  $topic=mgd_get_topic_by_name("0", $page->name);
  ?><h1>&(page.title);</h1><?

  if (isset($topic)) {

    /* show requested article */
    if (isset($id)) {
      /* Get requested article... */
      $article = mgd_get_article($id);
      if ($article->url) { ?>
        <a href="&(article.url);"><h1>&(article.title);</h1></a>
      <? } else {?>
        <h1>&(article.title);</h1>
      <? } ?>

      <h3>&(article.abstract);</h3>
      <p>&(article.content:f);</p> <?

    /* Show topic code and list articles */
    } else {
      ?><DIV 
align="center"><P>&(topic.code:h);</P></DIV><br><br>&(topic.id);<?
      $article = mgd_list_topic_articles($topic->id);
      if ($article) {
        ?><ul><?
        while ($article->fetch()) {
          ?><li><i><a 
href="&(midgard.uri);?id=&(article.id);">&(article.title);</a></i><?
          /* Show abstract (if there is any abstract entered). */
          if ($article->abstract) { ?>
            <br>&(article.abstract:f);<?
          } ?>
          </li><?
        } ?></ul><?
      }
    }
  }
?>

--
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]


--
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