pp wrote:

> Yes, I made this. uh!
> Thanks!
> But I still do not understand mgd_serve_attachment.
> For example I wnat to display article content and its attachment.
> It maybe gif, jpg.
> How am I make <IMG src>?
> And how force other files(txt, pdf) not to be displayed, 

For example:
> but shown as links for download?

code-init:

<? if ($attachment) { mgd_serve_attachment($attachment); exit; } ?>

page code:

<? $article = mgd_get_article(...); ?>
&(article.content);
<?
  $atts = $article->listattachments();
  while ($atts && $atts->fetch()) {
    if (preg_match ("^image\//", $atts->mimetype)) {
      ?><IMG SRC="&(midgard.uri);?attachment=&(atts.id);"><BR>&(atts.title);<P><?
    } else {
      ?><A HREF="&(midgard.uri);?attachment=&(atts.id);">&(atts.title);</A><P><?
  }
?>


Emile



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to