News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Search for Members by Location

Started by schoolclubsforum, January 22, 2018, 11:39:19 AM

Previous topic - Next topic

schoolclubsforum

Is it possible to search for members by "location" on the Member Search page?

On the Member Search page, I can search by name,website,email,position,messenger nickname.
Which files could I edit to allow me to add the option to search by location?

I don't need the messenger nickname option. Could I edit that in some way to be location?

I am trying to allow members to search for others who are based near them.

I could not find a mod that would do this. Is it possible to do what I am asking for?
I looked at memberlist.php but could not work out what I could change.

Thanks for any advice.

pepa

Hi schoolclubsforum

I'm pretty new to SMF so maybe not the best person to help, but I've had such wonderful help here I'd like to contribute when I can.

If you set some custom profile fields here -> Admin/Configuration/Features and Options/Profile Fields and set them up right e.g. check second last option Searchable ... Can this field be searched from the members list.

The additional fields will the appear in your members search box.  One problem though ... these will only appear for members who register from that point on.  For members who are already registered you would have to manually input the information into the field in their forum profile.

Also it appears as though you can't search on profile fields that are of type "Select Box" as that option doesn't appear when you set up a select box field.  Good question though, I'll ask it in a separate post as I have a select box field I'd like to search on.

I have attached a screen shot of my members search box showing some profile 'location fields' so you can see what I mean.


schoolclubsforum

Thanks Pepa. That's really helpful and I will implement that.

It would still be good to know if the standard profile fields can be searchable too. In particular "location" as I have a lot of members registered and using that profile field already and would like to be able to search on it.

Appreciate your advice Pepa. Nice and clear, and works too.

pepa

Quote from: schoolclubsforum on January 23, 2018, 05:04:07 AM
Thanks Pepa. That's really helpful and I will implement that.

It would still be good to know if the standard profile fields can be searchable too. In particular "location" as I have a lot of members registered and using that profile field already and would like to be able to search on it.

Appreciate your advice Pepa. Nice and clear, and works too.

My pleasure schoolclubsforum : ).  It occurs to me that Location is an optional field that users can enter, when they do so and click save that info must be stored in the MySQL DB, so it should be able to be searched.  Someone with more knowledge of the underlying code should be able to sort that issue for you.  If you know some php have a look in Memberlist.template.php the code for searching members is in there.

pepa

One last thing ... forgot to mention that first you need to activate Custom Profile Fields.  To do that go here:
Admin -> Core Features -> Advanced Profile Fields

landyvlad

The best option that I can recommend is a mod called 'Google Member Map'

People put a pin in their location and other members can then see who is close on the map !

Seriously it's just awesome for what you describe.

Mod link: https://custom.simplemachines.org/mods/index.php?mod=4128

not sure if as a guest you could see this, but here's how it looks when done
http://gsx1400owners.org/forum/index.php?action=googlemap
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

pepa

Quote from: landyvlad on January 24, 2018, 08:42:25 PM
The best option that I can recommend is a mod called 'Google Member Map'

People put a pin in their location and other members can then see who is close on the map !

Mod link: https://custom.simplemachines.org/mods/index.php?mod=4128

Hi landyvlad

Yes that's a useful mod although depends upon your requirements.  In my case I need the information for every user. I believe the mod option makes the information optional (although I could be wrong).  For me the only way to certainty was to create the profile field(s) and make them required on account registration.

aegersz

if that option presents problems then maybe chat to this mod author as he wants to collect the data that may help you:

https://www.simplemachines.org/community/index.php?topic=532276

maybe you guys can work something useful out - by city, state etc. location data can be retrieved from people's phones who interact with the forum and the marketing and trading ramifications sound like an exciting dimension to "forumware".

good luck !
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Aleksi "Lex" Kilpinen

This is an old mod, but the idea and existing code might also be of use to you
Custom Fields On Memberlist
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

schoolclubsforum

Thank you for the link to that mod on Custom Fields on Memberlist.
I looked at it but there are lots of reports of it causing errors.
A member had produced a fix that works but the SMF team have deleted that as it was not produced by the mod author.
I am not knowledgeable enough to fix the errors that are reported and the person who produced the fix no longer seems to be active here.

It would be a great solution if the original author would support the mod.

Thanks for the suggestion.

Aleksi "Lex" Kilpinen

I haven't tried to make it work myself, but thought it shouldn't be too difficult to at least get an idea of how it is supposed to work,
and perhaps someone might be able to fix it for 2.0.15. It does seem like other people have been working on it too.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: