Adding new cities

Discussion in 'Troubleshooting' started by moonwalker, Dec 16, 2010.

  1. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    Hi there,

    Still working on my website and I just noticed that some cities are not added to the cities table.

    I know how to add them manually into the database, but I don't want to lose them when updating the software in the future.

    Is it safe to just add some new cities into the database? Is the cities table regularly updated by the developers?

    Thanks in advance.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Sorry not sure I understand what you mean. There is no cities table in aMember by default.
  3. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Probably referring to the "States" table
  4. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    I meant the amember_states table. Sorry, my bad.
  5. deafdavid

    deafdavid Member

    Joined:
    Aug 28, 2006
    Messages:
    153
    I was wondering the other day -- is it possible if our member enters their zip code, the city and state will be added to the sign-in form automatic? While I understand there's no city table, but this can be created only when people fill in the city and state.

    For example, I may type in 20515, and if there's no match in the city table, the member can go ahead and add the city and state. This will be entered into city table. When a future new member join us, he/she enter 20515, the city and state will automatic show up on the form.

    Do-able????
  6. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    It's do-able with AJAX, but I think you need to modify a lot of codes to achieve that.

    In pseudo code:
    OnKeyUp launch an AJAX function to retrieve data from the database. Check if the zipcode already exists in the database. If so, select the corresponding city/state and add them to the form. If not, do nothing.

    This is simple when you're using input fields for both city/state. But if you're using SELECT fields, it's a little bit tricky to change the value on the fly. Maybe you should take a look at jQuery. ;)

    Good luck with it.


    Btw...I'm still waiting for an answer to my question. :D
  7. deafdavid

    deafdavid Member

    Joined:
    Aug 28, 2006
    Messages:
    153
    Maybe this will be possible with next major aMember upgrade. I read somewhere it'll be much more flexible and easy create some additional features. Maybe a plugin would do the trick. I'll wait for the upgrade and follow up.


    I believe you're asking about the state table? It's already available. But with my limited understanding about how aMember works, I may be wrong.
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    moonwalker,
    Sure you can add states to database without a problem. Values will not be overwrited on upgrades.
    deafdavid,
    This is possible but will require a moderation functionality to be implemented as well.
    Well add this to todo list.
  9. moonwalker

    moonwalker aMember Pro Customer

    Joined:
    Aug 21, 2010
    Messages:
    52
    @Alexander:
    Thanks a million.
    I'm very excited about the new version of amember. Sounds interesting.

    @deafdavid:
    We'll have to wait then. :)

Share This Page