Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'private'

Viewing 25 results - 1,251 through 1,275 (of 5,233 total)
  • Author
    Search Results
  • Florent
    Participant

    Hello,

    I’m trying for several hours to add Bootstrap classes btn and btn-primary to the leave group button but I cannot understand why my modifications in buddypress-functions.php are not taken into account.

    Text search for group-button and leave-group CSS classes returns a unique file called buddypress-functions.php. I modified this file in plugin/buddypress/..., in my-theme/buddypress/buddypress-functions.php and in my-child-theme/buddypress-functions.php but for some reason my modifications in this file are not taken into account.

    When I remove random portion of the code in the file buddypress-functions.php of my child theme then BP returns errors so this prove to me the file is read.

    Do you have an idea what is wrong ?

    Please find the portion of the code that set the CSS classes in buddypress-functions.php:
    (I replace group-button by btn btn-primary but no effect 🙁

    /**
     * Join or leave a group when clicking the "join/leave" button via a POST request.
     *
     * @since 1.2.0
     *
     * @return string HTML
     */
    function bp_legacy_theme_ajax_joinleave_group() {
    	// Bail if not a POST action.
    	if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
    		return;
    
    	// Cast gid as integer.
    	$group_id = (int) $_POST['gid'];
    
    	if ( groups_is_user_banned( bp_loggedin_user_id(), $group_id ) )
    		return;
    
    	if ( ! $group = groups_get_group( array( 'group_id' => $group_id ) ) )
    		return;
    
    	if ( ! groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
    		if ( 'public' == $group->status ) {
    			check_ajax_referer( 'groups_join_group' );
    
    			if ( ! groups_join_group( $group->id ) ) {
    				_e( 'Error joining group', 'buddypress' );
    			} else {
    				echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
    			}
    
    		} elseif ( 'private' == $group->status ) {
    
    			// If the user has already been invited, then this is
    			// an Accept Invitation button.
    			if ( groups_check_user_has_invite( bp_loggedin_user_id(), $group->id ) ) {
    				check_ajax_referer( 'groups_accept_invite' );
    
    				if ( ! groups_accept_invite( bp_loggedin_user_id(), $group->id ) ) {
    					_e( 'Error requesting membership', 'buddypress' );
    				} else {
    					echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
    				}
    
    			// Otherwise, it's a Request Membership button.
    			} else {
    				check_ajax_referer( 'groups_request_membership' );
    
    				if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) {
    					_e( 'Error requesting membership', 'buddypress' );
    				} else {
    					echo '<a id="group-' . esc_attr( $group->id ) . '" class="group-button disabled pending membership-requested" rel="membership-requested" title="' . __( 'Request Sent', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Request Sent', 'buddypress' ) . '</a>';
    				}
    			}
    		}
    
    	} else {
    		check_ajax_referer( 'groups_leave_group' );
    
    		if ( ! groups_leave_group( $group->id ) ) {
    			_e( 'Error leaving group', 'buddypress' );
    		} elseif ( 'public' == $group->status ) {
    			echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';
    		} elseif ( 'private' == $group->status ) {
    			echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>';
    		}
    	}
    
    	exit;
    }
    #248499
    bertl11
    Participant

    Hello,

    how can I disable the public message option or button?
    I want the users only to send private messages.

    Thanks for your help!

    #248476

    In reply to: Private Pages Glitch?

    burger0815
    Participant

    I wrote:

    ….somehow I had the impression that private had also worked for authors before the update….but thats another thing”

    and

    In my application sofar all members are editors (and currently planned to be editors),

    The last sentence is wrong, I actually intended sofar all members to be authors (Autor in german) not editors (Redakteur in german).

    I wrote the first sentence because before Shane’s comment I am pretty sure that I had tested wether the private pages are visible for authors and not only for editors or admins and thus I am pretty sure that they were so before. It is just that after Shane’s comment I wanted to check back. Unfortunately before I could check back there was an
    automatic wordpress update, which now unfortunately screwed up the intended application.

    #248475

    In reply to: Private Pages Glitch?

    burger0815
    Participant

    @fscbmwcca

    I’m sorry I haven’t expressed myself well and now off topic.

    no. Your comments were definitely helpful and in no way off topic. Thanks again.
    I understand now what you mean by subscriber – it’s called “abonnent” in german.
    I actually tested wether abonnent may still be able to see the activities with the above hack (and not only admin or editor) and the activities are still viewable for all who are logged in, so if subscriber isn’t blocked by Shane’s plugin then may be the above hack would work for you (at least for a while until the next update).
    But it is somewhat weird that this works since I just checked back – as Shane said: private pages are really only visible for admins and editors….at least after the last automatic update.(….somehow I had the impression that private had also worked for authors before the update….but thats another thing). Its weird.

    #248453
    Hastig
    Participant

    Thanks very much guys!

    Is it just my blind eyes or is hookr.io impossible to read? Font size is tiny, color is invisible. A fantastic resource though, bookmarked it, thanks again!

    For anybody interested, I just wanted a ‘send private message’ button that I could place anywhere on the page.

    The simple way seems to be to use this..

    <?php bp_send_private_message_button(); ?>

    On click it will open the send message page with the person you want to message already set.

    bp_send_private_message_button is a function that echos bp_get_send_message_button
    bp_send_private_message_button is located in /bp-messages/bp-messages-template.php

    source http://hookr.io/plugins/buddypress/2.4.3/functions/bp_send_private_message_button/

    if you’re wanting to change the text of the link you can add this to functions.php or bp-custom.php

    function custom_change_send_private_message_text($args) { 
    	$args[link_text] = 'send message'; 
    	return $args;
    }
    add_filter( 'bp_get_send_message_button_args', 'custom_change_send_private_message_text', 1, 1 );

    ..thats courtesy of shanebp..
    https://buddypress.org/support/topic/private-message-button-label-change/

    another version i was playing with if its of use to anyone..

    function custom_change_send_private_message_text($args) { 
    	$userName = bp_get_displayed_user_username();
    	$args[link_text] = 'send ' . $userName . ' a private message'; 
    	return $args;
    }
    add_filter( 'bp_get_send_message_button_args', 'custom_change_send_private_message_text', 1, 1 );

    ..you would have to figure out how to remove the hyphen from the username.

    #248447
    shanebp
    Moderator

    It doesn’t handle the avatar.
    It creates Friend, Public & Private messages buttons.
    And provides a hook for you to add another call.

    See function setup_actions() in this file for where it is hooked to create the default buttons:
    buddypress\bp-templates\bp-legacy\buddypress-functions.php

    #248445
    Hastig
    Participant

    I’m wanting to look at the code for bp_member_header_actions so I can write a function based on it.

    It’s the action that collectively outputs the avatar, add friend and private message buttons on a users profile page.

    I’ve searched all files in bp-core, bp-friends, bp-members and bp-messages.

    do_action( 'bp_member_header_actions' );

    I’m not even seeing it mentioned on http://phpxref.ftwr.co.uk/buddypress/

    Anybody know off hand where it is before I check everywhere else?

    #248412

    In reply to: Private Pages Glitch?

    fscbmwcca
    Participant

    I know the plugin doesn’t address my issue but keeps BuddyPress for members only and hide it from non-logged in users. Privacy is very important to our members. I will upload the members that are truly members from a csv file from a list that is provided for me and give the Contributor Role. What I meant by subscriber is the “Subscriber” Role (vs Contributor, Author, Editor, Administrator).
    I’m sorry I haven’t expressed myself well and now off topic. I was just trying to provide a solution for making pages private.

    #248401

    In reply to: Private Pages Glitch?

    burger0815
    Participant

    @shanebp

    If you’re referring to the Visibility checkbox feature – Private means only viewable by admins and editors.

    OOOOK. thanks for the hint….I admit I haven’t yet looked into the manual, as said I am a newcomer -that is I first tried to make sense of what I saw.

    In my application sofar all members are editors (and currently planned to be editors), so the private check in the visibility box on pages makes those pages private for “members”. And since if I understood correctly the BP member functions (activity component etc.) are “instanced” by filling the member page it seems it would in principle be enough to set this page to private….if the BP code would have found the page, which it didnt therefore the above hack.
    But for the future eventually we might want to include non-editing members as well so thanks this is certainly important to know.

    @fscbmwcca
    I haven’t tried the plugin, as said it seems as if it doesn’t go together that straightforward with the blog. By your description it sounds almost as if it’s not secluding the whole subadress, (like …/member/wildcart) but only specific adresses then this would
    not go together with the blog at all. What are subscribers?
    Can you set all your members to be editors? Then maybe the above solution I sofar use might help.

    #248399

    In reply to: Private Pages Glitch?

    shanebp
    Moderator

    With the WordPress 4.4/BuddyPress 2.4.3/bbPress 2.5.8, if you set any of the BuddyPress pages set to private you get the following error “The following active BuddyPress Components do not have associated WordPress Pages: Activity Streams. Repair”

    True – If you set Visibility to Private!
    Not true if you set the ‘Public or Private’ checkbox provided by the BP Simple Private.

    I want people to be able to register as Subscribers but Subscribers should not see any of the BuddyPress/bbPress stuff, only the Contributors and above should be part of the BuddyPress/bbPress community.

    So you want to limit access to BP content based on a user’s role.
    That is a different issue from the original poster’s issue.
    You should create a new topic.
    The BP Simple Private plugin discussed above is not applicable to your issue.

    #248397

    In reply to: Private Pages Glitch?

    fscbmwcca
    Participant

    With the WordPress 4.4/BuddyPress 2.4.3/bbPress 2.5.8, if you set any of the BuddyPress pages set to private you get the following error “The following active BuddyPress Components do not have associated WordPress Pages: Activity Streams. Repair”

    I tried the https://wordpress.org/plugins/buddypress-members-only/ and that didn’t seem to do what I wanted. I want people to be able to register as Subscribers but Subscribers should not see any of the BuddyPress/bbPress stuff, only the Contributors and above should be part of the BuddyPress/bbPress community. So I need to be able to exclude Subscribers from BuddyPress/bbPress. I have looked and there is some code out there that seems pretty old so I don’t know if it would work and I am not so great with php so I am a little hesitant. I am also new to BuddyPress so I’m not sure of all the ins and outs.

    I tested the plugin and it’s working, in the settings there are two areas [edited – please do not copy & paste such data ]
    I hope I am being clear.

    #248396

    In reply to: Private Pages Glitch?

    shanebp
    Moderator

    …is a bit irritating, finally that feature exists already in a standard BP wordpress version.

    If you’re referring to the Visibility checkbox feature – Private means only viewable by admins and editors.
    https://en.support.wordpress.com/post-visibility/

    #248394

    In reply to: Private Pages Glitch?

    burger0815
    Participant

    @fscbmwcca

    thanks for the comment. If I understand correctly then the option:
    allows an admin to select which Post types and BuddyPress Components are private
    seems to indicate that things like the activity component or the member community component
    could be set private.
    Did you test the plugin?

    The sentence:
    provides a Private checkbox in the upper right corner of every page, post, and custom post type selected in Settings

    is a bit irritating, finally that feature exists already in a standard BP wordpress version.
    That is at least in my BP wordpress version you can already mark
    pages as private (i.e. non accessible to non-logged-in members),
    i.e. there is already a checkbox. And if there wouldn’t be the bug then
    setting the member page and activity to private would have set “the component” to
    private, if I understood correctly.
    Is the plugin checkbox another checkbox?

    There is a plugin which, by its description, seems to set everything private:
    https://wordpress.org/plugins/buddypress-members-only/
    and which lets you specify which subadresses should be open.
    But in my case this is not so helpful because
    I want the blog to be public and the blog is not behind a /blog/ adress
    but behind the year /2015/… etc.
    so I would need to set each year adress open, which seems OK but not really
    straightforward.

    shanebp
    Moderator

    Did you flush all caches?
    Before and after making any changes via the BP Simple Private plugin?
    If you want to discuss further, please contact me via the info in my profile on this site.

    shanebp
    Moderator

    By ‘private’, you mean only visible to logged-in users?

    If so, this may solve your issue:

    http://www.philopress.com/products/bp-simple-private/

    or

    https://wordpress.org/plugins/bp-simple-private/

    helloeng
    Participant

    Hello

    I’ve noticed that anyone, including non-members, non-subscribed visitors to my page can view the ‘members’ tab, and read the members profile information.

    I can’t find any options to make information private. Where can I find this?

    Wordpress 4.4
    Buddypress 2.40

    Thanks

    #248326

    In reply to: Private Pages Glitch?

    fscbmwcca
    Participant

    I installed BP Simple Private it seems to let you mark pages as private and if not logged in it redirects the page. I am only testing now and seems to be working. What I ultimately want to do is exclude “Subscribers” from BuddyPress and bbPress. Haven’t found how to do that yet.

    #248323

    In reply to: Private Pages Glitch?

    burger0815
    Participant

    Hello Brajesh Singh and Engine44

    I am a newcomer to buddypress and I think I had similar problems as Engine44.
    Frankly I could imagine that there are more people who have this
    problem but eventually don’t even realize it as a problem.
    In particular I can’t imagine that all that bp networks which
    are used by schools want to have kids discuss in public. So it might
    be a severe problem. But as said I am a newcomer so I might easily be
    wrong.

    The following concerns mostly the member and activity pages (I hope they are called
    this way, this is a direct translation from german), which are either set
    public -or if set private can’t be found anymore (which seems to kill more or less all major bp functions, like you can’t see profile etc.) I haven’t looked into groups yet.

    I asked a person for help who is pretty proficient in solving general programming
    problems but who is not a programmer and in particular not a PHP programmer. So eat with
    utmost caution.

    He came up with the following hack:
    The activity and member pages need to be public in order to assign them
    on the bp page. (I think this is the default upon installation)
    Then set the pages to private.

    go to buddypress/bp-core/bp-core-functions.php
    and then in function bp_core_get_directory_pages() {…

    change

    $page_names = $wpdb->get_results( „SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_statues = ‘publish’ ” );

    into

    // temporary hack
    if ( is_user_logged_in() ) {
    $page_names = $wpdb->get_results( “SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) ” );
    } else {
    $page_names = $wpdb->get_results( “SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_statues = ‘publish’ ” );
    }
    // was:
    // $page_names = $wpdb->get_results( “SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_statues = ‘publish’ ” );
    // /temporary hack

    #248284
    zigsolutions
    Participant

    So a member that is in a private group and not a member of any other group can be seen in the members directory of the site? If so, is there a way to restrict this so that no one can see a complete list of members?

    Also, I’ve created three private groups. As the Group Administrator of all three groups, when I look at the groups I see there are three groups but it doesn’t list them out which I think is strange since I’m the administrator. I go to the page that I’ve set as the default Group page in the settings.

    Thanks for your help!

    onix07
    Participant

    Hello I have a problem disappear buttoms profile private message and the public , after the addition of friends. The only problem is my theme in the standard all right. buddypress 2.4.3 theme customizrscreenshot1scr2

    #248133
    Max Zhubr
    Participant

    Hi there, All!

    How can I make a subnav with a static link in profile?
    I’ve got an Events+ plugin installed, and I’m trying to add a subnav link to the profile tab called “Events” with a static link, that should redirect to page /events/.

    Here is the code of the BP connected part of plugin:

    <?php
    /*
    Plugin Name: BuddyPress: My Events
    Description: Adds an Events tab to your user profiles.
    Plugin URI: http://premium.wpmudev.org/project/events-and-booking
    Version: 1.0
    AddonType: BuddyPress
    Author: WPMU DEV
    */
    
    /*
    Detail: Displays lists of user RSVPs on your users member pages.
    */
    
    class Eab_BuddyPress_MyEvents {
    
    	private $_data;
    
    	private function __construct () {
    		$this->_data = Eab_Options::get_instance();
    	}
    
    	public static function serve () {
    		$me = new Eab_BuddyPress_MyEvents;
    		$me->_add_hooks();
    	}
    
    	private function _add_hooks () {
    		add_action('admin_notices', array($this, 'show_nags'));
    		add_action('eab-settings-after_plugin_settings', array($this, 'show_settings'));
    		add_filter('eab-settings-before_save', array($this, 'save_settings'));
    
    		add_action('bp_init', array($this, 'add_bp_profile_entry'));
    	}
    
    	function show_nags () {
    		if (!defined('BP_VERSION')) {
    			echo '<div class="error"><p>' .
    				__("You'll need BuddyPress installed and activated for My Events add-on to work", Eab_EventsHub::TEXT_DOMAIN) .
    			'</p></div>';
    		}
    	}
    
    	private function _check_permissions () {
    		$post_type = get_post_type_object(Eab_EventModel::POST_TYPE);
    		return current_user_can($post_type->cap->edit_posts);
    	}
    
    	function add_bp_profile_entry () {
    		global $bp;
    		bp_core_new_nav_item(array(
    			'name' => __('Events', Eab_EventsHub::TEXT_DOMAIN),
    			'slug' => 'my-events',
    			'show_for_displayed_user' => true,
    			'default_subnav_slug' => ($this->_check_permissions() ? 'organized' : 'attending'),
    			'screen_function' => '__return_false',
    		));
    		if ($this->_check_permissions()) {
    			bp_core_new_subnav_item(array(
    				'name' => __('Organized', Eab_EventsHub::TEXT_DOMAIN),
    				'slug' => 'organized',
    				'parent_url' => $bp->displayed_user->domain . 'my-events' . '/',
    				'parent_slug' => 'my-events',
    				'screen_function' => array($this, 'bind_bp_organized_page'),
    			));
    		}
    		bp_core_new_subnav_item(array(
    			'name' => __('Attending', Eab_EventsHub::TEXT_DOMAIN),
    			'slug' => 'attending',
    			'parent_url' => $bp->displayed_user->domain . 'my-events' . '/',
    			'parent_slug' => 'my-events',
    			'screen_function' => array($this, 'bind_bp_attending_page'),
    		));
    		bp_core_new_subnav_item(array(
    			'name' => __('Maybe', Eab_EventsHub::TEXT_DOMAIN),
    			'slug' => 'mabe',
    			'parent_url' => $bp->displayed_user->domain . 'my-events' . '/',
    			'parent_slug' => 'my-events',
    			'screen_function' => array($this, 'bind_bp_maybe_page'),
    		));
    		bp_core_new_subnav_item(array(
    			'name' => __('Not Attending', Eab_EventsHub::TEXT_DOMAIN),
    			'slug' => 'not-attending',
    			'parent_url' => $bp->displayed_user->domain . 'my-events' . '/',
    			'parent_slug' => 'my-events',
    			'screen_function' => array($this, 'bind_bp_not_attending_page'),
    		));
    		do_action('eab-events-my_events-set_up_navigation');
    	}
    
    	function bind_bp_organized_page () {
    		add_action('bp_template_title', array($this, 'show_organized_title'));
    		add_action('bp_template_content', array($this, 'show_organized_body'));
    		add_action('bp_head', array($this, 'enqueue_dependencies'));
    		bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
    	}
    	function bind_bp_attending_page () {
    		add_action('bp_template_title', array($this, 'show_attending_title'));
    		add_action('bp_template_content', array($this, 'show_attending_body'));
    		add_action('bp_head', array($this, 'enqueue_dependencies'));
    		bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
    	}
    	function bind_bp_maybe_page () {
    		add_action('bp_template_title', array($this, 'show_maybe_title'));
    		add_action('bp_template_content', array($this, 'show_maybe_body'));
    		add_action('bp_head', array($this, 'enqueue_dependencies'));
    		bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
    	}
    	function bind_bp_not_attending_page () {
    		add_action('bp_template_title', array($this, 'show_not_attending_title'));
    		add_action('bp_template_content', array($this, 'show_not_attending_body'));
    		add_action('bp_head', array($this, 'enqueue_dependencies'));
    		bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
    	}
    
    	function enqueue_dependencies () {
    		global $bp;
    		if ('my-events' != $bp->current_component) return false;
    		wp_enqueue_style('eab-bp-my_events', plugins_url('events-and-bookings/css/eab-buddypress-my_events.css'));
    	}
    
    	function show_organized_title () {
    		echo __('Organized Events', Eab_EventsHub::TEXT_DOMAIN);
    	}
    	function show_attending_title () {
    		echo __('Attending Events', Eab_EventsHub::TEXT_DOMAIN);
    	}
    	function show_maybe_title () {
    		echo __('Maybe attending Events', Eab_EventsHub::TEXT_DOMAIN);
    	}
    	function show_not_attending_title () {
    		echo __('Not attending Events', Eab_EventsHub::TEXT_DOMAIN);
    	}
    
    	function show_organized_body () {
    		global $bp;
    		echo '<div id="eab-bp-my_events-wrapper">';
    		echo '<div class="eab-bp-my_events eab-bp-organized">' .
    			Eab_Template::get_user_organized_events($bp->displayed_user->id) .
    		'</div>';
    		echo '</div>';
    	}
    	function show_attending_body () {
    		global $bp;
    		$premium = $this->_data->get_option('bp-my_events-premium_events');
    		if (!empty($premium)) {
    			if ('nag' == $premium) add_filter('eab-event-user_events-before_meta', array($this, 'premium_event_rsvp'), 10, 3);
    			if ('hide' == $premium) add_filter('eab-event-user_events-exclude_event', array($this, 'exclude_premium_event_rsvp'), 10, 2);
    		}
    		echo '<div id="eab-bp-my_events-wrapper">';
    		echo '<div class="eab-bp-my_events eab-bp-rsvp_yes">' .
    			Eab_Template::get_user_events(Eab_EventModel::BOOKING_YES, $bp->displayed_user->id) .
    		'</div>';
    		echo '</div>';
    	}
    	function show_maybe_body () {
    		global $bp;
    		echo '<div id="eab-bp-my_events-wrapper">';
    		echo '<div class="eab-bp-my_events eab-bp-rsvp_maybe">' .
    			Eab_Template::get_user_events(Eab_EventModel::BOOKING_MAYBE, $bp->displayed_user->id) .
    		'</div>';
    		echo '</div>';
    	}
    	function show_not_attending_body () {
    		global $bp;
    		echo '<div id="eab-bp-my_events-wrapper">';
    		echo '<div class="eab-bp-my_events eab-bp-rsvp_no">' .
    			Eab_Template::get_user_events(Eab_EventModel::BOOKING_NO, $bp->displayed_user->id) .
    		'</div>';
    		echo '</div>';
    	}
    
    	function premium_event_rsvp ($content, $event, $status) {
    		if (!$event->is_premium()) return $content;
    
    		global $bp;
    		$user_id = $bp->displayed_user->id;
    		if (Eab_EventModel::BOOKING_YES != $status) return $content;
    		if ($event->user_paid($user_id)) return $content;
    
    		$content .= '<div class="eab-premium_event-unpaid_notice"><b>' . __('Event not paid', Eab_EventsHub::TEXT_DOMAIN) . '</b></div>';
    
    		return $content;
    	}
    
    	function exclude_premium_event_rsvp ($exclude, $event) {
    		if ($exclude) return $exclude;
    
    		global $bp;
    		$user_id = $bp->displayed_user->id;
    
    		if (!$event->is_premium()) return false;
    		return !$event->user_paid($user_id);
    	}
    
    	function show_settings () {
    		$tips = new WpmuDev_HelpTooltips();
    		$tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
    		$premium = $this->_data->get_option('bp-my_events-premium_events');
    		$options = array(
    			'' => __('Do nothing special', Eab_EventsHub::TEXT_DOMAIN),
    			'hide' => __('Hide', Eab_EventsHub::TEXT_DOMAIN),
    			'nag' => __('Show nag notice', Eab_EventsHub::TEXT_DOMAIN),
    		);
    ?>
    <div id="eab-settings-my_events" class="eab-metabox postbox">
    	<h3 class="eab-hndle"><?php _e('My Events settings', Eab_EventsHub::TEXT_DOMAIN); ?></h3>
    	<div class="eab-inside">
    		<div class="eab-settings-settings_item" style="line-height:1.8em">
    	    	<label for="eab_event-bp-my_events-premium_events"><?php _e('Non-paid premium events with positive RSPVs', Eab_EventsHub::TEXT_DOMAIN); ?>:</label>
    	    	<?php foreach ($options as $value => $label) { ?>
    	    		<br />
    				<input type="radio" id="eab_event-bp-my_events-premium_events-<?php echo esc_attr($value); ?>" name="event_default[bp-my_events-premium_events]" value="<?php echo esc_attr($value); ?>" <?php checked($value, $premium); ?> />
    	    		<label for="eab_event-bp-my_events-premium_events-<?php echo esc_attr($value); ?>"><?php echo esc_html($label) ?></label>
    	    	<?php } ?>
    			<span><?php echo $tips->add_tip(__('How to deal with non-paid premium events on user events list display.', Eab_EventsHub::TEXT_DOMAIN)); ?></span>
    	    </div>
    	</div>
    </div>
    <?php
    	}
    
    	function save_settings ($options) {
    		$options['bp-my_events-premium_events'] = $_POST['event_default']['bp-my_events-premium_events'];
    		return $options;
    	}
    }
    
    Eab_BuddyPress_MyEvents::serve();
    
    class Eab_MyEvents_Shortcodes extends Eab_Codec {
    
    	protected $_shortcodes = array(
    		'my_events' => 'eab_my_events',
    	);
    
    	public static function serve () {
    		$me = new Eab_MyEvents_Shortcodes;
    		$me->_register();
    	}
    
    	function process_my_events_shortcode ($args=array(), $content=false) {
    		$args = $this->_preparse_arguments($args, array(
    		// Query arguments
    			'user' => false, // User ID or keyword
    		// Appearance arguments
    			'class' => 'eab-my_events',
    			'show_titles' => 'yes',
    			'sections' => 'organized,yes,maybe,no',
    		));
    
    		if (is_numeric($args['user'])) {
    			$args['user'] = $this->_arg_to_int($args['user']);
    		} else {
    			if ('current' == trim($args['user'])) {
    				$user = wp_get_current_user();
    				$args['user'] = $user->ID;
    			} else {
    				$args['user'] = false;
    			}
    		}
    		if (empty($args['user'])) return $content;
    
    		$args['sections'] = $this->_arg_to_str_list($args['sections']);
    		$args['show_titles'] = $this->_arg_to_bool($args['show_titles']);
    
    		$output = '';
    
    		// Check if the user can organize events
    		$post_type = get_post_type_object(Eab_EventModel::POST_TYPE);
    		if (in_array('organized', $args['sections']) && user_can($args['user'], $post_type->cap->edit_posts)) {
    			$output .= '<div class="' . $args['class'] . ' eab-bp-organized">' .
    				($args['show_titles'] ? '<h4>' . __('Organized Events', Eab_EventsHub::TEXT_DOMAIN) . '</h4>' : '') .
    				Eab_Template::get_user_organized_events($args['user']) .
    			'</div>';
    		}
    
    		if (in_array('yes', $args['sections'])) {
    			$output .= '<div class="' . $args['class'] . ' eab-bp-rsvp_yes">' .
    				($args['show_titles'] ? '<h4>' . __('Attending Events', Eab_EventsHub::TEXT_DOMAIN) . '</h4>' : '') .
    				Eab_Template::get_user_events(Eab_EventModel::BOOKING_YES, $args['user']) .
    			'</div>';
    		}
    
    		if (in_array('maybe', $args['sections'])) {
    			$output .= '<div class="' . $args['class'] . ' eab-bp-rsvp_maybe">' .
    				($args['show_titles'] ? '<h4>' . __('Maybe attending Events', Eab_EventsHub::TEXT_DOMAIN) . '</h4>' : '') .
    				Eab_Template::get_user_events(Eab_EventModel::BOOKING_MAYBE, $args['user']) .
    			'</div>';
    		}
    
    		if (in_array('no', $args['sections'])) {
    			$output .= '<div class="' . $args['class'] . ' eab-bp-rsvp_no">' .
    				($args['show_titles'] ? '<h4>' . __('Not attending Events', Eab_EventsHub::TEXT_DOMAIN) . '</h4>' : '') .
    				Eab_Template::get_user_events(Eab_EventModel::BOOKING_NO, $args['user']) .
    			'</div>';
    		}
    
    		$output = $output ? $output : $content;
    
    		return $output;
    	}
    
    	public function add_my_events_shortcode_help ($help) {
    		$help[] = array(
    			'title' => __('My Events archives', Eab_EventsHub::TEXT_DOMAIN),
    			'tag' => 'eab_my_events',
    			'arguments' => array(
    				'user' => array('help' => __('User ID or keyword "current".', Eab_EventsHub::TEXT_DOMAIN), 'type' => 'string:or_integer'),
    				'class' => array('help' => __('Apply this CSS class', Eab_EventsHub::TEXT_DOMAIN), 'type' => 'string'),
    				'show_titles' => array('help' => __('Show section titles', Eab_EventsHub::TEXT_DOMAIN), 'type' => 'boolean'),
    				'sections' => array('help' => __('Show these sections. Possible values: "organized", "yes", "maybe", "no".', Eab_EventsHub::TEXT_DOMAIN), 'type' => 'string:list'),
    			),
    		);
    		return $help;
    	}
    }
    
    Eab_MyEvents_Shortcodes::serve();

    Thanks in advance!

    #248098
    debabratsharma
    Participant

    buddypress version:2.4.3
    wp version: 4.4

    I want to make default page for non-members where there will be login and registration page and some content….
    I have check bp private plugin but it broke my admin area….please help..

    #248088

    In reply to: Compatibility

    Hugo Ashmore
    Participant

    If you are taking this topic to a private channel, then this topic will be closed. Please remember that public forums are intended for open topics where the help may benefit others, also the referenced issue is a third party plugin, not BuddyPress the correct avenue of help would be the plugins WP support forum normally.

    #247983
    jjma100
    Participant

    I have a category which is set to private and has sub forums (that are open) within it are set to open. The sub forums are not showing to the admin and show a page 404.

    If I make the category public then I can see the forum but so can the public. The idea is to have the forums to registered users only so can someone help?

    I am using the latest version of bbpress and wordpress, all plugins disabled and using the stock theme.

    all the best,

    Jon

    ravi.vincit
    Participant

    Hiii,

    I want to hide private message option for specific users according to their membership levels like (Premium Membership , Standard Membership) which is shown on profile page of any user.

    When standard users sends a private message to other standard user , then I want to hide this private message option , by this standard-to-standard users will not send private messages.

    But when standard user wants to send private message to other premium user then the private message will not be hide by this standard users can send private message to other premium user but not to standard users.

    Attachment : http://awesomescreenshot.com/0a85h4y065
    Website Link: http://dev.veggistreff.com
    Premium User Credentials: Login- priya
    Password- 12345

    Standard User Credentials: Login- riccha
    Password- 12345

    Thanks In Advance.

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