Page 1 of 1

Combine FEU and downloadmanager [solved]

Posted: Wed Apr 17, 2013 10:30 am
by vhaakman
Hi there,

I want to use downloadmanager in combination with FEU, so that a logged in person gets his own downloads. I mean personal files here, which may vary per user.

Now this - I think - isnt possible out of the box. If I give each user his own group within FEU, it seems possible, but besides that's not really wanted, it shows all files to all, the restriction is you can only download it, if it's yours. I don't want the others to see it.

So I thought of this. What if I make a field in FEU, the value I give that field, will be the same as the categoriename in Downloadmanager. That would solve it, and make a nice clean solution.

The only thing is, how do I call Downloadmanager from a page, so it shows the category equal to the value in the field of the logged in user?

Any help would be very much appreciated. Other working solutions are very welcome as well.

Thanks, Vincent

Re: Combine FEU and downloadmanager

Posted: Wed Apr 17, 2013 7:34 pm
by vhaakman
So what I want is something like this:

{cms_module module='DownloadManager' alias='$smarty->get_template_vars('username')'}

So I wrote a utd like this:

$username = $smarty->get_template_vars('username');
$smarty->assign('username', $username);

and placed this on my page:

{get_user_email}
{$username}
{cms_module module='DownloadManager' alias=$username}

Next to that I made a categorie with the emailaddres of the user.

The result is Downloadmanager stating that there is no such categorie, and above that the emailaddres, which is the same as the categoryname. So the UTD works. How to get alias to work?

Any help would be appreciated.

Re: Combine FEU and downloadmanager

Posted: Wed Apr 17, 2013 9:57 pm
by vhaakman
Found the solution, in the alias the @ and . were replaced by -
Did the same in UDT, and it works:

$username = $smarty->get_template_vars('username');

$username = str_replace("@", "-", $username);
$username = str_replace(".", "-", $username);

$smarty->assign('username', $username);

Hope this helps someone else as well.