Date: Mon, 03 Mar 2014 12:38:29 -0500
From: Mark London <mrl(a)psfc.mit.edu>
Subject: [MediaWiki-l] Form to fill in before allowing access to a
download link.
I have a user who wants a form in his mediawiki, that has to be filled
out, before displaying a software download link. Does anyone know of
something like that? Thanks
Mark London
Hi Mark,
I have implemented something very much like this, but not purely in
MW. I wrote a CGI script (in PHP, but any language supported by your
web server will do) that processed form input and gave the user the
requested file. I created the required form as a widget (see
http://www.mediawiki.org/wiki/Extension:Widgets), with the URL of the
CGI script as the action. Since this solution is not contained
entirely within MW, it has the potential drawback that you need access
to put executables somewhere the web server will allow them to be run.
A slicker way to do this would be with Semantic Forms
(
http://www.mediawiki.org/wiki/Extension:Semantic_Forms). The setup
might be a little more complex, but you'd be writing less of the
actual machinery, so much of the bugfixing is already done for you.
Plus I think it'll be much faster and easier to implement this if
there are a bunch of different files available for download, or if you
later want to implement something similar elsewhere. I can't tell you
off the top of my head exactly how to go about this, but IIRC the
documentation is pretty good.
Cheers,
David Leaman