Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
9 - 6 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

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


Who's Online

78 user(s) are online (58 user(s) are browsing Support Forums)


Members: 0


Guests: 78


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits