Ok, this mod is GREAT but now, how to do a search by gender?

Mod that adds a extra field to the users profile, the gender is displayed beside the posts

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Ok, this mod is GREAT but now, how to do a search by gender?

Postby [D]J on Sun 18. Jan, 2004 21:43

As the topic says, I'd like to allow my users to do a search in the memberlist page by gender, males and females. I've already added the new table Gender in my memeberlist page and is working fine but my users asked me to add something to allow a search by gender. My site got like 30000 registered users so a search by gender is going to be very useful. Anyone can help me with this? I'd really appreciate it, thanks!
[D]J
Poster
Poster
 
Posts: 20
Joined: Tue 21. Oct, 2003 10:26

Postby Niels on Fri 30. Jan, 2004 01:30

I asume you already added "part 4" as described elswhere.
so you have already the genders displayed in the memberlist.

beside this, only minor changes are need in order to allow "ordering the genders"


in memberlist.php
Code: Select all
[FIND]
$mode_types_text = array($lang['Sort_Joined'], $lang['Last_logon'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'],  $lang['Sort_Website'], $lang['Sort_Top_Ten']);
$mode_types = array('joindate', 'lastlogon', 'username', 'location', 'posts', 'email', 'website', 'topten');

[REPLACE WITH]
$mode_types_text = array($lang['Sort_Joined'], $lang['Last_logon'], $lang['Sort_Username'], $lang['Gender'],$lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'],  $lang['Sort_Website'], $lang['Sort_Top_Ten']);
$mode_types = array('joindate', 'lastlogon', 'username', 'gender','location', 'posts', 'email', 'website', 'topten');

[FIND]
case 'username':
      $order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page'];
      break;

[AFTER, ADD]
   case 'gender':
      $order_by = "user_gender $sort_order LIMIT $start, " . $board_config['topics_per_page'];
      break;

I haven't tested this, but asuming it will work
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby [D]J on Sun 01. Feb, 2004 19:40

Well Niels thank you very much for your answer but unfortunately I already had added that code you wrote sometime ago and it didn't work as I wanted... My request is more complex. The code you posted adds a new field "Gender" in the search list (where there are also "Registration Date", "Top 10 authors", "E-mail" etc.) and when I select it and press the "Order" button I get the user listed according to the ASC and DESC thing. If I choosed ASC I get first all the male users in the first pages followed by female users in the latest pages. With DESC it's just viceversa. This is very confusing.... My users asked me to add something like 2 new fields in the search list like "Males" and "Females" where I ONLY get displayed males or females.
[D]J
Poster
Poster
 
Posts: 20
Joined: Tue 21. Oct, 2003 10:26

Postby Niels on Sun 01. Feb, 2004 21:56

that would require some more work.
I can't provide that code right now, as I have other stuff to do - sorry
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby [D]J on Mon 02. Feb, 2004 19:56

don't worry I wrote the code by myself and it works like a charm, thanks anyways
[D]J
Poster
Poster
 
Posts: 20
Joined: Tue 21. Oct, 2003 10:26

Postby Niels on Tue 03. Feb, 2004 16:26

you could consider posting a "HOW-TO" for sutch ADD-ON so other users in need of the same solution could bennefit from your work :D

do so in a new topic, and post a link to this topic here
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby donnie-d on Thu 01. Apr, 2004 16:14

Can you please post what you did? Please share the knowledge :)
donnie-d
Poster
Poster
 
Posts: 43
Joined: Tue 11. Nov, 2003 01:48

Postby donnie-d on Wed 21. Apr, 2004 16:41

Any luck on this?
donnie-d
Poster
Poster
 
Posts: 43
Joined: Tue 11. Nov, 2003 01:48

Next

Return to Gender [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron