Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] a way to add a list of 168 city to profile fields automatically?

  • @walid3

    Participant

    hello, I added the states of my country manually in a “drop down select box” profile field, they were 27, now I want to add the cities, I could of course leave that for members to write, but I wanted it to be written in the same way and language for every user to have better search, so is there any way to copy the list of cities each in a line and it can added as profile field somehow? is there a plugin or some way to do that? this can come in handy at adding many others lists like colleges or universities in the whole country with just the list of their names.

Viewing 11 replies - 1 through 11 (of 11 total)
  • @bphelp

    Participant

    @walid3
    It would be helpful to have a list of those 168 cities in your country, preferably as a text document that could easily be pasted into some code.

    @aces

    Participant

    Maybe the technique used here for US States could be adapted for your cities: https://gist.github.com/modemlooper/5170950 ?

    For a similar way of adding Countries see https://gist.github.com/modemlooper/5043768

    @bphelp

    Participant

    @walid3 @aces
    I was thinking of suggesting something along the same lines and just adapt it for cities
    same author @modemlooper .
    Seems like this would be simpler to me anyway:
    https://gist.github.com/modemlooper/5043768

    @walid3

    Participant

    Thank you so much guys but I think it will still be time consuming to add each mark before and after every city name ( or is there a way to add them automatically too? )

    I think adding a feature like that to buddypress core would be fantastic, like an option to add a list of names instead of one by one.

    @bphelp

    Participant

    @walid3
    If you can supply a link with a list to your countries cities then I will try to help you out.

    @walid3

    Participant

    I would be thankful for that, here is the list of cities I need to add at the moment:
    http://pastebin.com/pWayVDQH

    @bphelp

    Participant

    @walid3
    Not sure about the translation but add the code in the link below to bp-custom.php
    http://pastebin.com/asjAAcru

    @walid3

    Participant

    Thanks so much for your help 🙂 also, I think about suggesting this as a feature in buddypress trac if that is available, it will be so much better adding all those kind of lists fields through admin panel. I will add the cities list for now, thank you again 🙂

    @bphelp

    Participant

    @walid3
    Glad I could help but realistically that would take a huge amount of effort for the BP Dev team to integrate every country, every state, and every city in the world into BP so I don’t think they would look too seriously at something of this nature. But then again that is just my opinion.

    @walid3

    Participant

    No, sure I didn’t mean inserting countries or cities, I was talking about adding a field in profile fields that open a box where you can paste a list of names and it populate as drop down select box, can come in handy adding every kind of lists.

    @bphelp

    Participant

    @walid3
    That sounds like a great idea that maybe you should open a ticket on this.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] a way to add a list of 168 city to profile fields automatically?’ is closed to new replies.
Skip to toolbar