Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • xKroniK13x
    Participant

    @xkronik13x

    My apologies, I’m relatively new to BP and figured it was generic database altering. I’ll have to read over that documentation, I appreciate it!


    xKroniK13x
    Participant

    @xkronik13x

    In a case like that, I would personally use a select multiple box just to make it clean. However, if you’d like to keep them checkboxes, you could put it into a scroll box. Also, you could edit the files that the plugin creates, likely called something like search-template.php, or something of the like. In there you will find where it creates the loop. If you find that section of code and post it we could take a look for you!


    xKroniK13x
    Participant

    @xkronik13x

    Could you provide a link so we can see just what you’re talking about?


    xKroniK13x
    Participant

    @xkronik13x

    I wrote this while I was tired last night, you should cleanse the input on line 15 with:
    $input = htmlspecialchars($_POST['input']);

    That should prevent SQL injections by converting quotes and other special characters into their HTML values… See here for more details.

    Any questions, feel free to ask, I’ll keep an eye on this thread for ya.


    xKroniK13x
    Participant

    @xkronik13x

    Well if you have access to a database, you can easily change the values. The coding would look something like this, I wrote it but didn’t test it. You’d need BP global enabled to fetch the User ID, and you’d also have to set the field ID to change as you needed it to, or just make a loop that iterates through all the available fields. But this will get you on the right path, I think.

    
    <?php
    if(isset($_POST['update']))
    {
    $dbhost = 'DB_HOST'; //Host of BuddyPress Database
    $dbuser = 'DB_USER'; //Username of BuddyPress Database
    $dbpass = 'DB_PASS'; //Password of BuddyPress Database
    $dbname = 'DB_NAME'; //Name of BuddyPress Database
    $field_id = '2'; //ID of the field you are updating
    $user_id = $bp->loggedin_user->userdata->ID; //Must have $bp global enabled, can probably grab the user ID in a different fashion if needed
    $conn = mysql_connect($dbhost, $dbuser, $dbpass);
    if(! $conn )
    {
      die('Could not connect: ' . mysql_error());
    }
    
    $input = $_POST['input'];
    
    //This query will update the field set with the ID set above, you could have easily change it via coding, I just made it static for ease
    $sql = "UPDATE wp_bp_xprofile_data ".
           "SET value = $input ".
           "WHERE field_id = $field_id AND user_id = $user_id" ;
    
    mysql_select_db($dbname);
    $retval = mysql_query( $sql, $conn );
    if(! $retval )
    {
      die('Could not update data: ' . mysql_error());
    }
    echo "Updated data successfully\n";
    mysql_close($conn);
    }
    else
    {
    ?>
    <form method="post" action="<?php $_PHP_SELF ?>">
    <table width="400" border="0" cellspacing="1" cellpadding="2">
    <tr>
    <td width="100">Field data:</td>
    <td><input name="input" type="text" id="input" value="<?php xprofile_get_field_data($field_id); ?>"></td>
    </tr>
    <tr>
    <tr>
    <td width="100"> </td>
    <td> </td>
    </tr>
    <tr>
    <td width="100"> </td>
    <td>
    <input name="update" type="submit" id="update" value="Update">
    </td>
    </tr>
    </table>
    </form>
    <?php
    }
    ?>

    xKroniK13x
    Participant

    @xkronik13x

    If you’re planning on hiding all access to the profile, I’d suggest just adding a link somewhere that takes you to the default edit page. It’s going to be much easier than essentially recoding the entire page – why reinvent the wheel?


    xKroniK13x
    Participant

    @xkronik13x

    It really depends on your hosting provider. My site is on a shared server and runs smooth as butter. I run a few relatively high-traffic websites (~2,000,000 page loads a month) on my portion of the server and there’s no issues. I’m also using some pretty big modifications, but as long as you get them from reputable places or code them well yourself, you won’t have a problem. A thing like Facebook share really shouldn’t effect your load times, unless the Facebook API load times are slow. This looks promising, but I never used it.


    xKroniK13x
    Participant

    @xkronik13x

    I’m honestly not sure, it was last online in August sometime.


    xKroniK13x
    Participant

    @xkronik13x

    Link is broken, hosting on my site for temporary access.

    http://coreymccown.com/images/buddypress_data_model_1_3.png


    xKroniK13x
    Participant

    @xkronik13x

    Went back to a cached version and am now hosting it on my server for ya, hopefully they fix the link!

    http://coreymccown.com/node/14


    xKroniK13x
    Participant

    @xkronik13x

    @estopero Could you post a link to your site so we can see exactly what’s going on?


    xKroniK13x
    Participant

    @xkronik13x

    This does it. I have it running on my site, but I modified the code to use a select box instead of check boxes. But this is what you’re looking for, I think.

    https://wordpress.org/plugins/buddypress-registration-groups-1/

    Or this one if you don’t want them to have a choice.

    https://wordpress.org/plugins/buddypress-auto-group-join/


    xKroniK13x
    Participant

    @xkronik13x

    I removed Ajax by changing the groups-loop.php file to have the follow <div id="pag-bottom" class="pagination no-ajax">. This made the page functionality work, but it’s not as pretty. I’d much prefer to keep ajax enabled, is there something I can do?

    However, I have found that the search feature still does not work. I’ve tried adding no-ajax to the search class as well, but that didn’t disable the ajax. I’d either like to remove all ajax, or enable it all.

    Hopefully someone can offer some input. Thank you.

Viewing 13 replies - 1 through 13 (of 13 total)
Skip to toolbar