| Re: Xoops 2.3.1 - How to get addition field of users in Extended Profiles |
| by maxxy on 2009/12/29 18:23:47 Solved..here's how i did it based on the fix for yogurt+profile integration by blueteen le="color: #000000"><?php $profile_handler =& xoops_getmodulehandler('profile','profile'); $uid = intval($_GET['uid']); //get uid from url if ($uid <= 0) { if (is_object($xoopsUser)) {//if member $profile = $profile_handler->get($xoopsUser->getVar('uid'));} //get uid for the connected member else { header('location: ' . XOOPS_URL); //back to homepage - redirect wherever you want exit(); } } else { //$profile = $profile_handler->get($xoopsUser->getVar('uid')); $profile = $profile_handler->get($uid); } //if a correct uid passed to url - eg. : index.php?uid=12 //get uid passed to url to take right data from profile $gender = $profile->getVar('gender'); $xoopsTpl->assign('gender',$gender);
|
| Re: Xoops 2.3.1 - How to get addition field of users in Extended Profiles |
| by maxxy on 2009/12/29 16:50:31 The field and value is visible but its same for all profile |
| Re: Xoops 2.3.1 - How to get addition field of users in Extended Profiles |
| by alfred on 2009/12/29 16:39:05 mh, in fact, the field should be visible even without a change Check the Permission of fields |
| Re: Xoops 2.3.1 - How to get addition field of users in Extended Profiles |
| by maxxy on 2009/12/29 16:25:18 Can someone help me I'm using XOOPS 2.42 I'm trying to customize my user info template i want to display a custom field manually in my user info template (gender) here's what i did 1. in modules/profile/userinfo.php i add this line near the footer le="color: #000000"><?php $profile_handler =& xoops_getmodulehandler('profile','profile'); $profile = $profile_handler->get($xoopsUser->getVar('uid')); $gender = $profile->getVar('gender'); $xoopsTpl->assign('gender',$gender); 2. and in modules/profiles/templates/profile_userinfo.html i use le="color: #000000"><?php <{$gender}> to display the value... i viewed my profile and it showed the value of the gender but when i view other user profile its showed the same value of gender like in my profile can someone correct my code? i found this fix for yogurt+profile https://xoops.org/modules/newbb/viewtopic.php?post_id=302702#forumpost302702 how to fix this if i'm not using yogurt please help TQ |
| Re: Xoops 2.3.1 - How to get addition field of users in Extended Profiles |
| by Koeneke on 2008/11/5 14:43:10 Trabis, Thank you very much for giving me a direction! It should look like this to work le="color: #000000"><?php $profile_handler =& xoops_getmodulehandler('profile','profile'); $profile = $profile_handler->get($xoopsUser->getVar('uid')); $field = $profile->getVar('additional_field'); I hope this can help other module developers... Koeneke |