Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 10,876 through 10,900 (of 94,557 total)
  • Author
    Search Results
  • #267221
    livingflame
    Participant

    Try with this:

    function tubs_sanitize_user($username, $raw_username, $strict) {
        $new_username = strip_tags($raw_username);
        // Kill octets
        $new_username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $new_username);
        $new_username = preg_replace('/&.?;/', '', $new_username); // Kill entities
    
       // If strict, reduce to ASCII for max portability.
       if ( $strict )
            $new_username = preg_replace('|[^a-z0-9 _.\-@+]|i', '', $new_username);
    
        return $new_username;
    }
    add_filter( 'sanitize_user', 'tubs_sanitize_user', 10, 3);

    Source

    Or try with this:

    // Force Strong Username
    function strong_username() {
     global $bp;
    
     if ( !empty( $_POST['signup_username'] ) )
       if ( !valid_username( $_POST['signup_username'] ) ){
        $bp->signup->errors['signup_username'] = __( 'Your username is not strong enough. Use uppercase, lowercase, numbers and special chars like - _', 'bp-strong-username-password', 'buddypress' );
       }
     }
     add_action( 'bp_signup_validate', 'strong_username');
    
     function valid_username($candidate) {
       $r1='/[A-Z]/';  //Uppercase 
       $r2='/[a-z]/';  //lowercase
       $r3='/[0-9]/';  //numbers
       $r4='/[-_]/'; //Special chars, underscore...
    
       if(preg_match_all($r1,$candidate, $o)<1) return FALSE;
       if(preg_match_all($r2,$candidate, $o)<1) return FALSE;
       if(preg_match_all($r3,$candidate, $o)<1) return FALSE;
       if(preg_match_all($r4,$candidate, $o)<1) return FALSE;
       if(strlen($candidate)<6) return FALSE;
    
       return TRUE;
    }
    #267219
    m1000
    Participant

    Hello, it looks like google trends for Buddypress aren’t good. Is there a better altenative for BP? What is trending now?

    Google trends

    metaverso
    Participant

    BuddyPress 2.8.2 (Fatal error on php, 7.0.21 and 7.1.7)

    ON PHP 7.0.21
    Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in /home/xx/public_html/w/xx.com.br/wp-content/themes/wplms/functions.php:60 Stack trace: #0 /home/xx/public_html/w/xx.com.br/wp-settings.php(424): include() #1 /home/xx/public_html/w/xx.com.br/wp-config.php(89): require_once('/home/xxx73/...') #2 /home/xx/public_html/w/xx.com.br/wp-load.php(37): require_once('/home/xxx73/...') #3 /home/x/public_html/w/xx.com.br/wp-admin/admin.php(31): require_once('/home/xxx73/...') #4 /home/xx/public_html/w/xx.com.br/wp-admin/plugins.php(10): require_once('/home/xxx73/...') #5 {main} thrown in /home/xx/public_html/w/xxx.com.br/wp-content/themes/wplms/functions.php on line 60

    ON PHP 7.1.7 (Sometimes this error occurs for no reason. And the error disappears for no reason as well)
    Fatal error: Uncaught Error: [] operator not supported for strings in /home/xx/public_html/w/xx.com.br/wp-content/plugins/vibe-course-module/includes/bp-course-classes.php:106 Stack trace: #0 /home/xx/public_html/w/xx.com.br/wp-content/plugins/vibe-course-module/includes/bp-course-template.php(625): BP_COURSE->get(Array) #1 /home/xx/public_html/w/xx.com.br/wp-content/themes/wplms/course/my-courses.php(20): bp_course_has_items('user_id=893&per...') #2 /home/xxx73/public_html/w/xxx.com.br/wp-includes/template.php(688): require_once('/home/xxx73/...') #3 /home/xxx73/public_html/w/xxx.com.br/wp-includes/template.php(647): load_template('/home/xxx73/...', true) #4 /home/xxx73/public_html/w/xxx.com.br/wp-content/themes/wplms/members/single/course.php(41): locate_template(Array, true) #5 /home/xxx73/public_html/w/xxx.com.br/wp-includes/template.php(688): require_once('/home/xxx73/...') #6 /home/xxx73/public_html/w/xxx.com.br/wp-includes/template.php(647): load_template in /home/xxx73/public_html/w/xxx.com.br/wp-content/plugins/vibe-course-module/includes/bp-course-classes.php on line 106

    —
    Only working in PHP version 5.x
    🙁

    **using theme WPLMS 2.9.2**

    #267211

    In reply to: Help with this code

    Henry Wright
    Moderator

    is_user_logged_in() is a WordPress function. It’ll return true if the user is authenticated and false if not.

    bp_loggedin_user_id() will return the ID of the BuddyPress member currently logged in.

    The two functions are different.

    #267209
    livingflame
    Participant
    #267208
    r-a-y
    Keymaster
    #267206
    Shmoo
    Participant

    Wouldn’t it be more WordPress hierarchy -like if we did something like this to the activity items?

    Maybe instead of the solo entry.php template.

    
    bp_get_template_part( 'activity/types/content', bp_get_activity_type() );
    

    The bp_activity_action() function is probably the most disliked function/action in BuddyPress for myself. This really annoys me like crazy. When creating custom themes for BuddyPress you can easily delete the nav system function and replace them with your own code or create custom menu’s and buttons wherever you want them to show up but the activity stream is by far my least favourite part of the plugin all because of the above function and everything is so glued together, barely customisable.

    Activity items are essentially the same thing as WordPress post formats inside a blog index. I believe they should have their own post-format style of templating just like WordPress does with one pre-build example. An update about a new member or a member writing something on his own are basically the same things as an update + default post format -post to WordPress.

    We could create a single content.php file instead of the entry.php with all the HTML + solo php template functions inside them so they are easily to move around and alter if you like.
    Wen you want your date at the bottom of the activity item, just grab the HTML container + PHP from the top of the document and move it below the content. If you want to go any deeper, just duplicate content.php and rename it to the activity post type you would like to customise and give an unique ‘snippet’ in the stream.

    I’ve been testing this for a few minutes now and it just works. It’s kinda pretty to be honest. The only thing I have to do now is strip apart that bp_activity_action hook function and add all the solo or separate functions to the content.php template.

    Sources:
    Template 1
    Template 2

    #267199
    vecturn
    Participant

    So ever since buddypress was installed users can only register accounts with lowercase usernames and just alphanumeric but I want to add the ability for users to sign up with capital letters in their usernames as well as an underscore if needed.

    I have already tried the “Network Username Overrides” plugin which doesn’t seem to change anything else I still get the error message no matter what settings I use for that plugin.

    Any ideas how to fix this preferably without modifying the core?

    #267198
    x3mp
    Participant

    Hi, Im running into a problem here. I want to add something in my menu that refers direct towards the users profile. I do not have the profile option when I check buddypress in my Screen Options.
    https://gyazo.com/6a3ee4e14085d9695276129875ac7aea
    This is a screenshot of my menu page

    If you need anymore information please ask and thanks in advance.

    WordPress verion 4.8
    Buddypress version 2.8.2

    notamongsheep
    Participant

    I’m having trouble overriding Buddypress template files following the directions and documentation listed here:
    https://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/

    For example, I have modified member-header.php.

    Here is my website’s file structure: child-theme > buddypress > members > single > member-header.php
    And this is Buddypress’ file structure: bp-templates > bp-legacy > buddypress > members > single > member-header.php

    Now, I’m wondering if my parent theme (VideoPro) might have something to do with this not working.
    Must my child theme be a direct child of Buddypress for this to work?

    I have an NDA contract for who I am working with on this, so I can’t provide a link for the website. I can, however, provide screenshots to some degree.

    Both my WordPress installation and BuddyPress installation are up to date and using the latest versions (as of the date of this post)

    #267175
    Shmoo
    Participant

    As mentioned on the GitHub page, jQuery Cookie isn’t longer maintained. Shouldn’t BuddyPress upgrade to JS Cookie because of this?

    https://github.com/carhartl/jquery-cookie

    antelam
    Participant

    I can not enter any characters in any of the input fields on the registration page.
    When I inspect the elements they do not appear to be present in the DOM but do show visually on the screen.
    I checked in Chrome, IE, mobile chrome and native android browser.
    VERSIONS:
    buddypress: 2.8.2
    wp: 4.8
    php: 5.4
    Please help
    Thank you

    #267165
    Henry Wright
    Moderator

    What code do you have at line 102 in themes/buddyapp/lib/plugins/buddypress/navigation-icons.php?

    zacharydash2013
    Participant

    Got this error months ago and have never been able to fix it. Can anyone help me with a random act of kindness on how to fix this? =)

    http://www.everkind.life/

    Warning: Illegal string offset ‘slug’ in /home/everkind/public_html/wp-content/themes/buddyapp/lib/plugins/buddypress/navigation-icons.php on line 102

    Shmoo
    Participant

    I don’t have super advanced PHP skills so I made this as a start to show off only 3 profile fields (will be svg icons later) ..when their set of course.

    
    <?php
    	$twitter = bp_get_member_profile_data( 'field=Twitter', bp_get_member_user_id() );
    	$instagram = bp_get_member_profile_data( 'field=Instagram', bp_get_member_user_id() );
    	$website = bp_get_member_profile_data( 'field=Website', bp_get_member_user_id() );
    
    	if ( isset( $twitter, $instagram, $website ) ) {
    
    		echo '<div class="test">';
    
    			if ( isset( $twitter ) ) {
    				echo '<span>'. $twitter .'</span><br>';
    			}
    			if ( isset( $instagram ) ) {
    				echo '<span>'. $instagram .'</span><br>';
    			}
    			if ( isset( $website ) ) {
    				echo '<span>'. $website .'</span><br>';
    			}
    
    		echo '</div>';
    	}
    ?>
    

    I have this feeling, this can be made better or nicer within some sort of loop instead of all those IF statements.

    Usually I use Advanced Custom Fields Pro for those kinda of things because of their detailed Documentation and examples but I thought it would be overkill to use ACF only for 3 simple fields while BuddyPress has this inside the core.

    Thanks.

    #267157
    wzshop
    Participant

    Ok found that you can just create a child template for /buddypress/members/members-loop.php

    #267153
    akram84
    Participant

    Greetings and thanks for the great plugin
    I have a problem creating a group in buddy press from a mobile view

    This is the image : https://ibb.co/eQjp5Q
    This is the website: http://www.overduty.com
    This is the WordPress theme: https://themeforest.net/item/transfers-transport-and-car-hire-wordpress-theme/12481479

    Seeking your help
    Kind regards,

    #267149
    Shmoo
    Participant

    Hi,

    Don’t know if this codex page is still up to date but I’m trying to exclude a bunch of activity stream items from my site.

    Posting Activity from Plugins

    So I made this.

    
    function dont_save_various_activities( $activity_object ) {
    
    	$exclude = array( 'activity_update', 'new_avatar', 'new_member', 'friendship_accepted', 'friendship_created', 'created_group', 'joined_group', 'new_blog' );
    
    	if ( in_array( $activity_object->type, $exclude ) )
    		$activity_object->type = false;
    
    }
    add_action( 'bp_activity_before_save', 'dont_save_various_activities', 1, 1 );
    

    This excludes almost everything from the activity stream but for some reason you can’t target the ‘… profile was updated …’ activity item. That one keeps showing up when some user edits their profile.

    I only want to record, new: blog posts, comments, topics and replies.

    jalsed
    Participant

    Hi,
    I’m new to BuddyPress and it’s possible I miss something obvious but I can’t find information about this which is why I hope someone could help me in the right direction or with examples.

    I’ve created a Custom Post Type registered to generate activity. And it works.
    What I want to do next is, when a user clicks on a specific activity item to get the CPT details (meta fields). But I can’t find the post_id in or any other relation to the post object in the activity data. How can I set up the custom post type or the activity to get post_id be part of the activity?

    Any ideas?

    #267145
    porcusheep
    Participant

    I got it working! Thank you so much for you help Henry.
    I ended up modifying the code I found in this post: https://buddypress.org/support/topic/hiding-groups-activity-members-list-to-non-members/

    Ran into some issues as bp_is_page( BP_MEMBERS_SLUG ) is no longer working, replaced it with your bp_is_members_directory()

    Then had to figure out why bp_is_page() doesn’t work, found it is replaced with is_page()

    After, some figuring out how to use is_page(), I got everything working with the code below:

    function nonreg_visitor_redirect() {
    	global $bp;
    
    	if (is_page('alchemist-top-250-companies') ) {
    	
    		if(!is_user_logged_in()) {
    			wp_redirect('/stillneedtosetupage' );
    		}
    		
    	}
    	
    	if (bp_is_members_directory() ) {
    	
    		if(!is_user_logged_in()) {
    			wp_redirect('/register' );
    		}
    	}
    }
    add_filter('get_header','nonreg_visitor_redirect',1);
    #267141
    Henry Wright
    Moderator

    The code should go in your bp-custom.php file.

    Ref https://codex.buddypress.org/themes/bp-custom-php/

    That looks like it would work for my members directory but what about doing this for a conditional redirect for a specific post page?

    Which post page are you referring to?

    #267132
    Henry Wright
    Moderator

    Or you can try to access to some page in WordPress admin area (e.g.: with an ajax call) ?

    BuddyPress doesn’t do this by default. Considering you can’t reproduce, I expect the client is using custom code that’s causing the problem (either in their functions.php file, bp-custom.php file or in an activated plugin). Check those 3 locations on your client’s site for anything strange.

    #267130
    bambidotexe
    Participant

    I found a workaround, I’am quite not completely satisfied but…

    First of all, disable members list on group:

    function change_access_group_nav_tabs() {
      if(bp_is_group()) {
        buddypress()->groups->nav->edit_nav( array( 'user_has_access' => false ), 'members', bp_current_item() );
      }
    }
    add_action( 'bp_actions', 'change_access_group_nav_tabs' );

    (btw, setting the value to true actually make the the nav items always here, but we still can’t access the group list on click)

    And then I simply add a custom BP Group Extension to make my own members list:

    class Group_Extension_List_Members extends BP_Group_Extension {
        /**
         * Here you can see more customization of the config options
         */
        function __construct() {
          $args = array(
              'slug' => 'members-list',
              'name' => 'Membres',
              'access' => array( 'anyone'),
              'show_tab' => array( 'anyone'),
              'nav_item_position' => 12,
              'screens' => array(
                  'create' => array(
                      'enabled' => false
                  ),
                  'edit' => array(
                        'enabled' => false
                  ),
              )
          );
          parent::init( $args );
        }
        function display( $group_id = NULL ) {
          //Remove user who do not belong to the group on members loop
          function filter_for_groups( $members_template_has_members, $members_template, $r ) {
            for ($i=sizeof($members_template->members)-1; $i >= 0 ; $i--) {
              $user_id = $members_template->members[$i]->id;
              if(!groups_is_user_member( $user_id, bp_get_group_id() )){
                $members_template->member_count = $members_template->member_count-1;
                array_splice($members_template->members, $i, 1);
              }
            }
            if ($members_template->member_count <= 0) {
              return '';
            } else {
              return $members_template_has_members;
            }
          };
          add_filter( 'bp_has_members', 'filter_for_groups', 10, 3 );
    
          require('/Your/theme/custom/members/loop/members-loop.php');
        }
    }
    bp_register_group_extension( 'Group_Extension_List_Members' );

    Hope it will help other in the future, And I’m still open to know the good way to proceed.

Viewing 25 results - 10,876 through 10,900 (of 94,557 total)
Skip to toolbar