Hi Emile!
I tried your script, and got the error:
"Fatal error: Call to unsupported or undefined function listattachments() in
content on line 47"
Is this an instalation error? How do I change it? We have just upgraded to
beta5, so everything should be in order. Please help (and thank's A LOT for
all your help already).
Tarjei
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 7. september 2000 12:21
> To: [EMAIL PROTECTED]
> Subject: Re: [midgard] getting the blobs related to an article
>
>
> Tarjei Huse wrote:
>
> > I've tried a number of things to manage to get attachments.
> Basicly I've
> > added attachments through the "add image" in fadmin. But:
> It is impossible
> > to call them back! At lest it seems so.
> >
> > Does anyone have the code to get the attachments of an
> article, and display
> > the file (gif or jpeg) in the listing. THis is a listing of
> articles and
> > their abstracts, and I want to disply pitcures with the articles.
>
> I have no intimate knowledge of fadmin, but I suppose this would work:
>
> have a active page /displayarticle with content:
>
> <?
>
> if ($argc == 0) {
> echo "No article selected" }
> else { if (! ($article = mgd_get_article($argv[0]) ) {
> echo "No article ", $argv[0];
> } else {
> ?>
> <H1>&(article.title);</H1>
> &(article.abstract:f);<p>
> >?
> $att = $article->listattachments();
> echo "<DL>"
> while ($att && $att->fetch()) {
> /* test $att->mimetype here if you're not sure that all
> attachments
> are
> images */
> echo "<DT><IMG SRC=\"/displayarticle/", $argv[0], "/", $att->id,
> "\">";
> echo "<DD>", $att->title;
> }
> echo "</DL>";
> }
>
> ?>
>
> attach a page element 'code-init' with content:
>
> <?
> if ($argc == 2) { /* display blob */
> mgd_serve_attachment($argv[1]);
> exit;
> }
> ?>
>
> Emile
>
> --
> 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]