Having an issue with FEU Module, perhaps I am really having a PHP/Smarty issue, would appreciate some kind reflection ...
I have an enrollment form that upon submit calls index.php?mact=FrontEndUsers,cntnt01,do_adduser,1
In modules\FrontEndUsers\action.do_adduser.php I added the following line to set the smarty variable with the input transferred from the user submitted form:
$smarty->assign('feu_user', $params['feu_input_username']);
Now where it gets interesting, I pass control forward to another page, which collects some credit card information and attempts to transmit information to the credit card processor, but I need a bunch of variables from FEU database, and create a transaction hash that I have to pass with the data, so I do it all in a UDT (I never wanted to edit the action.do_adduser.php but did so as a last resort) ... so my UDT follows:
global $gCms;
$smarty = &$gCms->GetSmarty();
$username = $smarty->get_template_vars('feu_user');
echo ('got the user name' . $username);
$feusers = $gCms->modules['FrontEndUsers']['object'];
$uid = $feusers->GetUserID($username);
$properties = $feusers->GetUserProperties($uid);
foreach($properties as $key=>$value) {
if ($value["title"] == "country") {
$country = $value["data"];
}
if ($value["title"] == "Payment_Cycle") {
$batchday = $value["data"];
}
if ($value["title"] == "firstname") {
$first_name = $value["data"];
}
if ($value["title"] == "lastname") {
$last_name = $value["data"];
}
}
But, my echo is blank, and obviously my $feusers->GetUserProperties($uid) blows up ...
So any thoughts as to why when I try to get the $smarty variable that I set in the PHP that its blank?
Thanks
Doug
FEU, passing smarty variables, UDT
- suthex
- New Member
- Posts: 8
- Joined: Mon Jul 20, 2009 11:00 pm
- Location: Proudly Sitting in a Chair somewhere in Canada
FEU, passing smarty variables, UDT
We've been building kick-ass online sites using CMS Made Simple since 2008.
Re: FEU, passing smarty variables, UDT
I have the same problem.
What's the solution?
Thanks
What's the solution?
Thanks
Re: FEU, passing smarty variables, UDT
Have you considered module "CustomContent"?
http://forum.cmsmadesimple.org/index.ph ... #msg189991
http://forum.cmsmadesimple.org/index.ph ... #msg189991
- suthex
- New Member
- Posts: 8
- Joined: Mon Jul 20, 2009 11:00 pm
- Location: Proudly Sitting in a Chair somewhere in Canada
{RESOLVED] Re: FEU, passing smarty variables, UDT
Thanks for the guidance ... in the end ... bad coding on my part ...
global $gCms;
$username = $gCms->smarty->get_template_vars('feu_user');
worked like a charm.
global $gCms;
$username = $gCms->smarty->get_template_vars('feu_user');
worked like a charm.
We've been building kick-ass online sites using CMS Made Simple since 2008.