OK. Have you read the different comments made under the annotated manual? If you still got any problems, go ahead.
 
Some tips:
 
When it comes to blobs, the simple part is to make a 'blobfolder' in in midgard. The folder contains the code for serving an attachment. Just make a subpage in midgard, and add the following to the code-init page element:
<?
if ($argc == 1) {
   mgd_serve_attachment($argv[0]);
   exit;
 }
if ($argc == 2) {
   mgd_serve_attachment($argv[0]);
   exit;
 }
?>
(the subpage must be active)
 
When you whant to call an attachent you've uploaded somehow(I'm only familiar with the framed admin and there attachments are only used in articles, but it shouldn't matter), you just need to know it's id. If you got an attachment with id = 134. You can do <img src=/imfolder/134> and it should work out ok. I've fiddled with the code in the framed admin (se the maillinglist archive for how) so I can include with and height for images, very practical, but then you need to to mgd_get_attachment();.
 
The code init element I've added in this mail, has one favourable part to the one which I think is in my annotation, you can add the imagename. So instead for doing:
 
<img src=ID> you do something like
 
<? if ($att) {
 
$att = mgd_get_attachment($att);
?>
<img src=/imgfolder/&(att.id);/&(att.name);">
<? }
?>
 
this gives you a way to give back the former attachment name if that is interesting. I use this when people are going to download files etc..
 
btw. The twig implementation for midgard done a few months ago, is possible to make it into some .txt files that peole can download and enter into their own site as snippets? Tarjei
 
 
-----Original Message-----
From: IT Partner [mailto:[EMAIL PROTECTED]]
Sent: 12. januar 2001 04:53
To: [EMAIL PROTECTED]
Subject: [midgard-user] attachment

Hello!
 
Could someone describe me how to use attachements? I don;t even know how to get ID of created attachment and how to quickly put it on the page (IMO mgd_get_attachment is ver long way to put image on the webpage)
 
Thanks you in advance
 
Krzysztof Janiszewski

Reply via email to