UBB.Dev
Posted By: AllenAyres Show/edit Custom Profile Field in CP - 10/17/2007 8:11 AM
Howdy,

I'm looking to show a custom profile field (#2) in the control panel's 'view user profile' screen and I need to edit/save it. Anyone else looked into something like this before I go digging myself?

smile
Posted By: Gizmo Re: Show/edit Custom Profile Field in CP - 10/17/2007 9:06 AM
I was wondering why these weren't available lol... I mean, everything else is smirk... Maybe we can have SD squeeze it in for 7.3...
Posted By: Gizmo Re: Show/edit Custom Profile Field in CP - 10/17/2007 9:10 AM
Odd, looks like so long as the custom field's name is set (as in not being blank in the member settings) it shows in the fields section of the user profile edit screen in the admin cp.
Posted By: sirdude Re: Show/edit Custom Profile Field in CP - 10/17/2007 9:10 AM
Originally Posted by Gizmo
I was wondering why these weren't available lol... I mean, everything else is smirk... Maybe we can have SD squeeze it in for 7.3...
..er it just checks for not NULL...

so fill it in and *poof* it shows..

this is how it's worked all along.. wink
Posted By: blaaskaak Re: Show/edit Custom Profile Field in CP - 10/17/2007 9:12 AM
I can edit those custom fields fine from here.

Code
if ($config['CUSTOM_FIELD_1']) {

That peace of code decides if you can edit it or not I think, just set it, and you'll be able to edit it in the membermanage section.
Posted By: AllenAyres Re: Show/edit Custom Profile Field in CP - 10/17/2007 6:38 PM
OK, thank you - I need it to remain hidden from the public/user too. I'll see what happens when I select 'hidden' on the reg screen and make it editable in the cp
Posted By: AllenAyres Re: Show/edit Custom Profile Field in CP - 10/17/2007 6:47 PM
That works, set the info above to "1" in the correct profile field and voila!
ex:
$extra2text = "1";

(for those following along it's in the /admin/showuser.php file around line #350)
Posted By: AllenAyres Re: Show/edit Custom Profile Field in CP - 10/17/2007 6:53 PM
bah, that shows it to the public in the public profile page... not going to be as easy. I'll just remove reference to that in the public profile template
Posted By: sirdude Re: Show/edit Custom Profile Field in CP - 10/18/2007 4:53 PM
yah, i did the same thing with a special field we used for 'alcatraz visits'

it was a counter for the number of times we put a user in 'jail' for being bad.

just an fyi, you have the admin notes field that is by design hidden.. wink
Posted By: blaaskaak Re: Show/edit Custom Profile Field in CP - 10/18/2007 5:44 PM
Could be very easey to do... Just empty the name of whatever custom field you want to use, and add before

Code
if ($config['CUSTOM_FIELD_1']) {

in /admin/showuser.php

Code
$config['CUSTOM_FIELD_1']="yabayabayaba";

That way it's empty everywhere else, only when you view that profile from a user from within control panel, the field would be shown.
© UBB.Developers