[pmwiki-users] fox auto-upload again. Still doesn't work as expected.

martin at kerz.org martin at kerz.org
Mon Mar 31 06:47:27 CDT 2008


Dear Hans,

perhaps I'll explain what I'm working on: I want people to be able to  
create a page with a form and automatically attach one picture to it,  
which gets displayed right after the form submission.

Unfortunately, to avoid naming conflicts, I have set $UploadPrefixFmt  
= '/$Group/$Name';

I have this form now:

-----
>> neuediagnose<<
(:messages:)
(:fox neuereintrag template=Site.Vorlage foxgroup="Index" redirect=1  
pagecheck=1 upload=1 formcheck=1:)
(:input hidden target '{$$name}':)
'''Diagnose:''' (:input text name "Diagnose" size=20:)

'''Bild''':  (:input file upfile:)\\
'''Dateiname auf der Diagnoseseite:''' (:input text upfile_name :)\\
[-''Weitere Bilder müssen auf der Diagnose-Seite hochgeladen werden''-]

'''Beschreibung'''\\
(:input textarea beschreibung rows=20 cols=60:)

(:input submit post "Diagnose erstellen":)
(:foxend neuereintrag:)
>> <<
-----

and this Template:

-----
(:title {$$name}:)

!{$$name}
[[#galerie]]
>> galerie<<
Attach:{$$foxpage}/{$$upfile_name}
>> <<

(:messages:)
(:fox neuesbild template=Site.VorlageNeu upload=1 formcheck=1  
uptarget={$FullName} put=insertbefore mark=>><<:)
'''Bild hinzufügen''':  (:input file newup:)\\
'''Dateiname auf der Diagnoseseite:''' (:input text newup_name:)
(:input submit post "Bild hinzufügen":)
(:foxend neuesbild:)


[[#beschreibung]]
!!Beschreibung
{$$beschreibung}
-----

This works really well, except when the user creates a diagnosis with  
a more complicated name and with special characters (I have installed  
the automatic conversion, as you suggested, and it works great.). When  
such a special diagnosis is added, I get untransformed {$$name} in the  
resulting page. e.g.

Attach:Index/Larifari 1. Grade in der Zeit/test.gif

As I have set $UploadPrefixFmt = '/$Group/$Name';, and (even more  
complicated) want to show the graphics on another page, I have to  
specifiy the complete path before the file name. The  
(:wikiword:)-markup didn't work, even with your suggested corretion. :-/

Moreover, as you can see, I add another upload form to the target  
page, to let users upload further images. In the specified template, I  
use the ($$foxpage}-Variable to get the full path of the page. This  
results in something like e.g. this: Index.Diagnose, which is a markup  
that is not compatible with the imgpopup recipe, that is enabled, too.

I don't know if you can help. As for the imgpopup recipe, I'll try to  
contact the original author.

Thanks again and a lot.


Martin




More information about the pmwiki-users mailing list