Page 1 of 1
[SOLVED] FEU - Unique File Download per User
Posted: Thu Aug 15, 2013 10:44 pm
by mr.bacan
Hi everyone, I'll try to explain what I need to accomplish. I have a list of 700+ users in FEU, each of them has their own unique access. They need to be able to download a personalized Participation Certificate PDF. So what I need is to have a download page featuring a certificate for the logged user.
Is there a way to automate this?
I'm using:
CMSMS 1.11.6
CustomContent 1.6
FEU 1.21.15
CGExtensions 1.33
Thanks in advance for any help on this.
Re: FEU - Unique File Download per User
Posted: Sat Aug 17, 2013 6:53 pm
by Dr.CSS
Are the files named as the FEU, or maybe you can use a new field in FEU to have the same name as user or a unique name for it and the user then add that filed as part of the link to it...
Re: FEU - Unique File Download per User
Posted: Sat Aug 17, 2013 7:51 pm
by manuel
Dear mr.bacan,
Seems like a lot of work and i haven't done this myself yet but... you should be able to directly generate custom PDF's containing the FEU user's information by creating a UDT that generates the PDF's using
http://www.fpdf.org/
http://www.techrepublic.com/article/gen ... -and-fpdf/
Or (again, untested...)
You could generate regular pages they can print or export as PDF using something like
http://code.google.com/p/wkhtmltopdf/
Greetings,
Manuel
Re: FEU - Unique File Download per User
Posted: Sun Aug 18, 2013 8:28 pm
by mr.bacan
Thank you both for you replies. I'm not a programmer, and your PDF solution would be great Manuel, but I'll need expert assistance to accomplish that.
Meanwhile what I've tried is generating each certificate with an ID, ex. certificate-1.pdf, certificate-2.pdf, etc, in which the number is the user ID. So I've tried this:
Code: Select all
{$feu_smarty->get_user_properties($uid,'uinfo')}
<a href="uploads/certificates/cert-{$uinfo|@print_r}.pdf">Download Certificate</a>
But no matter which user is logged in, it always put 1 as the ID. Obviously I'm not getting the user ID right, but I have no idea how to do that.
Do you have any ideas?
Thanks again.
Re: FEU - Unique File Download per User
Posted: Mon Aug 19, 2013 4:34 pm
by Dr.CSS
Do you have {FEU} in that page anywhere else, there is a call for it that has silent as part of the parameter in help that may help you, also try {get_template_vars} to see if uid is available...
Re: FEU - Unique File Download per User
Posted: Mon Aug 19, 2013 4:50 pm
by mr.bacan
Dr.CSS wrote:Do you have {FEU} in that page anywhere else, there is a call for it that has silent as part of the parameter in help that may help you, also try {get_template_vars} to see if uid is available...
Thanks. I've used the {get_template_vars} and there's no uid nor any user id available. No matter which user is logged in, the info is all the same, so there's no way to have a unique id

Re: FEU - Unique File Download per User
Posted: Mon Aug 19, 2013 4:55 pm
by Dr.CSS
You checked the Help for {FEU action=silent}..?
Re: FEU - Unique File Download per User
Posted: Mon Aug 19, 2013 5:30 pm
by mr.bacan
Dr.CSS wrote:You checked the Help for {FEU action=silent}..?
I did and it's {FrontEndUsers form="silent"} but it doesn't throw any results. I then tried {FrontEndUsers action='viewuser'} and it shows the user id, name, email, etc. but as a whole so I have no idea how to get just the id.
Re: FEU - Unique File Download per User
Posted: Mon Aug 19, 2013 6:19 pm
by Jo Morg
mr.bacan wrote:Dr.CSS wrote:You checked the Help for {FEU action=silent}..?
I did and it's {FrontEndUsers form="silent"} but it doesn't throw any results. I then tried {FrontEndUsers action='viewuser'} and it shows the user id, name, email, etc. but as a whole so I have no idea how to get just the id.
It doesn't throw any results... thats what silent mean... however:
Help wrote:silent = Display nothing, but export properties and other smarty variables for the currently logged in user. If no user is logged in, then no variables are exported.
if you try a
{get_template_vars} right after you will have something to work with. For instance you'll notice that the
feu_smarty object is listed. if you use {$feu_smarty|@print_r}
while logged in on the
Frontend you will have a long list of properties and methods (actually the whole FEU module as an object can be accessed this way).
However, I usually find that using the
CustomContent module is usually easier, for a not too advanced use, and gives a lot of control on FEU and FEU specific content.
Re: FEU - Unique File Download per User
Posted: Tue Aug 20, 2013 12:30 am
by mr.bacan
Thanks Jo Morg. I'm sorry for being such a neophyte in this matter, but you led me to a solution that seems to work, at least temporarily.
What I did is:
Code: Select all
{FrontEndUsers form='silent'}
<a href="uploads/cert/cert-{$userid}.pdf">Download PDF</a>
And now I can have each user's PDF stored on a folder and call just the logged user's file.
I know is not the perfect solution but it works right now. I'm planning to work with a programmer to develop Manuel's solution, so that way you can automate the whole process.
Thanks all for your advices.