57
I couldn't get any fields showing in the registration form either...So I had to try come up with a fix.
I'm using the PHP 4 adapted version found on xoobs.net
What I did to get the fields to work is the following:
In the modules/smartprofile/register.php assign() function it seemed like the "$tpl" var wasn't passed forward as "$xoopsTpl" (don't know the technical language).
So what I did in the function was simply to add "global $xoopsTpl;" and then change the $tpl->assign to $xoopsTpl->assign
The function now looks as following:
function assign($form, $tpl) {
global $xoopsTpl;
$i = 0;
$elements = array();
foreach ( $form->getElements() as $ele ) {
if (is_a($ele,'XoopsFormElement')) {
$n = ($ele->getName() != "") ? $ele->getName() : $i;
$elements[$n]['name'] = $ele->getName();
$elements[$n]['caption'] = $ele->getCaption();
$elements[$n]['body'] = $ele->render();
$elements[$n]['hidden'] = $ele->isHidden();
if ($ele->getDescription() != '') {
$elements[$n]['description'] = $ele->getDescription();
}
}
$i++;
}
$js = $form->renderValidationJS();
$xoopsTpl->assign($form->getName(), array('title' => $form->getTitle(), 'name' => $form->getName(), 'action' => $form->getAction(), 'method' => $form->getMethod(), 'extra' => 'onsubmit="return xoopsFormValidate_'.$form->getName().'();"'.$form->getExtra(), 'javascript' => $js, 'elements' => $elements));
}
and now the fields are showing up properly in the registration form.