PDA

View Full Version : Unfilled fields in Profile not displayed...


tpearl5
26 Aug 2001, 02:27
Can this be done?

tubedogg
26 Aug 2001, 02:59
On which page?

tpearl5
26 Aug 2001, 03:06
More specifically, on the member profile pages in custom and normal fields which are not required and are not filled in by the user.

tubedogg
26 Aug 2001, 03:32
Yep, it's possible. You'll have to create templates for each that you want to show/not show and copy out the info from the getinfo template for that row and add a bit to member.php.

For example, if I don't want Location to show if it's empty, I'd do the following:
1) Create a new template called getinfo_location with the following in it:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


2) If this field was already in the getinfo template (this was a slightly bad example cause it's a custom field that falls under the guise of $customfields in the getinfo template) I'd remove the whole row from the template and replace it with $userinfo[location] - but in this case we just need to add $userinfo[location] somewhere in the getinfo template.
3) In member.php find


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


and add right after it


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Just repeat for any other things you want to display/not display.

tpearl5
26 Aug 2001, 03:42
Seems easy enough! I'll try that out tomorrow when I'm awake. This should be a new feature for 2.1 ! No doubt...

Weasel
29 Dec 2001, 15:21
That's not easy, in fact thats the most hacked-up slackjaw thing i ever saw. Isn't there a way that will work for ALL fields? :confused:

Tim Wheatley
31 Aug 2002, 17:35
This is what I've put in my functions.php:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Then make three new templates, postbit_location, postbit_posts and postbit_registered.

All they should contain is (example):


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



What all the above does it makes the stats within postbit invisible when someone hasn't made any posts, hasn't filled in a location, or is a guest (so of course hasn't filled any of the info in).

Boofo
31 Aug 2002, 19:17
There's a hack out just for the customfields not showing up in the profile page if they are empty. It is by AFTERLAB and the hack is called "Hide Unentered Fields".

Chris M
31 Aug 2002, 19:43
Thank you Boofo:)

Satan

Boofo
31 Aug 2002, 20:11
You're welcome there, Chris. ;)

Originally posted by hellsatan
Thank you Boofo:)

Satan