PDA

View Full Version : [Release] Users Gender


Ember
01-01-2003, 12:33 AM
This has probably been done before, if so, I apologize, but I have only seen the Gender Hack, nothing that only involved a quick template edit... I thought everyone knew how to do this, but have since found people who dont, so here goes....

Go into your admin CP, scroll down to "User Profile Fields", click "add".

Title: Gender
Description: Let people on the forums know your gender.
Maximum input: 6
Field Length: 6
Field required: yes (or no, depending if you want them to do it or not)
Field hidden on profile: yes
Field editable by user: yes

Click "Save"

Now, Modify user profile fields, along the gender row, hover over the edit or the remove link, and in your status bar, take a note of the number that is at the end, after profilefieldid - mine was 6 - yours may or may not be.

Now go down to templated -> modify

and expand the list of templates you want to add the gender field too, expand Postbit Templates... and click on [edit] next to postbit.

Now simply add: Gender: $post[field6]<br> (replacing 6 with your field ID number) wherever you want to show the gender.. using the default postbit template I did it like this:

Decided to remove this cos it was unessesery and large - if you want an example, e-mail dan@twisted-designs.net


This may or may not come in handy to people, you can use it to add any profile field onto the postbit... my apologies again if this has been covered before :) PS. Its 2:40am, so if I made some mistakes let me know!

Dean C
01-01-2003, 11:42 AM
Nice simple template mod buddy :p

- miSt

Ember
01-01-2003, 11:55 AM
Well its very simple, but I kept finding people who didnt have a clue what I was talking about when I said add a profile field to the postbit, so I thought I may as well write it up :P

Dean C
01-01-2003, 12:57 PM
Yea it's quite useful i s'pose because some people use the hack..

Only problem with this is that people can put silly answers in it like "?" and "alien" "gender-bender" hehe

Know what i mean :P

- miSt

Ember
01-01-2003, 01:07 PM
Thats true, if the gender hack didnt ready exist I would create it so you could only select "male" "female" or "undisclosed" from a drop down box.. but never mind!

I wasnt going to post this as a gender modification, but I need some sort of example... its really to show people how to get a profile field into the postbit.

Dean C
01-01-2003, 02:36 PM
Yea cool :p

Tony G
01-02-2003, 10:54 AM
Not bad, why don't you use the male & female symbols instead?

Ember
01-02-2003, 01:03 PM
I'll look into it... I guess I will just do something along the lines of:

In the postbit template use PHP to replace "male" and "female" with the relevent symbols, and then I will try to work out a way to replace anything that is not male or female with n/a or something... I'll look into it :)