I got this working with XOOPS 2.0181, Yogurt 3.2rc and smartprofile 1.0 (0fficial)
this is what i do based on shiva's instruction
1. Open yogurt/index.php
find this at the end on the file
/**
* Closing the page
*/
include("../../footer.php");
?>
Before that line Add the following code
$gperm_handler = & xoops_gethandler( 'groupperm' );
$groups = is_object($xoopsUser) ? $thisUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
// Dynamic User Profiles
$thisUsergroups =& $thisUser->getGroups();
$fieldids = xoops_getmodulehandler('visibility','smartprofile')->getVisibleFields($groups, $thisUsergroups);
$profile_handler =& xoops_getmodulehandler('profile','smartprofile');
$fields =& $profile_handler->loadFields();
$profile = $profile_handler->get($thisUser->getVar('uid'));
// Add dynamic fields
foreach (array_keys($fields) as $i) {
//If field should be shown
if (in_array($fields[$i]->getVar('fieldid'), $fieldids)) {
//echo "VAL0:".$value."";
$value = $fields[$i]->getOutputValue($thisUser, $profile);
if (is_array($value)) {
$value = implode('
', array_values($value));
}
if($value){
$fieldattr=array('title' => $fields[$i]->getVar('field_title'), 'value' => $value);
$fieldname=$fields[$i]->getVar('field_name');
$xoopsTpl->assign($fieldname, $fieldattr);
}
}
}
2. open smartprofile/class/field.php and go to somewhere in line 341
replace this
function getUserVars() {
return xoops_getmodulehandler('profile')->getUserVars();
}
}
with this one
function getUserVars() {
return xoops_getmodulehandler('profile','smartprofile')->getUserVars();
}
}
3. Now you can refer to smartprofile variables in your yogurt social networking index template:
(modules/yogurt/templates/yogurt_index.html)
example if you created a field named age
put this in the yogurt index template
Age: <{$age.value}>
* make sure to set the permission for the field you created in smartprofile module
* clear templates_c and cache
* don't forget to change the link for the register.php in the login block to modules/smartprofile/register.php, and also redirect the yogurt/edituser.php or root/edituser.php to smartprofile/edituser.php
you can do this manually or by using htaccess
* also edit root/userinfo.php to make the yogurt userpage as the main userpage of your site:
Open userinfo.php in the root of your site, search at the very beggining of the file for
$uid = intval($_GET['uid']);
if ($uid <= 0) {
redirect_header('index.php', 3, _US_SELECTNG);
exit();
}
Add after this the following lines:
header("Location:".XOOPS_URL."/modules/yogurt/index.php?uid=".$uid);
exit();
thank you shiva......