Armand, it has been a week and I still have not been able to get mgd-create-article to work.
I have tried this with the sample code modified below to my spec, and articles are still not showing up in the articles table. Here is the code below <?php $up = 0; $topic = 14; $name = "testarticle"; $title = "What's in a name"; $abstract = "Learning Midgard from the manual is easy, but..."; $content = "Learing Midgard from the manual is easy, but by actually trying "; $content .= "the examples yourself, you'll get a better feel for what is "; $content .= "the use of the various functions."; $author = 0; $url = "http://www.midgard-project.org/"; $calstart = "0000-00-00"; $caldays = 0; $icon = 0; $view = 0; $print = 0; $extra1 = ""; $extra2 = ""; $extra3 = ""; $type = 0; mgd_errno(); $topic=mgd_get_topic(14); if($topic) { echo $topic->id; echo $topic->name; } else { echo "bad news<br>"; } $article=mgd_get_article(); $article->up= 0; $article->topic=$topic->id; $article->name=$name; $article->title=$title; $article->abstract=$abstract; $article->content=$content; $article->author=$author; $article->create(); echo $article->id; if(!$newid=$article->create()) { echo mgd_errstr(mgd_errno()); echo "problems"; } if( ! $article ) { echo "Creation of article '$name' failed."; echo "reason: " . mgd_errstr( mgd_errno() ); } else { echo "Created article '$name' with id $article->id."; } ?> ------------------------------------------- 14news0Object does not existproblemsCreated article 'testarticle' with id 0 ------------------------------------------- If I change the user from 0 to something else, I get permission denied, Any help is greatly appreciated. Thanks Regards, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ William Shine Systems Analyst QNX Software Systems Ltd. Email: [EMAIL PROTECTED] Kanata, Ontario K2M 1W8 (613) 591-0931 ext.9143 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On 25 Nov 2002, Armand A. Verstappen wrote: > On Mon, 2002-11-25 at 18:06, Will Shine wrote: > > I am having troubles getting mgd_create_article to work. > >=20 > > I was getting an access denied error from the sample code supplied on the= > =20 > > web site until i adjusted permissions. > >=20 > > Now I fixed the permissions so that I no longer get an access denied=20 > > error but now I get an object does not exist error. > >=20 > > Is there something that I am missing here? > > Maybe. An article needs to be in a topic, so you'd call: > > $topic =3D mgd_get_topic($id_of_topic_you_want_to_create_article_in); > > if (!$topic) > { > echo "could not get topic, bailing out<br>\n"; > exit; > } > > mgd_create_article($up, $topic->id, ...); > > You could also use the oop approach as suggested on: > > http://www.midgard-project.org/manual/en/method.object-create.php > > but at any rate be sure that the topic you want to create the article in > exists, and that the up field is either zero or points to an existing > article. > > wkr, > =20 > --=20 > Envida http://www.envida.net/ > Armand A. Verstappen Graadt van Roggenweg 328 > [EMAIL PROTECTED] 3531 AH Utrecht > tel: +31 (0)30 298 2255 Postbus 19127 > fax: +31 (0)30 298 2111 3501 DC Utrecht > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
