[Pmwiki-users] Alt. way of adding images to pages?

John Rankin john.rankin
Wed Aug 18 16:54:14 CDT 2004


On Thursday, 19 August 2004 7:59 AM, Gary Hodgson <gary.hodgson at red-peg.net> wrote:
>Hi all,
>
>I've been trying to implement the following functionality but 
>unfortunately I am a complete newbie to PHP (and pmWiki) and am not 
>getting anywhere.  If anyone else has done something similar then I 
>would really appreciate any help.
>
>I am trying to modify the upload functionality so that if the extension 
>of the uploaded file is an image then the URL of the uploaded file is 
>shown instead of the "Attach:filename.ext" link.  My thinking is that 
>this would allow people to upload images into a page inline without 
>having to ftp files to the web server, or having to attach the file 
>first and then manually modifying the entry. (believe it or not this is 
>too difficult/problematic for the target audience)
>
>Naturally I may be overlooking an even easier way of showing images in a 
>page - please feel free to point out the error of my ways.
>
>Thanks,
>Gary
>
The following should work without any modification to the upload script:
1. edit the page and write Attach:filename.gif

2. save the page and click the question mark after Attach:filename.gif?

3. select the file to upload and click Upload

4. revisit the page, which will now show the image

There is no need to modify the entry after uploading. I'm not clear
which piece of this process you want to simplify; my experience is that
users only have to do it once, get the instant gratification of seeing
their image display 'just like that', and they are away. The first
time is the barrier to overcome.

But it should be possible to change "Attach:filename.gif?" to read
"Click to upload filename.gif" fairly easily, if that is what you
are trying to do, by specifying a local FmtAttachLink function and
modifying the line that specifies the layout of a non-existent link.
At the simplest, change the '?' to ' Upload file'.

Or, if the image is already somewhere on the web, type its address.

    http://www.some.place/imagename.png for example

Hope this helps.




-- 
JR
--
John Rankin





More information about the pmwiki-users mailing list