Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'private'

Viewing 25 results - 1,926 through 1,950 (of 5,233 total)
  • Author
    Search Results
  • ianfindlay
    Participant

    I have been messing about with buddypress for a while now and I am hoping to start a whole new business based on a website for people connecting together(using buddyypress)

    Currently I am no where near ready to launch and is wordpress + buddypress with a bunch of other plugins and layouts I am trying out. I have a couple of questions so far that although I have found information on, its outdated or not very clear. Please be aware I can tinker about with code buy I am no coder.

    Newsletter/Mass Message Users
    Is there a way to send out a newsletter to all members email addresses? Or the alternative being sending them a mass private message that they see and get a email notification about? If not then what is my options for integrating something like mailchimp to the registration process with a checkbox?

    Profile Views
    Who is looking at your profile, how many times etc. Currently I have only found “YD Profile Visitor Tracker” is there anything else out there?

    Media Files
    I am wanting to add the ability of adding media files to activity updates, rtmedia is the best I have found, any other options?

    Social Network Only
    I really want this to be more like a social network rather than somewhere to have discussions in groups. Can groups just be somewhere to list members rather than post any activity within them? Or can this be restricted to admin users only?

    Finally – Ideas Wall
    For example http://www.wedundee.com/view-thoughts/ – This website lets users submit there thoughts and it is displayed in a nice decorative wall. Is there anything similar (wordpress/buddypress) can achieve? Would be good to see users of my site be able to share those ideas, comment and “like” those ideas.

    #178602

    In reply to: Join Group

    mrjarbenne
    Participant

    If you make the other groups Private or Hidden, users can only join the one group you have left Public. You’ll need to provide more detail if you are looking for something different than that.

    lonepalmus
    Participant

    Hi guys,

    My first time writing here – hoping someone can point me in the right direction:

    I am using buddypress 1.9.2 with wordpress 3.8.1 (no link atm, as it is localhost).

    Is it possible in any way to have a page showing both sent and received messages? Kind of like Facebook – if i’ve sent a message and there’s no reply yet, i will still see my own.

    I’ve looked into bp_has_message_threads() in messages-loop.php, but there doesn’t seem to be an option to show &box=’all’ (only inbox, sentbox or notices.)

    Really hoping someone has some input. Do I have to change the way the messages are stored perhaps?

    #178176
    slips111
    Participant

    No, and I’ve disabled all plugins to verify. Nothing else has been touched except CSS.

    Also just noticed: actually, it’s only a problem in my one “private” group. Strange. Does that sound like a bug? Anybody else seeing this?

    #178050
    johnsag
    Participant

    I’m back to exploring Buddypress, and I am experimenting with an install. I’d like to have a linkable public profile for the members without all this sort of information:

    @johnmc
    active 3 minutes ago
    Add Friend
    Public Message
    Private Message
    Activity
    Profile
    Notifications 0
    Friends 0
    Groups 0
    Forums
    Settings
    View
    Edit
    Change Avatar

    But only select fields (description, publications etc). I see a lot of technical info about customizing files etc when I search for this, some of it rather old. Is there perhaps a plugin that allow me to remove all this (to me) irrelevant information for non-logged-in users? It may well be there for the users when they are logged in. Perhaps it might be easier to simply create ordinary text-files for each user presentation that they can edit themselves.

    #178025
    dhaine
    Participant

    Hello

    WP 3.8
    BP 1.9.2
    Friends and private message buttons disappeard.
    It was working fine with 1.7
    I know it’s an issue related to my custom theme, the buttons are fine with default themes.
    Any idea what I can do ?
    I think it’s related to this buddypress bug :
    https://buddypress.trac.wordpress.org/ticket/5170
    I have some buddypress calls in my header, which makes the rest of the calls not working.
    I’m not a dev but I know how to edit files.
    I tried to edit the files from the changhes in the patch that it didn’t work out, maybe it was me who did not do it correctly
    My custom theme developer is looking into it but it’s a pro team and they are very busy, if I can do it myself maybe it would be nice 🙂 Any suggestions ? Should I try again to do the edit from patch2 ?

    http://www.warlegend.net/members/loloderp/

    #178009
    mtedv
    Participant

    Update:
    A group join works. It is just in private groups.

    The errorlog doesn’t say anything at all 🙁

    #178007
    mtedv
    Participant

    Hi,

    i have a problem with private groups / requesting membership to them.

    As soon as i want to request the membership, i get an 404 – page not found.

    Everything else just works fine ..

    While looking for the error, i found that the link should go to e.g.
    http://www.xy.de/community/groups/testgroup/request-membership?_wpnonce=54457079e4
    On opening it changes to:
    http://www.xy.de/community/groups/testgroup/request-membership/?_wpnonce=54457079e4

    Difference: The slash before the GET-Parameter. Could this be the problem? Do you have any idea how to solve it?

    I already updated the permalink-settings. .htaccess says:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /community/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /community/index.php [L]
    </IfModule>

    # END WordPress

    Any ideas or questions?

    Greetings,

    Max

    #177980
    Henry Wright
    Moderator

    Is it possible to paginate a private message thread?

    #177975
    BuddyBoss
    Participant
    Henry Wright
    Moderator

    I’d like the newer messages to be displayed at the top of the page (i.e. order the loop by newest to oldest). Any idea how to do that?

    #177874
    finadama
    Participant

    Hello,

    I am buddypress newcomer and I have a problem with setting my buddypress registration as I want it to look like.

    1. I want to insert my welcome massage in my language an something different that is now – “Create an Account – Registering for this site is easy. Just fill in the fields below, and we’ll get a new account set up for you in no time.” How can I change that?

    2. The Profile Details fields – I have like 15 of them can I break a page so it isnt so long? Like 2 or 3 pages?

    3. I want to change field descriptions into my language. How?

    4. I would like to have a member base of my members on my mail. I would like ALL REGISTRATION INFO IS SENT TO MY MAIL when someone registrate (public, the info that friends see, member see, even the “only me” fields). When someone register now i only get username an mail. Like a classic form thats sends all info that is inserted. I want some fields to be specificly private info – only me and the registrator.

    CAN ANYONE HELP PLEASE?!!

    #177867
    Melle328
    Participant

    After deleting a strange database thread, some of my users have a private message count of none existing messages. How can I reset this?

    thx
    Daniel

    #177836
    quince85
    Participant

    Hi, I was adjusting the registration.php file. Just changing the text eg. “Account Details/Profile Details” to “Create an Account/Create a Profile”
    When I uploaded the page back, the layout is completely messed up.
    http://unicefchallenge.com/register/
    I’M GOING CRAZY, ANY ADVISE ASAP?

    Thank
    `<?php get_header( ‘buddypress’ ); ?>

    <div id=”content”>
    <div class=”padder”>

    <?php do_action( ‘bp_before_register_page’ ); ?>

    <div class=”page” id=”register-page”>

    <form action=”” name=”signup_form” id=”signup_form” class=”standard-form” method=”post” enctype=”multipart/form-data”>

    <?php if ( ‘registration-disabled’ == bp_get_current_signup_step() ) : ?>
    <?php do_action( ‘template_notices’ ); ?>
    <?php do_action( ‘bp_before_registration_disabled’ ); ?>

    <p><?php _e( ‘User registration is currently not allowed.’, ‘buddypress’ ); ?></p>

    <?php do_action( ‘bp_after_registration_disabled’ ); ?>
    <?php endif; // registration-disabled signup setp ?>

    <?php if ( ‘request-details’ == bp_get_current_signup_step() ) : ?>

    <h2><?php _e( ‘Create an Account’, ‘buddypress’ ); ?></h2>

    <?php do_action( ‘template_notices’ ); ?>

    <p><?php _e( ‘Please create the username and login information you would like to use on the Challenge site.’, ‘buddypress’ ); ?></p>

    <?php do_action( ‘bp_before_account_details_fields’ ); ?>

    <div class=”register-section” id=”basic-details-section”>

    <?php /***** Basic Account Details ******/ ?>

    <h4><?php _e( ‘Create an Account’, ‘buddypress’ ); ?></h4>

    <label for=”signup_username”><?php _e( ‘Username’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_username_errors’ ); ?>
    <input type=”text” name=”signup_username” id=”signup_username” value=”<?php bp_signup_username_value(); ?>” />

    <label for=”signup_email”><?php _e( ‘Email Address’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_email_errors’ ); ?>
    <input type=”text” name=”signup_email” id=”signup_email” value=”<?php bp_signup_email_value(); ?>” />

    <label for=”signup_password”><?php _e( ‘Choose a Password’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_password_errors’ ); ?>
    <input type=”password” name=”signup_password” id=”signup_password” value=”” />

    <label for=”signup_password_confirm”><?php _e( ‘Confirm Password’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_password_confirm_errors’ ); ?>
    <input type=”password” name=”signup_password_confirm” id=”signup_password_confirm” value=”” />

    <?php do_action( ‘bp_account_details_fields’ ); ?>

    </div><!– #basic-details-section –>

    <?php do_action( ‘bp_after_account_details_fields’ ); ?>

    <?php /***** Extra Profile Details ******/ ?>

    <?php if ( bp_is_active( ‘xprofile’ ) ) : ?>

    <?php do_action( ‘bp_before_signup_profile_fields’ ); ?>

    <div class=”register-section” id=”profile-details-section”>

    <h4><?php _e( ‘Create a Profile’, ‘buddypress’ ); ?></h4>

    <?php /* Use the profile field loop to render input fields for the ‘base’ profile field group */ ?>
    <?php if ( bp_is_active( ‘xprofile’ ) ) : if ( bp_has_profile( array( ‘profile_group_id’ => 1, ‘fetch_field_data’ => false ) ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>

    <div class=”editfield”>

    <?php if ( ‘textbox’ == bp_get_the_profile_field_type() ) : ?>

    <label for=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
    <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    <input type=”text” name=”<?php bp_the_profile_field_input_name(); ?>” id=”<?php bp_the_profile_field_input_name(); ?>” value=”<?php bp_the_profile_field_edit_value(); ?>” />

    <?php endif; ?>

    <?php if ( ‘textarea’ == bp_get_the_profile_field_type() ) : ?>

    <label for=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
    <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    <textarea rows=”5″ cols=”40″ name=”<?php bp_the_profile_field_input_name(); ?>” id=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_edit_value(); ?></textarea>

    <?php endif; ?>

    <?php if ( ‘selectbox’ == bp_get_the_profile_field_type() ) : ?>

    <label for=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
    <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    <select name=”<?php bp_the_profile_field_input_name(); ?>” id=”<?php bp_the_profile_field_input_name(); ?>”>
    <?php bp_the_profile_field_options(); ?>
    </select>

    <?php endif; ?>

    <?php if ( ‘multiselectbox’ == bp_get_the_profile_field_type() ) : ?>

    <label for=”<?php bp_the_profile_field_input_name(); ?>”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
    <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    <select name=”<?php bp_the_profile_field_input_name(); ?>” id=”<?php bp_the_profile_field_input_name(); ?>” multiple=”multiple”>
    <?php bp_the_profile_field_options(); ?>
    </select>

    <?php endif; ?>

    <?php if ( ‘radio’ == bp_get_the_profile_field_type() ) : ?>

    <div class=”radio”>
    <span class=”label”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></span>

    <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    <?php bp_the_profile_field_options(); ?>

    <?php if ( !bp_get_the_profile_field_is_required() ) : ?>
    ‘ );”><?php _e( ‘Clear’, ‘buddypress’ ); ?>
    <?php endif; ?>
    </div>

    <?php endif; ?>

    <?php if ( ‘checkbox’ == bp_get_the_profile_field_type() ) : ?>

    <div class=”checkbox”>
    <span class=”label”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></span>

    <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    <?php bp_the_profile_field_options(); ?>
    </div>

    <?php endif; ?>

    <?php if ( ‘datebox’ == bp_get_the_profile_field_type() ) : ?>

    <div class=”datebox”>
    <label for=”<?php bp_the_profile_field_input_name(); ?>_day”><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( ‘(required)’, ‘buddypress’ ); ?><?php endif; ?></label>
    <?php do_action( bp_get_the_profile_field_errors_action() ); ?>

    <select name=”<?php bp_the_profile_field_input_name(); ?>_day” id=”<?php bp_the_profile_field_input_name(); ?>_day”>
    <?php bp_the_profile_field_options( ‘type=day’ ); ?>
    </select>

    <select name=”<?php bp_the_profile_field_input_name(); ?>_month” id=”<?php bp_the_profile_field_input_name(); ?>_month”>
    <?php bp_the_profile_field_options( ‘type=month’ ); ?>
    </select>

    <select name=”<?php bp_the_profile_field_input_name(); ?>_year” id=”<?php bp_the_profile_field_input_name(); ?>_year”>
    <?php bp_the_profile_field_options( ‘type=year’ ); ?>
    </select>
    </div>

    <?php endif; ?>

    <?php do_action( ‘bp_custom_profile_edit_fields_pre_visibility’ ); ?>

    <?php if ( bp_current_user_can( ‘bp_xprofile_change_field_visibility’ ) ) : ?>
    <p class=”field-visibility-settings-toggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
    <?php printf( __( ‘This field can be seen by: <span class=”current-visibility-level”>%s</span>’, ‘buddypress’ ), bp_get_the_profile_field_visibility_level_label() ) ?> <?php _ex( ‘Change’, ‘Change profile field visibility level’, ‘buddypress’ ); ?>
    </p>

    <div class=”field-visibility-settings” id=”field-visibility-settings-<?php bp_the_profile_field_id() ?>”>
    <fieldset>
    <legend><?php _e( ‘Who can see this field?’, ‘buddypress’ ) ?></legend>

    <?php bp_profile_visibility_radio_buttons() ?>

    </fieldset>
    <?php _e( ‘Close’, ‘buddypress’ ) ?>

    </div>
    <?php else : ?>
    <p class=”field-visibility-settings-notoggle” id=”field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>”>
    <?php printf( __( ‘This field can be seen by: <span class=”current-visibility-level”>%s</span>’, ‘buddypress’ ), bp_get_the_profile_field_visibility_level_label() ) ?>
    </p>
    <?php endif ?>

    <?php do_action( ‘bp_custom_profile_edit_fields’ ); ?>

    <p class=”description”><?php bp_the_profile_field_description(); ?></p>

    </div>

    <?php endwhile; ?>

    <input type=”hidden” name=”signup_profile_field_ids” id=”signup_profile_field_ids” value=”<?php bp_the_profile_group_field_ids(); ?>” />

    <?php endwhile; endif; endif; ?>

    <?php do_action( ‘bp_signup_profile_fields’ ); ?>

    </div><!– #profile-details-section –>

    <?php do_action( ‘bp_after_signup_profile_fields’ ); ?>

    <?php endif; ?>

    <?php if ( bp_get_blog_signup_allowed() ) : ?>

    <?php do_action( ‘bp_before_blog_details_fields’ ); ?>

    <?php /***** Blog Creation Details ******/ ?>

    <div class=”register-section” id=”blog-details-section”>

    <h4><?php _e( ‘Blog Details’, ‘buddypress’ ); ?></h4>

    <p><input type=”checkbox” name=”signup_with_blog” id=”signup_with_blog” value=”1″<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘Yes, I\’d like to create a new site’, ‘buddypress’ ); ?></p>

    <div id=”blog-details”<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class=”show”<?php endif; ?>>

    <label for=”signup_blog_url”><?php _e( ‘Blog URL’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_blog_url_errors’ ); ?>

    <?php if ( is_subdomain_install() ) : ?>
    http:// <input type=”text” name=”signup_blog_url” id=”signup_blog_url” value=”<?php bp_signup_blog_url_value(); ?>” /> .<?php bp_blogs_subdomain_base(); ?>
    <?php else : ?>
    <?php echo home_url( ‘/’ ); ?> <input type=”text” name=”signup_blog_url” id=”signup_blog_url” value=”<?php bp_signup_blog_url_value(); ?>” />
    <?php endif; ?>

    <label for=”signup_blog_title”><?php _e( ‘Site Title’, ‘buddypress’ ); ?> <?php _e( ‘(required)’, ‘buddypress’ ); ?></label>
    <?php do_action( ‘bp_signup_blog_title_errors’ ); ?>
    <input type=”text” name=”signup_blog_title” id=”signup_blog_title” value=”<?php bp_signup_blog_title_value(); ?>” />

    <span class=”label”><?php _e( ‘I would like my site to appear in search engines, and in public listings around this network.’, ‘buddypress’ ); ?>:</span>
    <?php do_action( ‘bp_signup_blog_privacy_errors’ ); ?>

    <label><input type=”radio” name=”signup_blog_privacy” id=”signup_blog_privacy_public” value=”public”<?php if ( ‘public’ == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘Yes’, ‘buddypress’ ); ?></label>
    <label><input type=”radio” name=”signup_blog_privacy” id=”signup_blog_privacy_private” value=”private”<?php if ( ‘private’ == bp_get_signup_blog_privacy_value() ) : ?> checked=”checked”<?php endif; ?> /> <?php _e( ‘No’, ‘buddypress’ ); ?></label>

    <?php do_action( ‘bp_blog_details_fields’ ); ?>

    </div>

    </div><!– #blog-details-section –>

    <?php do_action( ‘bp_after_blog_details_fields’ ); ?>

    <?php endif; ?>

    <?php do_action( ‘bp_before_registration_submit_buttons’ ); ?>

    <div class=”submit”>
    <input type=”submit” name=”signup_submit” id=”signup_submit” value=”<?php _e( ‘Submit’, ‘buddypress’ ); ?>” />
    </div>

    <?php do_action( ‘bp_after_registration_submit_buttons’ ); ?>

    <?php wp_nonce_field( ‘bp_new_signup’ ); ?>

    <?php endif; // request-details signup step ?>

    <?php if ( ‘completed-confirmation’ == bp_get_current_signup_step() ) : ?>

    <h2><?php _e( ‘Check Your Email To Activate Your Account!’, ‘buddypress’ ); ?></h2>

    <?php do_action( ‘template_notices’ ); ?>
    <?php do_action( ‘bp_before_registration_confirmed’ ); ?>

    <?php if ( bp_registration_needs_activation() ) : ?>
    <p><?php _e( ‘You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.’, ‘buddypress’ ); ?></p>
    <?php else : ?>
    <p><?php _e( ‘You have successfully created your account! Please log in using the username and password you have just created.’, ‘buddypress’ ); ?></p>
    <?php endif; ?>

    <?php do_action( ‘bp_after_registration_confirmed’ ); ?>

    <?php endif; // completed-confirmation signup step ?>

    <?php do_action( ‘bp_custom_signup_steps’ ); ?>

    </form>

    </div>

    <?php do_action( ‘bp_after_register_page’ ); ?>

    </div><!– .padder –>
    </div><!– #content –>

    <?php get_sidebar( ‘buddypress’ ); ?>

    <script type=”text/javascript”>
    jQuery(document).ready( function() {
    if ( jQuery(‘div#blog-details’).length && !jQuery(‘div#blog-details’).hasClass(‘show’) )
    jQuery(‘div#blog-details’).toggle();

    jQuery( ‘input#signup_with_blog’ ).click( function() {
    jQuery(‘div#blog-details’).fadeOut().toggle();
    });
    });
    </script>

    <?php get_footer( ‘buddypress’ ); ?>’

    #177834
    quince85
    Participant

    I would like to change automation on the following group options:
    -Automatically make all groups private
    -Automatically make it so all group members can invite other members
    -Automatically create Group Forum

    Any suggestions how to do this?

    #177748
    BuddyBoss
    Participant

    Sorry I didn’t explain this as well as I could have. You shouldn’t need a lot of servers, just one very good server. So if you’re using cheap shared hosting at $5-10/mo, that’s not going to cut it once your site scales up large. In that scenario you’re sharing bandwidth and resources with many other sites, and the server itself (which is just a computer really) is likely not all that fast if you’re not paying much. You can rent your own server, or a virtual private server, and it can have very high specs all dedicated to your site. Like 24 cores, 2-4gb RAM, etc. That will be fast. You can get that for $50-$100/mo depending on what you choose/need. And you can always migrate a site from one server setup to another. A developer experienced in moving sites can usually do this within a day.

    A HUGE site does need multiple servers. Facebook for example probably has thousands of servers all around the world. But keep in mind how much raw data they must serve. A BP site at 100,000 users can probably be delivered from one database, from one server. The guiding strategy is to take as much load off of that server as possible, and then make sure the server is good enough to handle what is left without crashing or stalling with not enough RAM. “caching” at the server level is a method to take load off of the server. Using a CDN takes load off of the server. etc.

    I’m sure speed is an issue that the BP team thinks a lot about, but it’s a hard one to tackle as people are all customizing everything and it’s not really best practice to include caching within plugins. Although best practice isn’t everything, because in reality a solid caching system for BP would solve a lot of speed issues. It would need to cache individual components and break them live with AJAX, or something like that – not my expertise. I can imagine this interfering with many custom setups and plugins however, so like I said, probably not a simple fix.

    #177554

    In reply to: Page Not Found

    JeffE
    Participant

    Same here, my user clicks “Request Membership” button on a private group and gets page that says “This is somewhat embarrassing, isn’t it?”

    I’m using BuddyPress 1.9.1, BuddyBoss theme 3.04

    #177545
    Melle328
    Participant

    I’m experiencing a simular problem with bp groups and bbpress. If my group admins change their group settings from public to private, the forum type doesn’t. The forum tools doesn’t fix it.

    WP 3.8
    BP 1.8.1
    BBPRESS 2.5.2

    Thanks!
    Daniel

    #177544
    Melle328
    Participant

    Wordpress 3.8
    Buddypress 1.8.1
    Theme: BP default / child theme

    Plugins:
    Autochimp 2.15
    bbpress 2.5.2
    bbpress mark as read
    bbPress Email Notifications
    BP Group Management
    BP Group Email
    BP Profile Search
    BuddyPress Activity Comment Notifier
    BuddyPress Activity Plus
    BuddyPress Auto Group Join
    BuddyPress Better Pagination
    BuddyPress Block Activity Stream Types
    BuddyPress Extended Friendship Request
    BuddyPress Group Calendar
    BuddyPress Like
    BuddyPress Message privacy
    BuddyPress Real Names
    Change WP Mail From Details
    DigiMember
    Duplicate Post
    External Links
    Image Rotation Fixer
    Mapology
    OptimizePress
    Redirection
    Register Plus Redux
    Remove Dashboard Access
    Suchen & Ersetzen
    Simple Comment Editing
    The Events Calendar
    W3 Total Cache
    Widget Builder
    Widget Logic
    WordPress HTTPS
    WordPress Importer
    WP Crontrol
    WP Show IDs

    I already have a clone of my site, but without members producing content and writing (lots of) private messages I cannot reproduce the error. @djpaul if you are interestet to have a deeper look under the hood, I would be happy to send you login data for community & db.

    Thank you!

    #177495
    Henry Wright
    Moderator

    Hi @marcella1981

    You’d release your theme through the WordPress Theme Directory (or you can make your theme available privately – through a GitHub repo for example).

    There will be a theme review process if you plan to release through the Theme Directory. Take a look at this for more info:

    https://codex.wordpress.org/Theme_Review

    For guidance on theme development (assuming you haven’t finished your theme yet), check out:

    https://codex.wordpress.org/Theme_Development

    #177431
    Melle328
    Participant

    Hi,
    in my buddypress installation ‘strangers’ recieve the private message dialog between two other members. We have a thread of 50 ‘why can I read this’ mail.

    Is this a bug? What can I do?

    #177290
    quince85
    Participant

    @ubernaut
    I read this as well, but it still not working.
    I’m using attitude theme
    I created child theme and created buddypress.php and only create group works.
    However, register page is blank and forums page is showing: ”
    Search for: HOME › Forums Forum Topics Posts Freshness Group Forums Private: test (0, 0) 0 0 No Topics ”

    #177164
    shallowjeff
    Participant

    Hi,
    I need help. I’ve managed to get rid of the auto linking default function within the profile section of my members page, but am unable to place anything that has java and/or button qualities. I have a place for “profile widgets” but instead of the actual widget, I get an H-ref ugly link. http://www.poetsatwork.com

    For example:
    I paste this,

    <SCRIPT charset=”utf-8″ type=”text/javascript” src=”http://ws-na.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Flovecourses-20%2F8010%2F5a411cc7-5346-4d91-86c2-9808086e235e&Operation=GetScriptTemplate”> </SCRIPT> <NOSCRIPT>Amazon.com Widgets</NOSCRIPT>

    On the page it shows this,

    <a-HREF=”http://ws-na.amazon-adsystem.com/widgets/q?rt=tf_cw&ServiceVersion=20070822&MarketPlace=US&ID=V20070822%2FUS%2Flovecourses-20%2F8010%2F5a411cc7-5346-4d91-86c2-9808086e235e&Operation=NoScript=” Amazon.com Widgets

    This is the same for all link type images/widgets I place within BP. The stuff I put on the sidebars within wordpress works fine.

    Why? I’m sure it’s a filter/function, but not sure where/what to change.

    Here is my code:buddypress-xprofile-custom-fields-type/bp-xprofile-custom-fields-type.php
    THE CODE I USED TO GET RID OF AUTO LINKING IS ON THE VERY BOTTOM, THANKS http://www.poetsatwork.com

    
    /*
    Plugin Name: Buddypress Xprofile Custom Fields Type
    Plugin URI: https://github.com/donmik/buddypress-xprofile-custom-fields-type/
    Description: Buddypress installation required!! Add more custom fields type to extended profiles in buddypress: Birthdate, Email, Web, Datepicker. If you need more fields type, you are free to add them yourself or request us at miguel@donmik.com.
    Version: 1.5.8.4
    Author: donmik
    Author URI: http://donmik.com
    */
    //load text domain
    function bxcft_load_textdomain() {
    $locale = apply_filters( 'bxcft_load_load_textdomain_get_locale', get_locale() );
    // if load .mo file
    if ( !empty( $locale ) ) {
    $mofile_default = sprintf( '%slang/%s.mo', plugin_dir_path(__FILE__), $locale );
    $mofile = apply_filters( 'bxcft_load_textdomain_mofile', $mofile_default );
    
    if ( file_exists( $mofile ) )
    load_textdomain( “bxcft”, $mofile );
    }
    }
    add_action ( 'bp_init', 'bxcft_load_textdomain', 2 );
    
    function bxcft_add_new_xprofile_field_type($field_types){
    $new_field_types = array('birthdate', 'email', 'web', 'datepicker',
    'select_custom_post_type', 'multiselect_custom_post_type',
    'checkbox_acceptance', 'image', 'file', 'color', 'number');
    $field_types = array_merge($field_types, $new_field_types);
    return $field_types;
    }
    add_filter( 'xprofile_field_types', 'bxcft_add_new_xprofile_field_type' );
    
    function bxcft_admin_render_new_xprofile_field_type($field, $echo = true) {
    $html = ”;
    switch ( $field->type ) {
    case 'number':
    $html .= '<input type=”number” name=”field_'.$field->id.'” id=”'.$field->id.'” class=”input-number” />';
    break;
    
    case 'color':
    $html .= '<input type=”color” name=”field_'.$field->id.'” id=”'.$field->id.'” class=”input-color” />';
    break;
    
    case 'image':
    case 'file':
    $html .= '<input type=”file” name=”field_'.$field->id.'” id=”'.$field->id.'” class=”input-file” /> ';
    break;
    
    case 'checkbox_acceptance':
    $html .= '<input type=”checkbox” name=”field_'.$field->id.'” id=”'.$field->id.'” class=”input-checkbox” value=”” /> ';
    $html .= $field->description;
    $field->description = ”;
    break;
    
    case 'select_custom_post_type':
    $childs = $field->get_children();
    if (isset($childs) && count($childs) > 0 && is_object($childs[0])) {
    // Get the name of custom post type.
    $custom_post_type = $childs[0]->name;
    // Get the posts of custom post type.
    $loop = new WP_Query(array('posts_per_page' => -1, 'post_type' => $custom_post_type, 'orderby' => 'title', 'order' => 'ASC' ));
    }
    $select_custom_post_type = BP_XProfile_ProfileData::get_value_byid( $field->id );
    $html .= '<select name=”field_'.$field->id.'” id=”field_'.$field->id.'”>';
    if (isset($loop)) {
    foreach ($loop->posts as $post) {
    $html .= '<option value=”'.$post->ID.'”>'.$post->post_title.'</option>';
    }
    }
    $html .= '</select>';
    break;
    
    case “multiselect_custom_post_type”:
    $childs = $field->get_children();
    if (isset($childs) && count($childs) > 0 && is_object($childs[0])) {
    // Get the name of custom post type.
    $custom_post_type = $childs[0]->name;
    // Get the posts of custom post type.
    $loop = new WP_Query(array('posts_per_page' => -1, 'post_type' => $custom_post_type, 'orderby' => 'title', 'order' => 'ASC' ));
    }
    $select_custom_post_type = BP_XProfile_ProfileData::get_value_byid( $field->id );
    $html .= '<select name=”field_'.$field->id.'” id=”field_'.$field->id.'” multiple=”multiple”>';
    if (isset($loop)) {
    foreach ($loop->posts as $post) {
    $html .= '<option value=”'.$post->ID.'”>'.$post->post_title.'</option>';
    }
    }
    $html .= '</select>';
    break;
    
    case “datepicker”:
    $html .= '<input type=”date” name=”field_'.$field->id.'” id=”'.$field->id.'” class=”input” value=”” />';
    break;
    
    case “web”:
    $html .= '<input type=”url” name=”field_'.$field->id.'” id=”'.$field->id.'” class=”input” placeholder=”'.__('yourwebsite.com', 'bxcft').'” value=”” />';
    break;
    
    case “email”:
    $html .= '<input type=”email” name=”field_'.$field->id.'” id=”'.$field->id.'” class=”input” placeholder=”'.__('example@mail.com', 'bxcft').'” value=”” />';
    break;
    
    case “birthdate”:
    $date = BP_XProfile_ProfileData::get_value_byid( $field->id );
    
    // Set day, month, year defaults
    $day = ”;
    $month = ”;
    $year = ”;
    
    if ( !empty( $date ) ) {
    
    // If Unix timestamp
    if ( is_numeric( $date ) ) {
    $day = date( 'j', $date );
    $month = date( 'F', $date );
    $year = date( 'Y', $date );
    
    // If MySQL timestamp
    } else {
    $day = mysql2date( 'j', $date );
    $month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below
    $year = mysql2date( 'Y', $date );
    }
    }
    
    // Check for updated posted values, and errors preventing
    // them from being saved first time.
    if ( !empty( $_POST['field_' . $field->id . '_day'] ) ) {
    if ( $day != $_POST['field_' . $field->id . '_day'] ) {
    $day = $_POST['field_' . $field->id . '_day'];
    }
    }
    
    if ( !empty( $_POST['field_' . $field->id . '_month'] ) ) {
    if ( $month != $_POST['field_' . $field->id . '_month'] ) {
    $month = $_POST['field_' . $field->id . '_month'];
    }
    }
    
    if ( !empty( $_POST['field_' . $field->id . '_year'] ) ) {
    if ( $year != date( “j”, $_POST['field_' . $field->id . '_year'] ) ) {
    $year = $_POST['field_' . $field->id . '_year'];
    }
    }
    
    // Day.
    $html .= '<select name=”field_'.$field->id.'_day” id=”field_'.$field->id.'_day”>';
    $html .= '<option value=””' . selected( $day, ”, false ) . '>–</option>';
    for ( $i = 1; $i < 32; ++$i ) {
    $html .= '<option value=”' . $i .'”' . selected( $day, $i, false ) . '>' . $i . '</option>';
    }
    $html .= '</select>';
    
    // Month.
    $html .= '<select name=”field_'.$field->id.'_month” id=”field_'.$field->id.'_month”>';
    $eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
    $months = array(
    __( 'January', 'buddypress' ),
    __( 'February', 'buddypress' ),
    __( 'March', 'buddypress' ),
    __( 'April', 'buddypress' ),
    __( 'May', 'buddypress' ),
    __( 'June', 'buddypress' ),
    __( 'July', 'buddypress' ),
    __( 'August', 'buddypress' ),
    __( 'September', 'buddypress' ),
    __( 'October', 'buddypress' ),
    __( 'November', 'buddypress' ),
    __( 'December', 'buddypress' )
    );
    $html .= '<option value=””' . selected( $month, ”, false ) . '>——</option>';
    for ( $i = 0; $i < 12; ++$i ) {
    $html .= '<option value=”' . $eng_months[$i] . '”' . selected( $month, $eng_months[$i], false ) . '>' . $months[$i] . '</option>';
    }
    $html .= '</select>';
    
    // Year.
    $html .= '<select name=”field_'.$field->id.'_year” id=”field_'.$field->id.'_year”>';
    $html .= '<option value=””' . selected( $year, ”, false ) . '>—-</option>';
    for ( $i = date('Y')-1; $i > 1901; $i– ) {
    $html .= '<option value=”' . $i .'”' . selected( $year, $i, false ) . '>' . $i . '</option>';
    }
    $html .= '</select>';
    break;
    
    default:
    // Field type unrecognized.
    // $html = “<p>”.__('Field type unrecognized', 'bxcft').”</p>”;
    break;
    }
    
    if ($echo){
    echo $html;
    return;
    } else {
    return $html;
    }
    
    }
    add_filter( 'xprofile_admin_field', 'bxcft_admin_render_new_xprofile_field_type' );
    
    function bxcft_edit_render_new_xprofile_field($echo = true) {
    global $field;
    if (!is_bool($echo)) {
    $echo = true;
    }
    
    $uploads = wp_upload_dir();
    
    ob_start();
    if ( bp_get_the_profile_field_type() == 'birthdate' ) {
    $date = BP_XProfile_ProfileData::get_value_byid( $field->id );
    // Set day, month, year defaults
    $day = ”;
    $month = ”;
    $year = ”;
    
    if ( !empty( $date ) ) {
    
    // If Unix timestamp
    if ( is_numeric( $date ) ) {
    $day = date( 'j', $date );
    $month = date( 'F', $date );
    $year = date( 'Y', $date );
    
    // If MySQL timestamp
    } else {
    $day = mysql2date( 'j', $date );
    $month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below
    $year = mysql2date( 'Y', $date );
    }
    }
    
    // Check for updated posted values, and errors preventing
    // them from being saved first time.
    if ( !empty( $_POST['field_' . $field->id . '_day'] ) ) {
    if ( $day != $_POST['field_' . $field->id . '_day'] ) {
    $day = $_POST['field_' . $field->id . '_day'];
    }
    }
    
    if ( !empty( $_POST['field_' . $field->id . '_month'] ) ) {
    if ( $month != $_POST['field_' . $field->id . '_month'] ) {
    $month = $_POST['field_' . $field->id . '_month'];
    }
    }
    
    if ( !empty( $_POST['field_' . $field->id . '_year'] ) ) {
    if ( $year != date( “j”, $_POST['field_' . $field->id . '_year'] ) ) {
    $year = $_POST['field_' . $field->id . '_year'];
    }
    }
    ?>
    <div class=”datebox”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s_day”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    // Dropdown => Day of month.
    $options_day = ”;
    for ($i=1; $i<32; ++$i) {
    $options_day .= sprintf('<option value=”%s”%s>%s</option>',
    $i,
    selected($day, $i, false),
    $i);
    }
    $input = sprintf('<select name=”%s_day” id=”%s_day”%s><option value=””%s>–</option>%s</select>',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?'aria-required=”true”':”,
    selected($day, ”, false),
    $options_day);
    
    // Dropdown => Month.
    $eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );
    $months = array(
    __( 'January', 'buddypress' ),
    __( 'February', 'buddypress' ),
    __( 'March', 'buddypress' ),
    __( 'April', 'buddypress' ),
    __( 'May', 'buddypress' ),
    __( 'June', 'buddypress' ),
    __( 'July', 'buddypress' ),
    __( 'August', 'buddypress' ),
    __( 'September', 'buddypress' ),
    __( 'October', 'buddypress' ),
    __( 'November', 'buddypress' ),
    __( 'December', 'buddypress' )
    );
    $options_month = ”;
    for ($i=0; $i<12; ++$i) {
    $options_month .= sprintf('<option value=”%s”%s>%s</option>',
    $eng_months[$i],
    selected( $month, $eng_months[$i], false ),
    $months[$i]);
    }
    $input .= sprintf('<select name=”%s_month” id=”%s_month”%s><option value=””%s>——</option>%s</select>',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?'aria-required=”true”':”,
    selected($month, ”, false),
    $options_month);
    
    // Dropdown => Year.
    $birthdate_start_year = date('Y')-1;
    $options_year = ”;
    for ($i=$birthdate_start_year; $i>1901; $i–) {
    $options_year .= sprintf('<option value=”%s”%s>%s</option>',
    $i,
    selected($year, $i, false),
    $i);
    }
    $input .= sprintf('<select name=”%s_year” id=”%s_year”%s><option value=””%s>—-</option>%s</select>',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?'aria-required=”true” required=”required”':”,
    selected($year, ”, false),
    $options_year);
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    ?>
    </div>
    <?php
    }
    elseif ( bp_get_the_profile_field_type() == 'email' ) {
    ?>
    <div class=”input-email”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    $input = sprintf('<input type=”email” name=”%s” id=”%s”%s class=”input” value=”%s” placeholder=”%s” />',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”,
    bp_get_the_profile_field_edit_value(),
    __('example@mail.com', 'bxcft'));
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    ?>
    </div>
    <?php
    }
    elseif ( bp_get_the_profile_field_type() == 'web' ) {
    ?>
    <div class=”input-web”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    $input = sprintf('<input type=”url” name=”%s” id=”%s”%s class=”input” value=”%s” placeholder=”%s” />',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”,
    bp_get_the_profile_field_edit_value(),
    __('http://yourwebsite.com', 'bxcft'));
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    ?>
    </div>
    <?php
    }
    elseif ( bp_get_the_profile_field_type() == 'datepicker' ) {
    ?>
    <div class=”input-datepicker”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    $input = sprintf('<input type=”date” name=”%s” id=”%s”%s class=”input” value=”%s” />',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”,
    bp_get_the_profile_field_edit_value());
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    ?>
    </div>
    <?php
    }
    elseif ( bp_get_the_profile_field_type() == 'select_custom_post_type' ) {
    ?>
    <div class=”input-custom-post-type”>
    <?php
    $custom_post_type_selected = BP_XProfile_ProfileData::get_value_byid( $field->id );
    if ( isset( $_POST['field_' . $field->id] ) && $_POST['field_' . $field->id] != ” ) {
    if ( !empty( $_POST['field_' . $field->id] ) ) {
    $custom_post_type_selected = $_POST['field_' . $field->id];
    }
    }
    if (is_null($custom_post_type_selected)) {
    $custom_post_type_selected = array();
    }
    // Get field's data.
    $field_data = new BP_XProfile_Field($field->id);
    // Get the childs of field
    $childs = $field_data->get_children();
    if (isset($childs) && count($childs) > 0 && is_object($childs[0])) {
    // Get the name of custom post type.
    $custom_post_type = $childs[0]->name;
    // Get the posts of custom post type.
    $loop = new WP_Query(array('posts_per_page' => -1, 'post_type' => $custom_post_type, 'orderby' => 'title', 'order' => 'ASC' ));
    
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    $options_posts = ”;
    foreach ($loop->posts as $post) {
    $options_posts .= sprintf('<option value=”%s”%s>%s</option>',
    $post->ID,
    ($custom_post_type_selected==$post->ID)?' selected=”selected”':”,
    $post->post_title);
    }
    $input = sprintf('<select name=”%s” id=”%s”%s class=”select”><option value=””>%s</option>%s</select>',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”,
    __('Select…', 'bxcft'),
    $options_posts);
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    } else {
    _e('There is no custom post type selected.', 'bxcft');
    }
    ?>
    </div>
    <?php
    }
    elseif ( bp_get_the_profile_field_type() == 'multiselect_custom_post_type' ) {
    ?>
    <div class=”input-custom-post-type-multi”>
    <?php
    $custom_post_type_selected = maybe_unserialize(BP_XProfile_ProfileData::get_value_byid( $field->id ));
    if ( isset( $_POST['field_' . $field->id] ) && $_POST['field_' . $field->id] != ” ) {
    if ( !empty( $_POST['field_' . $field->id] ) ) {
    $custom_post_type_selected = $_POST['field_' . $field->id];
    }
    }
    // Get field's data.
    $field_data = new BP_XProfile_Field($field->id);
    // Get the childs of field
    $childs = $field_data->get_children();
    if (isset($childs) && $childs && count($childs) > 0 && is_object($childs[0])) {
    // Get the name of custom post type.
    $custom_post_type = $childs[0]->name;
    // Get the posts of custom post type.
    $loop = new WP_Query(array('posts_per_page' => -1, 'post_type' => $custom_post_type, 'orderby' => 'title', 'order' => 'ASC' ));
    
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    $options_posts = ”;
    foreach ($loop->posts as $post) {
    $options_posts .= sprintf('<option value=”%s”%s>%s</option>',
    $post->ID,
    (!empty($custom_post_type_selected) &&in_array($post->ID, $custom_post_type_selected))?' selected=”selected”':”,
    $post->post_title);
    }
    $input = sprintf('<select name=”%s[]” id=”%s”%s class=”select” multiple=”multiple”><option value=””>%s</option>%s</select>',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”,
    __('Select…', 'bxcft'),
    $options_posts);
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    } else {
    _e('There is no custom post type selected.', 'bxcft');
    }
    ?>
    </div>
    <?php
    }
    elseif (bp_get_the_profile_field_type() == 'checkbox_acceptance') {
    ?>
    <div class=”checkbox-acceptance”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    $input = sprintf('<input type=”checkbox” name=”%s” id=”%s”%s class=”checkbox” value=”1″%s />%s',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”,
    bp_get_the_profile_field_edit_value()?' checked=”checked”':”,
    bp_get_the_profile_field_description());
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    $field_description = ”;
    ?>
    </div>
    <?php
    }
    elseif (bp_get_the_profile_field_type() == 'image') {
    ?>
    <div class=”input-image”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    if (bp_get_the_profile_field_edit_value() != ”) {
    $actual_image = sprintf('%s<label for=”%s_deleteimg”><input type=”checkbox” name=”%s_deleteimg” id=”%s_deleteimg” value=”1″ />%s</label><input type=”hidden” name=”%s_hiddenimg” id=”%s_hiddenimg” value=”%s” />',
    $uploads['baseurl'].bp_get_the_profile_field_edit_value(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    __('Check this to delete this image', 'bxcft'),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_edit_value());
    } else {
    $actual_image = ”;
    }
    $input = sprintf('<input type=”file” name=”%s” id=”%s”%s />',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”);
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    
    echo apply_filters('bxcft_field_actual_image', $actual_image, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_edit_value());
    ?>
    <script type=”text/javascript”>
    jQuery('#profile-edit-form').attr('enctype', 'multipart/form-data');
    </script>
    </div>
    <?php
    }
    elseif (bp_get_the_profile_field_type() == 'file') {
    ?>
    <div class=”input-file”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    if (bp_get_the_profile_field_edit_value() != ”) {
    $actual_file = sprintf('%s<label for=”%s_deletefile”><input type=”checkbox” name=”%s_deletefile” id=”%s_deletefile” value=”1″ />%s</label><input type=”hidden” name=”%s_hiddenfile” id=”%s_hiddenfile” value=”%s” />',
    apply_filters('bxcft_show_download_file_link', '' . __('Download file', 'bxcft') . '', bp_get_the_profile_field_type(), bp_get_the_profile_field_id(), bp_get_the_profile_field_edit_value()),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    __('Check this to delete this file', 'bxcft'),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_edit_value());
    } else {
    $actual_file = ”;
    }
    $input = sprintf('<input type=”file” name=”%s” id=”%s”%s />',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”);
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    
    echo apply_filters('bxcft_field_actual_file', $actual_file, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_edit_value());
    ?>
    <script type=”text/javascript”>
    jQuery('#profile-edit-form').attr('enctype', 'multipart/form-data');
    </script>
    </div>
    <?php
    }
    elseif (bp_get_the_profile_field_type() == 'color') {
    $color_selected = bp_get_the_profile_field_edit_value();
    if (strpos($color_selected, '#') === false) {
    $color_selected = '#'.$color_selected;
    }
    ?>
    <div class=”input-color”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    $input = sprintf('<input type=”color” name=”%s” id=”%s”%s class=”input” value=”%s” />',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”,
    $color_selected);
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    ?>
    </div>
    <script>
    if (!Modernizr.inputtypes.color) {
    // No html5 field colorpicker => Calling jscolor.
    jQuery('input#<?php bp_the_profile_field_input_name() ?>').addClass('color');
    }
    </script>
    <?php
    }
    elseif (bp_get_the_profile_field_type() == 'number') {
    ?>
    <div class=”input-number”>
    <?php
    $label = sprintf('<label class=”label-form%s” for=”%s”>%s%s</label>',
    bp_get_the_profile_field_is_required()?' required':”,
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_name(),
    bp_get_the_profile_field_is_required()?' '.__('(required)', 'buddypress'):”);
    
    $input = sprintf('<input type=”number” name=”%s” id=”%s”%s class=”input” value=”%s” />',
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_input_name(),
    bp_get_the_profile_field_is_required()?' aria-required=”true” required=”required”':”,
    bp_get_the_profile_field_edit_value());
    
    echo apply_filters('bxcft_field_label', $label, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_name(), bp_get_the_profile_field_is_required());
    
    do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' );
    
    echo apply_filters('bxcft_field_input', $input, bp_get_the_profile_field_id(), bp_get_the_profile_field_type(), bp_get_the_profile_field_input_name(), bp_get_the_profile_field_is_required());
    ?>
    </div>
    <?php
    }
    
    $output = ob_get_contents();
    ob_end_clean();
    
    if ($echo) {
    echo $output;
    return;
    }
    return $output;
    }
    
    /*
    * Buddypress v1.7 has better hook bp_custom_profile_edit_fields_pre_visibility which shows fields before visibility settings.
    * In case buddypress previous version is installed, we use the other tag bp_custom_profile_edit_fields.
    */
    $version_bp = 0;
    $data = get_file_data(WP_PLUGIN_DIR . '/buddypress/bp-loader.php', array('Version'));
    if (isset($data) && count($data) > 0 && $data[0] != ”)
    $version_bp = (float)$data[0];
    if ($version_bp >= 1.7)
    add_action( 'bp_custom_profile_edit_fields_pre_visibility', 'bxcft_edit_render_new_xprofile_field' );
    else
    add_action( 'bp_custom_profile_edit_fields', 'bxcft_edit_render_new_xprofile_field' );
    
    function bxcft_get_field_value( $value=”, $type=”, $id=”) {
    
    $value_to_return = $value;
    
    if ($value_to_return == ”)
    return apply_filters('bxcft_show_field_value', $value_to_return, $type, $id, $value);
    
    $uploads = wp_upload_dir();
    
    if ($type == 'birthdate') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $field = new BP_XProfile_Field($id);
    // Get children.
    $childs = $field->get_children();
    $show_age = false;
    if (isset($childs) && $childs && count($childs) > 0 && is_object($childs[0])) {
    // Get the name of custom post type.
    if ($childs[0]->name == 'show_age')
    $show_age = true;
    }
    if ($value != ”) {
    if ($show_age) {
    $value_to_return = '<p>'.floor((time() – strtotime($value))/31556926).'</p>';
    } else {
    $value_to_return = '<p>'.date_i18n(get_option('date_format') ,strtotime($value) ).'</p>';
    }
    }
    }
    elseif ($type == 'datepicker') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.date_i18n(get_option('date_format') ,strtotime($value) ).'</p>';
    }
    elseif ($type == 'email') {
    if (strpos($value, 'mailto') === false) {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.$value.'</p>';
    }
    }
    elseif ($type == 'web') {
    if (strpos($value, 'href=') === false) {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.$value.'</p>';
    }
    }
    elseif ($type == 'select_custom_post_type') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    // Get field's data.
    $field = new BP_XProfile_Field($id);
    // Get children.
    $childs = $field->get_children();
    if (isset($childs) && count($childs) > 0) {
    // Get the name of custom post type.
    $custom_post_type = $childs[0]->name;
    }
    $post = get_post($value);
    if ($post->post_type == $custom_post_type) {
    $value_to_return = '<p>'.$post->post_title.'</p>';
    } else {
    // Custom post type is not the same.
    $value_to_return = '<p>–</p>';
    }
    }
    elseif ($type == 'multiselect_custom_post_type') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    // Get field's data.
    $field = new BP_XProfile_Field($id);
    // Get children.
    $childs = $field->get_children();
    if (isset($childs) && count($childs) > 0 && is_object($childs[0])) {
    // Get the name of custom post type.
    $custom_post_type = $childs[0]->name;
    } else {
    $custom_post_type = ”;
    }
    $values = explode(“,”, $value);
    $cad = ”;
    foreach ($values as $v) {
    $post = get_post($v);
    if ($post->post_type == $custom_post_type) {
    if ($cad == ”)
    $cad .= '<ul class=”list_custom_post_type”>';
    $cad .= '
    '.$post->post_title.'
    
    ';
    }
    }
    if ($cad != ”) {
    $cad .= '';
    $value_to_return = '<p>'.$cad.'</p>';
    } else {
    $value_to_return = '<p>–</p>';
    }
    } elseif ($type == 'checkbox_acceptance') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.(($value==1)?__('yes', 'bxcft'):__('no', 'bxcft')).'</p>';
    } elseif ($type == 'image') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p></p>';
    } elseif ($type == 'file') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.__('Download file', 'bxcft').'</p>';
    } elseif ($type == 'color') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    if (strpos($value, '#') === false) {
    $value = '#'.$value;
    }
    $value_to_return = '<p>'.$value.'</p>';
    }
    // Number nothing to do.
    
    return apply_filters('bxcft_show_field_value', $value_to_return, $type, $id, $value);
    }
    add_filter( 'bp_get_the_profile_field_value', 'bxcft_get_field_value', 15, 3);
    
    /**
    * Filter for those who use xprofile_get_field_data instead of get_field_value.
    * @param type $value
    * @param type $field_id
    * @param type $user_id
    * @return string
    */
    function bxcft_get_field_data($value, $field_id) {
    
    $value_to_return = $value;
    $field = new BP_XProfile_Field($field_id);
    
    if ($value_to_return == ”)
    return apply_filters('bxcft_show_field_value', $value_to_return, $field->type, $field_id, $value);
    
    $uploads = wp_upload_dir();
    if ($field->type == 'birthdate') {
    // Get children.
    $childs = $field->get_children();
    $show_age = false;
    if (isset($childs) && $childs && count($childs) > 0 && is_object($childs[0])) {
    if ($childs[0]->name == 'show_age')
    $show_age = true;
    }
    if ($value != ”) {
    if ($show_age) {
    $value_to_return = '<p>'.floor((time() – strtotime($value))/31556926).'</p>';
    } else {
    $value_to_return = '<p>'.date_i18n(get_option('date_format') ,strtotime($value) ).'</p>';
    }
    }
    }
    elseif ($field->type == 'datepicker') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.date_i18n(get_option('date_format') ,strtotime($value) ).'</p>';
    }
    elseif ($field->type == 'email') {
    if (strpos($value, 'mailto') === false) {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.$value.'</p>';
    }
    }
    elseif ($field->type == 'web') {
    if (strpos($value, 'href=') === false) {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.$value.'</p>';
    }
    }
    elseif ($field->type == 'select_custom_post_type') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    // Get children.
    $childs = $field->get_children();
    if (isset($childs) && count($childs) > 0) {
    // Get the name of custom post type.
    $custom_post_type = $childs[0]->name;
    }
    $post = get_post($value);
    if ($post->post_type == $custom_post_type) {
    $value_to_return = '<p>'.$post->post_title.'</p>';
    } else {
    // Custom post type is not the same.
    $value_to_return = '<p>–</p>';
    }
    }
    elseif ($field->type == 'multiselect_custom_post_type') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    // Get children.
    $childs = $field->get_children();
    $values = explode(“,”, $value);
    $cad = ”;
    if (isset($childs) && is_array($childs) && count($childs) > 0) {
    // Get the name of custom post type.
    $custom_post_type = $childs[0]->name;
    
    foreach ($values as $v) {
    $post = get_post($v);
    if ($post->post_type == $custom_post_type) {
    if ($cad == ”)
    $cad .= '<ul class=”list_custom_post_type”>';
    $cad .= '
    '.$post->post_title.'
    
    ';
    }
    }
    }
    if ($cad != ”) {
    $cad .= '';
    $value_to_return = '<p>'.$cad.'</p>';
    } else {
    $value_to_return = '<p>–</p>';
    }
    } elseif ($field->type == 'checkbox_acceptance') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.(($value==1)?__('yes', 'bxcft'):__('no', 'bxcft')).'</p>';
    } elseif ($field->type == 'image') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p></p>';
    } elseif ($field->type == 'file') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    $value_to_return = '<p>'.__('Download file', 'bxcft').'</p>';
    } elseif ($field->type == 'color') {
    $value = str_replace(“<p>”, “”, $value);
    $value = str_replace(“</p>”, “”, $value);
    if (strpos($value, '#') === false) {
    $value = '#'.$value;
    }
    $value_to_return = '<p>'.$value.'</p>';
    }
    // Number nothing to do.
    
    return apply_filters('bxcft_show_field_value', $value_to_return, $field->type, $field_id, $value);
    
    }
    add_filter( 'xprofile_get_field_data', 'bxcft_get_field_data', 15, 2);
    
    /**
    * Function replacing the original buddypress filter.
    * @param type $field_value
    * @param type $field_type
    * @return string
    */
    function bxcft_xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' ) {
    if ( 'datebox' == $field_type || 'email' == $field_type || 'birthdate' == $field_type ||
    'datepicker' == $field_type || 'web' == $field_type || 'select_custom_post_type' == $field_type ||
    'multiselect_custom_post_type' == $field_type || 'image' == $field_type || 'file' == $field_type ||
    'color' == $field_type || 'number' == $field_type)
    return $field_value;
    
    if ( !strpos( $field_value, ',' ) && ( count( explode( ' ', $field_value ) ) > 5 ) )
    return $field_value;
    
    $values = explode( ',', $field_value );
    
    if ( !empty( $values ) ) {
    foreach ( (array) $values as $value ) {
    $value = trim( $value );
    
    // If the value is a URL, skip it and just make it clickable.
    if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) {
    $new_values[] = make_clickable( $value );
    
    // Is not clickable
    } else {
    
    // More than 5 spaces
    if ( count( explode( ' ', $value ) ) > 5 ) {
    $new_values[] = $value;
    
    // Less than 5 spaces
    } else {
    $search_url = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );
    $new_values[] = '' . $value . '';
    }
    }
    }
    
    $values = implode( ', ', $new_values );
    }
    
    return $values;
    }
    
    /**
    * Adding js for admin.
    * @param type $hook
    * @return type
    */
    function bxcft_add_js($hook) {
    if ('users_page_bp-profile-setup' != $hook && 'buddypress_page_bp-profile-setup' != $hook)
    return;
    
    wp_enqueue_script( 'bxcft-js', plugins_url('assets/js/addfields.js', __FILE__), array( 'jquery' ), '1.5.7′ );
    $params = array(
    'birthdate' => __('Birthdate', 'bxcft'),
    'email' => __('Email', 'bxcft'),
    'web' => __('Website', 'bxcft'),
    'datepicker' => __('Datepicker', 'bxcft'),
    'select_custom_post_type' => __('Custom Post Type Selector', 'bxcft'),
    'multiselect_custom_post_type' => __('Custom Post Type Multiselector', 'bxcft'),
    'checkbox_acceptance' => __('Checkbox acceptance', 'bxcft'),
    'image' => __('Image', 'bxcft'),
    'file' => __('File', 'bxcft'),
    'color' => __('Color', 'bxcft'),
    'number' => __('Number', 'bxcft')
    );
    wp_localize_script('bxcft-js', 'params', $params);
    }
    add_action( 'admin_enqueue_scripts', 'bxcft_add_js');
    
    /**
    * Adding js for edit form.
    */
    function bxcft_add_js_public() {
    // Modernizr to test html5 fields.
    wp_enqueue_script( 'bxcft-modernizr', plugins_url('assets/js/modernizr.js', __FILE__), array( 'jquery' ), '2.6.2′ );
    // Plugin jscolor fallback colorpicker.
    wp_enqueue_script( 'bxcft-jscolor', plugins_url('assets/js/jscolor/jscolor.js', __FILE__), array( 'bxcft-modernizr' ), '1.4.1′ );
    }
    add_action( 'wp_enqueue_scripts', 'bxcft_add_js_public');
    
    function bxcft_save_custom_option($field) {
    global $bp, $wpdb;
    
    if ( 'select_custom_post_type' == $field->type ) {
    $post_option = !empty( $_POST['select_custom_post_type_option']) ? $_POST['select_custom_post_type_option'] : ”;
    if ( ” != $post_option ) {
    if ( !empty( $field->id ) ) {
    $field_id = $field->id;
    } else {
    $field_id = $wpdb->insert_id;
    }
    if ( !$wpdb->query( $wpdb->prepare( “INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'custom_post_type_option', %s, ”, 0, %d, %d)”, $field->group_id, $field_id, $post_option, 1, 1 ) ) ) {
    return false;
    }
    }
    }
    elseif ( 'multiselect_custom_post_type' == $field->type) {
    $post_option = !empty( $_POST['multiselect_custom_post_type_option']) ? $_POST['multiselect_custom_post_type_option'] : ”;
    if ( ” != $post_option ) {
    if ( !empty( $field->id ) ) {
    $field_id = $field->id;
    } else {
    $field_id = $wpdb->insert_id;
    }
    if ( !$wpdb->query( $wpdb->prepare( “INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'multi_custom_post_type_option', %s, ”, 0, %d, %d)”, $field->group_id, $field_id, $post_option, 1, 1 ) ) ) {
    return false;
    }
    }
    }
    elseif ( 'birthdate' == $field->type) {
    $post_option = !empty( $_POST['birthdate_option']) ? $_POST['birthdate_option'] : ”;
    if ( ” != $post_option ) {
    if ( !empty( $field->id ) ) {
    $field_id = $field->id;
    } else {
    $field_id = $wpdb->insert_id;
    }
    if ( !$wpdb->query( $wpdb->prepare( “INSERT INTO {$bp->profile->table_name_fields} (group_id, parent_id, type, name, description, is_required, option_order, is_default_option) VALUES (%d, %d, 'birthdate_option', %s, ”, 0, %d, %d)”, $field->group_id, $field_id, $post_option, 1, 1 ) ) ) {
    return false;
    }
    }
    }
    
    }
    add_action( 'xprofile_field_after_save', 'bxcft_save_custom_option');
    
    function bxcft_delete_field_custom($field) {
    if ($field->type == 'select_custom_post_type' || $field->type == 'multiselect_custom_post_type'
    || $field->type == 'birthdate') {
    $field->delete_children();
    }
    }
    add_action( 'xprofile_fields_deleted_field', 'bxcft_delete_field_custom');
    
    function bxcft_selected_field($field) {
    $childs = $field->get_children();
    if (isset($childs) && count($childs) > 0 && is_object($childs[0]) && $field->type == 'select_custom_post_type') {
    $selected_option = $childs[0]->name;
    } else {
    $selected_option = null;
    }
    
    if (!empty($_POST['select_custom_post_type_option'])) {
    $selected_option = $_POST['select_custom_post_type_option'];
    }
    ?>
    <div style=”display: none; margin-left: 15px;” class=”options-box” id=”select_custom_post_type”>
    <h4><?php _e('Please, select custom post type', 'bxcft'); ?></h4>
    <p>
    <?php _e('Custom Post Type:', 'bxcft'); ?>
    <select name=”select_custom_post_type_option” id=”select_custom_post_type_option”>
    <?php
    $args = array(
    'public' => true,
    '_builtin' => false
    );
    $custom_post_types = get_post_types($args);
    foreach ($custom_post_types as $post_type) :
    ?>
    <option value=”<?php echo $post_type; ?>” <?php if ($selected_option == $post_type): ?>selected=”selected”<?php endif; ?>>
    <?php echo $post_type; ?>
    </option>
    <?php endforeach; ?>
    </select>
    </p>
    </div>
    <?php
    if (isset($childs) && count($childs) > 0 && is_object($childs[0]) && $field->type == 'multiselect_custom_post_type') {
    $selected_option = $childs[0]->name;
    } else {
    $selected_option = null;
    }
    
    if (!empty($_POST['multiselect_custom_post_type_option'])) {
    $selected_option = $_POST['multiselect_custom_post_type_option'];
    }
    ?>
    <div style=”display: none; margin-left: 15px;” class=”options-box” id=”multiselect_custom_post_type”>
    <h4><?php _e('Please, select custom post type', 'bxcft'); ?></h4>
    <p>
    <?php _e('Custom Post Type:', 'bxcft'); ?>
    <select name=”multiselect_custom_post_type_option” id=”multiselect_custom_post_type_option”>
    <?php
    foreach ($custom_post_types as $post_type) :
    ?>
    <option value=”<?php echo $post_type; ?>” <?php if ($selected_option == $post_type): ?>selected=”selected”<?php endif; ?>>
    <?php echo $post_type; ?>
    </option>
    <?php endforeach; ?>
    </select>
    </p>
    </div>
    <?php
    if (isset($childs) && $childs && count($childs) > 0 && is_object($childs[0]) && $field->type == 'birthdate') {
    $selected_option = $childs[0]->name;
    } else {
    $selected_option = null;
    }
    
    if (!empty($_POST['birthdate_option'])) {
    $selected_option = $_POST['birthdate_option'];
    }
    ?>
    <div style=”display: none; margin-left: 15px;” class=”options-box” id=”birthdate”>
    <h4><?php _e('Show age (hide birthdate)', 'bxcft'); ?></h4>
    <p>
    <?php _e('Check this if you want to show age instead of birthdate:', 'bxcft'); ?>
    <input type=”checkbox” name=”birthdate_option” value=”show_age” id=”birthdate_option”
    <?php if ($selected_option == 'show_age') : ?>checked=”checked”<?php endif; ?>/>
    </p>
    </div>
    <?php if (!is_null($field->type)) : ?>
    <script type=”text/javascript”>
    jQuery(document).ready(function() {
    bxcft.select('<?php echo $field->type; ?>');
    });
    </script>
    <?php
    endif;
    }
    add_action('xprofile_field_additional_options', 'bxcft_selected_field');
    
    /**
    * This filter add a new level of visibility. Hide this field for everyone. Nobody can see.
    * @param type $visibility_levels
    * @return type
    */
    function bxcft_xprofile_get_visibility_levels($visibility_levels) {
    $visibility_levels['nobody'] = array('id' => 'nobody', 'label' => __('Nobody', 'bxcft'));
    return $visibility_levels;
    }
    add_filter('bp_xprofile_get_visibility_levels', 'bxcft_xprofile_get_visibility_levels', 1);
    
    /**
    * This filter is necessary to hide fields when 'nobody' new visibility is selected.
    * @param type $hidden_fields
    * @param type $displayed_user_id
    * @param type $current_user_id
    * @return type
    */
    function bxcft_xprofile_get_hidden_fields_for_user($hidden_fields, $displayed_user_id=0, $current_user_id=0) {
    if ( !$displayed_user_id ) {
    $displayed_user_id = bp_displayed_user_id();
    }
    
    if ( !$displayed_user_id ) {
    return array();
    }
    
    if ( !$current_user_id ) {
    $current_user_id = bp_loggedin_user_id();
    }
    
    // @todo – This is where you'd swap out for current_user_can() checks
    $new_hidden_fields = array();
    
    if ( $current_user_id ) {
    // Current user is logged in
    if ( $displayed_user_id == $current_user_id ) {
    // If you're viewing your own profile, nothing's private
    
    } elseif ( bp_is_active( 'friends' ) && friends_check_friendship( $displayed_user_id, $current_user_id ) ) {
    // If the current user and displayed user are friends, so exclude nobody
    $hidden_levels[] = 'nobody';
    $new_hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
    
    } else {
    // current user is logged-in but not friends, so exclude friends-only
    $hidden_levels[] = 'nobody';
    
    $new_hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
    }
    
    } else {
    // Current user is not logged in, so exclude friends-only and loggedin
    $hidden_levels[] = 'nobody';
    
    $new_hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
    }
    
    if (is_array($new_hidden_fields))
    $hidden_fields = array_merge($hidden_fields, $new_hidden_fields);
    
    return $hidden_fields;
    }
    add_filter('bp_xprofile_get_hidden_fields_for_user', 'bxcft_xprofile_get_hidden_fields_for_user', 10, 3);
    
    /**
    * Update profile
    */
    function bxcft_updated_profile($bp_user_id, $posted_field_ids, $errors) {
    
    global $bp;
    
    // There are errors
    if ( empty( $errors ) ) {
    
    // Reset the errors var
    $errors = false;
    
    // Now we've checked for required fields, lets save the values.
    foreach ( (array) $posted_field_ids as $field_id ) {
    
    // Certain types of fields (checkboxes, multiselects) may come through empty. Save them as an empty array so that they don't get overwritten by the default on the next edit.
    if ( empty( $_POST['field_' . $field_id] ) )
    $value = array();
    else
    $value = $_POST['field_' . $field_id];
    
    // Handles delete checkbox.
    $uploads = wp_upload_dir();
    $field = new BP_XProfile_Field($field_id);
    if ($field->type == 'image' && isset($_POST['field_'.$field_id.'_deleteimg']) && $_POST['field_'.$field_id.'_deleteimg']) {
    if (file_exists($uploads['basedir'] . $_POST['field_'.$field_id.'_hiddenimg'])) {
    unlink($uploads['basedir'] . $_POST['field_'.$field_id.'_hiddenimg']);
    }
    $value = array();
    }
    if ($field->type == 'file' && isset($_POST['field_'.$field_id.'_deletefile']) && $_POST['field_'.$field_id.'_deletefile']) {
    if (file_exists($uploads['basedir'] . $_POST['field_'.$field_id.'_hiddenfile'])) {
    unlink($uploads['basedir'] . $_POST['field_'.$field_id.'_hiddenfile']);
    }
    $value = array();
    }
    
    // Handles image field type saving.
    if (isset($_FILES['field_'.$field_id]) && $_FILES['field_'.$field_id]['size'] > 0) {
    $field = new BP_XProfile_Field($field_id);
    if ($field->type == 'image') {
    $ext_allowed = array('jpg','jpeg','gif','png');
    apply_filters('images_ext_allowed', $ext_allowed);
    } elseif ($field->type == 'file') {
    $ext_allowed = array('doc','docx','pdf');
    apply_filters('files_ext_allowed', $ext_allowed);
    }
    
    $ext = strtolower(substr($_FILES['field_'.$field_id]['name'], strrpos($_FILES['field_'.$field_id]['name'],'.')+1));
    if (!in_array($ext, $ext_allowed)) {
    $errors = true;
    } else {
    require_once( ABSPATH . '/wp-admin/includes/file.php' );
    add_filter( 'upload_dir', 'bxcft_profile_upload_dir', 10, 1 );
    $_POST['action'] = 'wp_handle_upload';
    $uploaded_file = wp_handle_upload( $_FILES['field_'.$field_id] );
    $uploads = wp_upload_dir();
    $value = str_replace($uploads['baseurl'], ”, $uploaded_file['url']);
    }
    } else {
    if ($field->type == 'image' && (!isset($_POST['field_'.$field_id.'_deleteimg']) || !$_POST['field_'.$field_id.'_deleteimg']) && isset($_POST['field_'.$field_id.'_hiddenimg']) && $_POST['field_'.$field_id.'_hiddenimg'] != ”) {
    $value = $_POST['field_'.$field_id.'_hiddenimg'];
    }
    elseif ($field->type == 'file' && (!isset($_POST['field_'.$field_id.'_deletefile']) || !$_POST['field_'.$field_id.'_deletefile']) && isset($_POST['field_'.$field_id.'_hiddenfile']) && $_POST['field_'.$field_id.'_hiddenfile'] != ”) {
    $value = $_POST['field_'.$field_id.'_hiddenfile'];
    }
    }
    if ( !xprofile_set_field_data( $field_id, $bp_user_id, $value ) ) {
    $errors = true;
    } else {
    do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
    }
    }
    }
    }
    add_action('xprofile_updated_profile', 'bxcft_updated_profile', 10, 3);
    
    function bxcft_signup_user($user_id, $user_login, $user_password, $user_email, $usermeta)
    {
    // Set any profile data
    if ( bp_is_active( 'xprofile' ) ) {
    if ( !empty( $usermeta['profile_field_ids'] ) ) {
    $profile_field_ids = explode( ',', $usermeta['profile_field_ids'] );
    
    foreach( (array) $profile_field_ids as $field_id ) {
    
    if (!empty($usermeta["field_{$field_id}"]))
    $value = $usermeta["field_{$field_id}"];
    else
    $value = array();
    
    // Handles delete checkbox.
    $uploads = wp_upload_dir();
    $field = new BP_XProfile_Field($field_id);
    if ($field->type == 'image' && isset($_POST['field_'.$field_id.'_deleteimg']) && $_POST['field_'.$field_id.'_deleteimg']) {
    if (file_exists($uploads['basedir'] . $_POST['field_'.$field_id.'_hiddenimg'])) {
    unlink($uploads['basedir'] . $_POST['field_'.$field_id.'_hiddenimg']);
    }
    $value = array();
    }
    if ($field->type == 'file' && isset($_POST['field_'.$field_id.'_deletefile']) && $_POST['field_'.$field_id.'_deletefile']) {
    if (file_exists($uploads['basedir'] . $_POST['field_'.$field_id.'_hiddenfile'])) {
    unlink($uploads['basedir'] . $_POST['field_'.$field_id.'_hiddenfile']);
    }
    $value = array();
    }
    
    // Handles image field type saving.
    if (isset($_FILES['field_'.$field_id]) && $_FILES['field_'.$field_id]['size'] > 0) {
    $field = new BP_XProfile_Field($field_id);
    if ($field->type == 'image') {
    $ext_allowed = array('jpg','jpeg','gif','png');
    apply_filters('images_ext_allowed', $ext_allowed);
    } elseif ($field->type == 'file') {
    $ext_allowed = array('doc','docx','pdf');
    apply_filters('files_ext_allowed', $ext_allowed);
    }
    
    $ext = strtolower(substr($_FILES['field_'.$field_id]['name'], strrpos($_FILES['field_'.$field_id]['name'],'.')+1));
    if (in_array($ext, $ext_allowed)) {
    require_once( ABSPATH . '/wp-admin/includes/file.php' );
    add_filter( 'upload_dir', 'bxcft_profile_upload_dir', 10, 1 );
    $_POST['action'] = 'wp_handle_upload';
    $uploaded_file = wp_handle_upload( $_FILES['field_'.$field_id] );
    $destino = str_replace('0′, $user_id, $uploaded_file['file']);
    $aux = explode(“/”, $destino);
    if (!file_exists(str_replace('/'.$aux[count($aux)-1], ”, $destino))) {
    mkdir(str_replace('/'.$aux[count($aux)-1], ”, $destino));
    }
    copy($uploaded_file['file'], $destino);
    unlink($uploaded_file['file']);
    $value = str_replace($uploads['baseurl'], ”, str_replace('0′, $user_id, $uploaded_file['url']));
    }
    } else {
    if ($field->type == 'image' && (!isset($_POST['field_'.$field_id.'_deleteimg']) || !$_POST['field_'.$field_id.'_deleteimg']) && isset($_POST['field_'.$field_id.'_hiddenimg']) && $_POST['field_'.$field_id.'_hiddenimg'] != ”) {
    $value = $_POST['field_'.$field_id.'_hiddenimg'];
    }
    elseif ($field->type == 'file' && (!isset($_POST['field_'.$field_id.'_deletefile']) || !$_POST['field_'.$field_id.'_deletefile']) && isset($_POST['field_'.$field_id.'_hiddenfile']) && $_POST['field_'.$field_id.'_hiddenfile'] != ”) {
    $value = $_POST['field_'.$field_id.'_hiddenfile'];
    }
    }
    
    xprofile_set_field_data( $field_id, $user_id, $value );
    }
    }
    }
    }
    add_action('bp_core_signup_user', 'bxcft_signup_user', 10, 5);
    
    function bxcft_profile_upload_dir( $upload_dir, $user_id=0 ) {
    if ($user_id == 0)
    $user_id = bp_displayed_user_id();
    $profile_subdir = '/profiles/' . $user_id;
    
    $upload_dir['path'] = $upload_dir['basedir'] . $profile_subdir;
    $upload_dir['url'] = $upload_dir['baseurl'] . $profile_subdir;
    $upload_dir['subdir'] = $profile_subdir;
    
    return $upload_dir;
    }
    
    /**
    * Replacing the buddypress filter link profile is it has the filter.
    * If user deactivated the filter, we don't add another filter.
    */
    function bxcft_remove_xprofile_links() {
    if (has_filter('bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data')) {
    remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
    add_filter( 'bp_get_the_profile_field_value', 'bxcft_xprofile_filter_link_profile_data', 9, 2);
    }
    }
    add_action( 'bp_setup_globals', 'bxcft_remove_xprofile_links', 9999 );
    
    /**
    * This function only works if plugin bp-profile search is active.
    * @global type $bps_options
    * @param type $type
    * @return string
    */
    function bxcft_profile_field_type($type) {
    if (function_exists('is_plugin_active') && is_plugin_active('bp-profile-search/bps-main.php')
    || in_array( 'bp-profile-search/bps-main.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )) {
    global $bps_options;
    $id = bp_get_the_profile_field_id ();
    
    if ( ((is_admin() && strpos($_SERVER['REQUEST_URI'], 'page=bp-profile-search'))
    || (isset($bps_options) && $bps_options['agerange'] == $id
    && isset($_POST['bp_profile_search']) && $_POST['bp_profile_search']))
    && $type == 'birthdate') {
    return 'datebox';
    }
    }
    
    return $type;
    }
    add_filter('bp_the_profile_field_type', 'bxcft_profile_field_type', 1);
    
    add_action('init', 'my_xprofile_links');
    function my_xprofile_links() {
    if (has_filter('bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data')) {
    remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9 );
    }
    if (has_filter('bp_get_the_profile_field_value', 'bxcft_xprofile_filter_link_profile_data')) {
    remove_filter( 'bp_get_the_profile_field_value', 'bxcft_xprofile_filter_link_profile_data', 9);
    }
    add_filter( 'bp_get_the_profile_field_value', 'my_xprofile_filter_link_profile_data', 10, 2);
    }
    
    function my_xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' ) {
    if ( 'datebox' == $field_type )
    return $field_value;
    
    if ( !strpos( $field_value, ',' ) && ( count( explode( ' ', $field_value ) ) > 5 ) )
    return $field_value;
    
    $values = explode( ',', $field_value );
    
    if ( !empty( $values ) ) {
    foreach ( (array) $values as $value ) {
    $value = trim( $value );
    $new_values[] = make_clickable( $value );
    }
    $values = implode( ', ', $new_values );
    }
    return $values;
    }
    
    #177094
    talon42
    Participant

    Probably also worth noting that everything works fine for logged in users. We are specifically looking to have the blog accessible to non-logged in users, and the community private (only logged in members have access).

    #177093
    talon42
    Participant

    Hi there,
    So I’m using this plugin on WP 3.8 and BP1.9.1 and hsving a little difficulty. Tried a couple things here to make a private community before finally finding thi plugin that actually works – thanks.

    Question : how do I have a public blog, with a private BP? I entered the blog as one of the unblocked pages, however the blog does not show up. Can you help?

    Thanks.

Viewing 25 results - 1,926 through 1,950 (of 5,233 total)
Skip to toolbar