Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-12-03 22:01:43
- cpk
- Member
- Registered: 2005-08-07
- Posts: 62
Collect contact name and email before file download
I can’t seem to find a plugin or method to require a name and email address before a site visitor is allowed to download a posted file. I don’t want to lose any of the existing admin file statistics and I don’t want to provide admin accounts for file downloaders and I don’t need to charge for downloading these files. My client just requires a method to collect basic contact information to report to a supervising agency and would like to prevent direct file download without providing user info first.
What I would like is something like this:
- site visitor clicks normal looking file download link
- page or window with name, organization and email address input text fields with submit button and explantation of info use
- either a return to previous page while download takes place or a thank you page.
Has anyone implemented something similar? Was it custom coded or did it employ the use of existing plugins?
Any help would be great!
Thanks,
cpk
Offline
Re: Collect contact name and email before file download
cpk wrote:
require a name and email address before a site visitor is allowed to download a posted file.
I’ve never done it, but I think I remember someone asking about something similar in the zem_contact form thread. Might want to Google for it, since searching threads from within the forum isn’t very productive.
Or you may be able to marry the contact form with the new yab_download plugin which has an optional ‘confirm’ option?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#3 2008-12-04 00:51:40
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: Collect contact name and email before file download
cpk
This may well be overkill for you but you could try a combination of the mem_self_register and ign_password_protect plugins to build a non-admin self-registration page that allows site visitors to register and then login to access protected downloads (iirc, ign_password_protect can do this)
— Steve
Offline
Re: Collect contact name and email before file download
I don’t know if this was solved but here’s a method using zem_contact_reborn
In an article (write tab)
<txp:zem_contact mailto="your_email@example.com" thanksform="file_download">
<txp:zem_contact_text label="Name" />
<txp:zem_contact_text label="Organisation" />
<txp:zem_contact_email />
<txp:zem_contact_submit label="Get File />
</txp:zem_contact>
and the file_download form
You may download your file by clicking <a href="http://yoursite.com/file_download/6" title="some title">HERE</a>.
Edit as appropriate…
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#5 2008-12-04 20:57:49
- cpk
- Member
- Registered: 2005-08-07
- Posts: 62
Re: Collect contact name and email before file download
Not solved yet but each of your suggestions offers interesting possibilities.
Steve, probably overkill for this project but you solution might work for another project I have.
Stef, I currently have zem_contact_reborn installed, so it would make sense to use it. I am looking at yab_download and have not yet determined how I might connect the two yet and was unable to find the post to which you refer for more insight.
Yiannis, your solution looks interesting but I have a couple of questions. You indicate that I should put the zem_contact_reborn parameters into an article as opposed to a form or page. Did you have a particular delivery method in mind with this approach? I typically put zem_contact_reborn in a form or a page. Is your suggestion that I make each of the individual file URLs link to an article proxy that contains the zem_contact_reborn parameters I need and then sends them to the file download form after submission?
One thing I failed to mention in my original post is that my client does not want to receive the provided user information in individual emails after each download. It makes most sense to me that this information be written to a database or txp db table and listed in a dedicated admin page. Certainly, this adds another layer of complexity but offers many possibilities for other applications.
It’s beginning to look like I might actually be defining the scope of a new plugin that I might need to have created specifically for this project. I can see many other applications of a plugin with similar capabilities and that is why I thought someone else may have already addressed such a need.
Thanks,
cpk
Offline
Re: Collect contact name and email before file download
You indicate that I should put the zem_contact_reborn parameters into an article as opposed to a form or page. Did you have a particular delivery method in mind with this approach? I typically put zem_contact_reborn in a form or a page.
I found that zem_contact works from amost anywhere and as you wanted people to click somewhere before they reach the download, an article link seemed like a good idea.
Is your suggestion that I make each of the individual file URLs link to an article proxy that contains the zem_contact_reborn parameters I need and then sends them to the file download form after submission?
Yes, you can even use custom fields – as opposed to the method above so as to allow your client to create new downloads easily.
One thing I failed to mention in my original post is that my client does not want to receive the provided user information in individual emails after each download. It makes most sense to me that this information be written to a database or txp db table and listed in a dedicated admin page. Certainly, this adds another layer of complexity but offers many possibilities for other applications.
In combination to ZCR You can use the postmaster plugin which writes the info in the db… Your client nevertheless will still receive the emails. Maybe one method is to create an email address which does not get delivered but is deleted by the server by default (ie noreply@domain.com)
It’s beginning to look like I might actually be defining the scope of a new plugin that I might need to have created specifically for this project. I can see many other applications of a plugin with similar capabilities and that is why I thought someone else may have already addressed such a need.
I think that the solution lies in the combination between ZCR and postmaster. I don’t think tthat a new plugin will be necessary.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#7 2008-12-05 07:12:33
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: Collect contact name and email before file download
You didn’t say what kind of files are involved.
This is probably not the answer you’re looking for, but in most cases when I’m asked to supply such information or register to view or download something, I usually just bail out or submit bogus information; neither would be very useful for the client.
I’ve just had too many bad experiences landing on some spammers’ mailing lists.
Perhaps you could talk your client out of this, because, in my opinion, it’s a bad idea.
Last edited by masa (2008-12-05 07:13:45)
Offline
Re: Collect contact name and email before file download
Jst an idea: mem_form can be used to write the content of a form into an article and works pretty much in the same way as zem_contact_reborn as it is heavily based on it. If writing a name, email and filename to an article feels like overkill you might want to try mem_simple_form which can be used to write the details to a custom database. I know it is in turn abstracted from mem_form but don’t know if it supports all the same things including thanks_form.
TXP Builders – finely-crafted code, design and txp
Offline
#9 2008-12-06 03:23:41
- cpk
- Member
- Registered: 2005-08-07
- Posts: 62
Re: Collect contact name and email before file download
Thx for the recommendations. I am glad to hear that I probably won’t have to commission a new plugin.
I think Yiannis’s solution will work in this situation but I will definitely give a look at mem_simple_form.
Martin, The files are documentation. I typically recommend against this kind of requirement just to download a file but this is for a govt program that supports other govt programs so it’s not out of line in this environment. No way of talking them out of it either, particularly since it was part of the RFP.
cpk
Offline
Re: Collect contact name and email before file download
thinking about it again.. Not sure how would postmaster react on duplicate email address entries…
Last edited by colak (2008-12-06 14:19:36)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#11 2008-12-08 20:52:26
- cpk
- Member
- Registered: 2005-08-07
- Posts: 62
Re: Collect contact name and email before file download
Yiannis, the Postmaster plugin is looking a bit like overkill for this project.
I am wondering now if there is a way to tie into or reproduce the comment authentication built-in to TxP to get what I need.
I really don’t need anything too sophisticated, just the authentication portion of commenting seems to fit the bill. This already has a method for users to provide email info before commenting and logs user info into the db and displays in the admin section while placing a cookie for future commenting – essentially these are all the features I need to interrupt a user file download with a prompt for a name and email before proceeding to the individual file download.
Is the commenting feature too integrated into TxP core to duplicate and fork into a new plug-in using commenting as its foundation without disrupting its basic operation or was it created as a modular object to extend TxP core? Any thoughts or insight?
cpk
Offline
#12 2009-03-03 02:26:06
- cpk
- Member
- Registered: 2005-08-07
- Posts: 62
Re: Collect contact name and email before file download
I am following up for those who may be interested in accomplishing something similar to my posting request, e.g. collect email address or form data before allowing access to a TxP form (this could be data, file, etc.).
With the help of various others on this wonderful forum I have found that the following combination of plugins worked best to accomplish my needs:
- mem_simple_form (requires mem_form)
- chs_cookie
I created a new database table for mem_simple_form to write to using PHPMyAdmin since I did not want to make changes to any of the TxP database tables. I used mem_simple_form and mem_form tags to collect the data, write to the database and forward the user to the desired data after submission. I used chs_cookie (thanks Jakob and johnstephens) to both set a cookie and check for it to prevent returning users the inconvenience of having to fill out the form again to access the data.
This solution seems to work well so far. What still remains is the ability to output an admin side list of users who have submitted the form (similar to what is displayed in the visitor logs page). I am attempting to write an admin side plugin to accomplish this using the zem_template so we shall see how that goes.
cpk
Offline