Skip to:
Content
Pages
Categories
Search
Top
Bottom

How Do I Make A Registration Field Read From DB


  • vanleurth
    Participant

    @vanleurth

    Hi everybody,

    I have a registration page with one additional xprofile field named location.
    I would like to have that field pull data from the database instead of from the profile field values. This is, when using xprofile fields the fields can be filled manually by entering the options under the profile menu in buddypress. But instead of having the field read from an static option list I would like the field to pull the data from a db.

    This is what i’m thinking.
    1. Create register.php and put it in my child theme under buddypress
    2. Hack the register.php file using wpquery to pull values into drop down fields.

    Anyone has done this before?

    Any links or help is appreciated

    Thank you

    V.

Viewing 2 replies - 1 through 2 (of 2 total)

  • shanebp
    Moderator

    @shanebp

    1. No need to create register.php, just copy this file:
    buddypress\bp-templates\bp-legacy\buddypress\members\register.php
    into your theme/ child theme using this approach.

    Then adjust it accordingly.
    You don’t say whether ‘location’ is a required field – that will affect where in the file you make your adjustments.

    Will the values for ‘location’ change very often?
    If not, you can use code to create both the field and all the values, so you don’t have to manually enter all the values.
    And won’t have to overload register.php
    Example


    vanleurth
    Participant

    @vanleurth

    Shanebp,

    Thank you for your quick reply. Since I just wanted to remove the sidebar I realized the following;

    1. register.php is to modify the main content area within <div id=”content” >
    2. Defining page_register.php as a template and assigned it to the registrar page removes the sidebar if <?php //get_sidebar(); ?> is commented out.
    3. I can just upload all the data using the myphpadmin to upload all the locations instead of manually through bp interface

    Thank you,

    V.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How Do I Make A Registration Field Read From DB’ is closed to new replies.
Skip to toolbar