Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 3,101 through 3,125 (of 3,608 total)
  • Author
    Search Results
  • #63117
    peterverkooijen
    Participant

    I need to figure this out as well. The xprofile fields are generated (?) with a loop from an array. It looks almost impossible to do anything with a specific xprofile field if you are not an advanced PHP whiz.

    Or could you just hard code the registration fields on register.php, instead of using the ‘profile field loop’? And then use field_2 and field_3 to “do stuff” with? Are there any serious downsides to that to watch out for?

    #62814
    sweller
    Participant

    I’d like to open this one back up. The project is for a local recycling program and I’m having trouble with a form for members to schedule pickups on the profile/index page. It calls XProfile address fields and tomorrow’s date for the default values, and should insert them into a custom table. The plugin creates a table and pulls the xprofile data fine, but nothing is reaching the database. I’ve tried every possible variation based on the bp-core and Travel-Junkie’s example above, but nothing is working.

    Here’s the plugin:

    <?php
    /*
    Plugin Name: Collection Records
    Plugin URI: -
    Description: Adds a table and page for listing and editing Recylable Collections.
    Version: 1.0
    */

    function collect_install_table() {
    global $wpdb;
    global $bp;

    if ( !empty($wpdb->charset) )
    $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";

    $table_name = $wpdb->prefix . 'collections';
    if($wpdb->get_var("show tables like '$table_name'") != $table_name) {

    $sql = "CREATE TABLE " . $table_name . " (
    id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    sched_date datetime NOT NULL,
    post_date datetime NOT NULL,
    user_id bigint(20) UNSIGNED NOT NULL,
    address_line_1 varchar(150) NOT NULL,
    address_line_2 varchar(150) NOT NULL,
    town varchar(150) NOT NULL,
    state varchar(150) NOT NULL,
    zip_code varchar(150) NOT NULL,
    amount bigint(20) DEFAULT '0' NOT NULL,
    verified tinyint(1) DEFAULT '1' NOT NULL,
    paid tinyint(1) DEFAULT '1' NOT NULL,
    KEY user_id (user_id)
    ) {$charset_collate};";

    require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    dbDelta($sql);
    }
    }

    /*Launch database*/
    register_activation_hook(__FILE__,'collect_install_table');

    function bp_collections() {
    global $wpdb;
    global $bp;

    /* bp_is_home() Checks to make sure the current user being viewed equals the logged in user */

    if ( !bp_is_home() && !is_site_admin() )
    return false;

    /* Check for new information*/
    if( isset($_POST['go'] ))
    {
    /* Check the nonce */

    check_admin_referer( 'schedule_collect' );

    if( $_POST['sched_date'] && ! $_POST['address_line_1'] || ! $_POST['sched_date'] && $_POST['address_line_1'] )
    {
    bp_core_add_message( __( 'We need a time and a place!', 'buddypress' ), 'error' );
    $error = true;
    }

    if( ! $error )
    {
    $user_id = $bp->loggedin_user->id;

    if( isset( $_POST['address_line_2'] ) ) {
    $address_line_2 = $_POST['address_line_2'];
    }

    $result = $wpdb->query( $wpdb->prepare("
    INSERT INTO $wpdb->1_collections
    ( sched_date, post_date, user_id, address_line_1, address_line_2, town, state, zip_code )
    VALUES ( %s, %s, %d, %s, %s, %s, %s, %s )",
    $_POST['sched_date'], $_POST['post_date'], $user_id, $_POST['address_line_1'], $address_line_2, $_POST['town'], $_POST['state'], $_POST['zip_code'] ) );

    /* Set the feedback messages */
    if ( $errors )
    bp_core_add_message( __( 'There was a problem calling your pickup, please try again.', 'buddypress' ), 'error' );
    else
    bp_core_add_message( __( 'Thanks for calling a recycling pickup.', 'buddypress' ) );

    }

    bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'profile/index' ) );
    }
    }
    /* Function to call xprofile Address label */

    function collections_xprofile( $field ) {
    echo bp_collections_get_member_list_xprofile_data( $field );
    }
    function bp_collections_get_member_list_xprofile_data( $field ) {
    global $bp, $site_members_template;
    return xprofile_get_field_data( $field, $site_members_template->member->id );
    }

    ?>

    And the form:

    <?php if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

    <form action="" method="post" id="oncall" class="oncall">

    <label for="address">At</label>
    <input type="text" name="address_line_1" id="address_line_1" value="<?php echo bp_collections_get_member_list_xprofile_data('Address Line 1') ?>" />
    <input type="text" name="address_line_2" id="address_line_2" value="<?php echo bp_collections_get_member_list_xprofile_data('Address Line 2') ?>" />
    <input type="text" name="town" id="town" value="<?php echo bp_collections_get_member_list_xprofile_data('Town') ?>" />
    <input type="hidden" name="state" id="state" value="MS" />
    <input type="" name="zip_code" id="zip_code" value="<?php echo bp_collections_get_member_list_xprofile_data('Zip Code') ?>" />
    <br />
    <label for="date">On</label>
    <input type="text" name="sched_date" id="sched_date" value="<?php $tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y")); echo date("Y/m/d", $tomorrow); ?>" />

    <input type="submit" name="go" id="go" value="go"/>
    <input type="hidden" name="post_date" id="post_date" value="<?php $my_t=getdate(date("U")); print("$my_t[weekday], $my_t[month] $my_t[mday], $my_t[year]"); ?> " />

    <?php wp_nonce_field( 'schedule_collect' ) ?>
    </form>
    <?php endwhile; endif; ?>

    It has to be something simple but I’m lost. I’d really appreciate it if someone could take a minute and tell me what’s wrong with the code.

    #62795
    Windhamdavid
    Participant

    Yeah, you can do that. It will take some work. Just add in all the profile fields you’d like to use for the ‘business listing’ and then display those fields in a directory of sorts using custom template files. Or you could style up a member ‘blog’ theme that is formatted as a ‘listing’ with maybe some edit in place ajax functionality that’ll allow a member to enter their business info and restricts them from doing anything else. That way you could use sitewide queries to build a directory of these ‘listings’. I can’t say there’s a cut and paste sorta plugin to achieve this, but the best place to start would be here and here.

    #62456
    Nick Watson
    Participant

    Does anyone know how to implement this into the profile fields on buddypress?

    #62347
    @mercime
    Participant

    ========== Continued ==========

    Using 1.2 bp-default theme. Based on roles set in classified settings page, I allowed contributors upward to post classified ads.

    Posting Classified Ads from BP frontend

    1. Clicked on Classifieds on Main Nav.

    2. In Classified Ads Directory Page – click on Create A Classified

    2.1 – Classified Details – page has fields for Title and Description, then click on “Create Classified and Continue

    2.2 – Classified Setttings – page has list of categories created per classified component instruction via special new blog and field box where you could add tags, and click on “Next Step”

    2.3 – Classified Invites – page where you can send invites to other members re classifieds, click on “Finish”

    Classified Ad Entry posted appears in Classified Ad Directory Page. The ad was also posted on the special new blog as post entry per my check. In addition, under member Profile Page, there’s now a link “My Classifieds” listing all entries posted in Classified Ads.

    Posted Classified Entry from Special Blog Created for the plugin component

    – Tested posting from the special blog to see if it appears in the BP-installed site. It Does.

    Also, when you post the listing from the special blog, the tags show up in the Classified Directory Page and in single Classified Ad Entry page

    Other Notes:

    1. Classified Ad Entries do not appear in Activity Streams of Member nor Home Page

    2. Site Admin should delete Hello World first post in new private blog set up for classifieds – if not configured to delete before

    3, Created Blog for Classifieds plugin Settings > Privacy was set to Block Google but allow online visitors – but the special blog is showing up in Blogs Directory even when Site Admin is logged out.

    4. Single page for a Classified Ad Entry – does not have navigation back to list of classifieds or have a “Reply” field box for possible interested clients.

    5. Categories chosen and Tags added during set up of Classified Ad Entry, are not showing up anywhere in Classified Directory Page or single page of the Classified Entry.

    6. Feature Request: ability to upload even a small single 150×150 image to go along with the classified ad entry.

    Great job, Grosbouff. Thank you for continuing development on this component. Really Cool.

    #62262
    katemgilbert
    Participant

    @lightcapturer – Yes, I found where to edit profile fields. Thanks much! I am wondering about pre-built fields now.

    #62203
    D Cartwright
    Participant

    Has the db format changed that much for xprofile stuff from bp 1.0 to 1.2? I kind of got the impression that xprofile is something that has been on the back-burner for a while, what with lots of other features getting more attention (which is fine by me).

    If this is the case you could try creating fields in seperate 1.0 install and then exporting the mysql + importing it into your 1.2 install.

    I’m not sure if this is worse practice than install 1.0 and upgrading, but I personally don’t really like the idea of installing a very old version of BP on a system and later upgrading it. It feels ‘cleaner’ to just go straight to 1.2 :)

    #62201
    r-a-y
    Keymaster

    It’s not in BP 1.2, and there’s no plugin I’m aware of that can add x-profile fields <i>en mass</i>.

    Maybe in BP 1.3? Unless you want to use BP 1.0 and then upgrade to BP 1.2 :)

    #62092
    designodyssey
    Participant

    @symm2112

    I’m looking to do something similar in having login/register on the same page. That should be simple, but not sure about the profile fields piece. I’m need to implement different registrations for different “types” of users. I can do this with different pages with hidden input fields. Not sure how to work this with different profile questions yet though. Keep us abreast of your progress.

    #62046
    symm2112
    Participant

    I have it loaded and it works for creating users but I’m debating on where and how to include the login field. I’d like to take it off and disable wp-login.php and have it added to the bp register page but I’m still not quite sure if that will work and still have them fill out their profile fields. Any suggestions? Also, if anyone knows what code needs to be put on the register template to include the same gigya login box that appears on the wp-login.php, i’d be really grateful.

    #62021
    peterverkooijen
    Participant

    Thanks Devrim. How do I “run” this? Would putting it into bp-custom.php take care of it? I know how to run a SQL query in phpMyAdmin. That’s essentially what this is, right?

    Is there a reason not to try this manually in phpMyAdmin? Is the group_id field connected to/dependant on other fields that are easy to overlook?

    #62017
    Devrim
    Participant

    Hi Peter, I had the same problem, here is the code that will move everything from group_id 1 to group_id 3

    Check the id of the secondary group and change the number 3.

    require_once(‘wp-blog-header.php’);

    $x = $wpdb->get_results(“SELECT * FROM wp_bp_xprofile_fields WHERE group_id=1 and is_required=0”);

    foreach($x as $k=>$v){

    $wpdb->update(‘wp_bp_xprofile_fields’,array(‘group_id’=>3),array(‘id’=>$v->id));

    }

    #61999

    In reply to: Custom Signup Fields

    hardlyneutral
    Participant

    Update: Looks like the field needs to exist in wp_bp_xprofile_fields. I manually added it, but it would be nice to figure out how to do it dynamically.

    #61797
    Nick Watson
    Participant

    By the way, I have no idea why there are all those breaks. Ignore all the breaks in the code:

    this is the real code

    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    <?php if ( bp_get_the_profile_field_name() == 'Gender' ) {
    if ( bp_get_the_profile_field_value() == 'Male' )
    echo '<img src="male.jpg" alt="male" title="Male" />';
    }
    ?>
    etc etc etc
    rest of the code

    #61793
    Nick Watson
    Participant

    I trust your code works, but I think I just have no idea what I’m doing.

    This is what my code looks like:

    <br />
    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?><br />
    <?php if ( bp_get_the_profile_field_name() == 'Gender' ) {<br />
    if ( bp_get_the_profile_field_value() == 'Male' )<br />
    echo '<img src="male.jpg" alt="male" title="Male" />';<br />
    }<br />
    ?><br />
    etc etc etc<br />
    rest of the code<br />

    (I’ve tried with both lowercase and uppercase fields)

    I’m just using the Gender one to test this out, I’ve tested it with all these other ones but none of them are working.

    What am I doing wrong.

    #61791
    designodyssey
    Participant

    @JJJ

    First, is it jjj or JJJ?

    Second, is there some way to use the usermeta solution for groups?

    Also, I want to change the display of everything (dropdowns, menus, labels, etc.) to account for the different user types (e.g. teachers, students, parents). That would also need to be the case for groups (e.g. classrooms, schools, departments). How would you suggest going about this?

    Thanks

    #61785
    Nick Watson
    Participant

    bp_the_profile_field_value displays ALL of the values of the fields within the group, and

    bp_the_profile_field_name displays ALL of the names of the fields within the group.

    I tried what you said with the <?php if ( bp_the_profile_field_name() == ‘color’ ) {

    but that still just continues to display ALL of the fields. (And yes I changed the ‘color’ to the proper field name)

    Anyone have ideas on how to get a profile fields output to display a picture instead of the text?

    #61737

    Newer versions of BP along with newer templates and MU have solved this by moving those hooks and actions into the template, and BP hijacks the registration before it happens.

    It’s happening because of an outdated theme arrangement. I’m going through something similar also at the moment and will be tracking this down shortly.

    @wekko, the reason those fields aren’t entered right away is because a registered user isn’t an actual activated user yet. They need to click the link or be activated by the site admin in order to actually get entered into the user tables. In either case, that xprofile data is moved into the xprofile tables when the activation occurs, not when they register.

    #61735
    wekko
    Participant

    I found the answer. It’s not Buddypress, it’s WordPress MU. See: https://mu.wordpress.org/forums/topic/15324 . Apparently, wp-activate.php doesn’t load the Buddypress login including the hooks. Weird thing it doesn’t happen to everyone..

    #61685
    Tracedef
    Participant

    Do follow is also a great way to encourage users to create and fill out a profile, specifically if you create custom fields for their “websites” in their profile. Spam registrations are already a major issue ( at least for us ) so that isn’t much of a deterrent for us at least.

    #61674
    Boone Gorges
    Keymaster

    The code that I listed will not work as is. You have to make sure that you fill in the correct filenames for images, the correct desired values for profile fields, and the correct field names. Also it looks like I messed up and forgot at least one parenthesis. That’s why I said you’d need to tweak it. It should give you an idea of which functions to use, though.

    #61662
    danbpfr
    Participant

    You can search here for answers :

    https://trac.buddypress.org/report

    #61654
    wekko
    Participant

    Well, that makes sense. Still, if it’s a bug and it’s fixed in newer versions…someone should know about it right? :)

    #61640
    Boone Gorges
    Keymaster

    In [your-bp-theme-dir]/members/single/profile/profile-loop.php, you’ll see a profile loop beginning while ( bp_profile_fields() ) : bp_the_profile_field();. Inside of that profile loop you will be able to use various profile functions to test values. For instance,

    <?php if ( bp_the_profile_field_name() == 'color' ) {
    if ( bp_the_profile_field_value() == 'red' )
    echo '<img src="redbadge.png" />';
    if ( bp_the_profile_field_value() == 'green'
    echo '<img src="greenbadge.png" />';
    // etc.
    }
    ?>

    I have not tested this but it should work fine with some tweaking.

    Your issue with appearance is a CSS thing, most likely that the ul elements are set to display: inline. Try setting them to display: block.

    #61633
    peterverkooijen
    Participant

    There was a new blunt solution here. Apparently having a couple of required custom profile fields also cuts down spam.

Viewing 25 results - 3,101 through 3,125 (of 3,608 total)
Skip to toolbar