Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for ' . default . '

Viewing 25 results - 751 through 775 (of 6,789 total)
  • Author
    Search Results
  • #211220

    In reply to: Adding roles

    zirow
    Participant

    I’ve added this reply like 3times and everytime i edit it it disappeared and when i try to re-paste it and submit i cant cuz i get a warning for duplication 😛

    I’m pretty sure theirs a better way of doing it but that’s how I did since its the only way I could figure it out

    Open Capabilities.php

    Under “function bbp_get_caps_for_role”
    Add this case along with the other cases

    case bbp_get_tutor_role() :
    $caps = array(

    // Primary caps
    ‘spectate’ => true,
    ‘participate’ => true,

    // Forum caps
    ‘read_private_forums’ => true,

    // Topic caps
    ‘publish_topics’ => true,
    ‘edit_topics’ => true,

    // Reply caps
    ‘publish_replies’ => true,
    ‘edit_replies’ => true,

    // Topic tag caps
    ‘assign_topic_tags’ => true,
    );

    Under:

    function bbp_get_participant_role() {

    // Filter & return
    return apply_filters( ‘bbp_get_participant_role’, ‘bbp_participant’ );
    }

    Add:

    function bbp_get_tutor_role() {

    // Filter & return
    return apply_filters( ‘bbp_get_tutor_role’, ‘bbp_tutor’ );
    }

    Save and close Capabilities.php and open bbpress.php in the plugin directory not the one inside the theme.

    Search for:
    public function roles_init() {

    You will see this code:

    $keymaster = bbp_get_keymaster_role();
    $moderator = bbp_get_moderator_role();
    $participant = bbp_get_participant_role();
    $spectator = bbp_get_spectator_role();
    $blocked = bbp_get_blocked_role();

    // Build the roles into one useful array
    $this->roles[ $keymaster ] = new WP_Role( ‘Keymaster’, bbp_get_caps_for_role( $keymaster ) );

    $this->roles[ $moderator ] = new WP_Role( ‘Moderator’, bbp_get_caps_for_role( $moderator ) );
    $this->roles[ $participant ] = new WP_Role( ‘Participant’, bbp_get_caps_for_role( $participant ) );
    $this->roles[ $spectator ] = new WP_Role( ‘Spectator’, bbp_get_caps_for_role( $spectator ) );
    $this->roles[ $blocked ] = new WP_Role( ‘Blocked’, bbp_get_caps_for_role( $blocked ) );
    }

    So you just want to add these two codes in their:

    $tutor = bbp_get_tutor_role();

    $this->roles[ $tutor ] = new WP_Role( ‘tutor’, bbp_get_caps_for_role( $tutor ) );

    If u want to rename an existing role u added or bbpress default roles u can add this into your functions.php

    Add:

    function ntwb_bbpress_custom_role_names() {

    return array(

    // Keymaster

    bbp_get_keymaster_role() => array(

    ‘name’ => ‘Administrator’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_keymaster_role() )

    ),

    // Moderator

    bbp_get_moderator_role() => array(

    ‘name’ => ‘Moderator’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_moderator_role() )

    ),

    // Participant

    bbp_get_participant_role() => array(

    ‘name’ => ‘Member’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )

    ),

    bbp_get_tutor_role() => array(

    ‘name’ => ‘Member2’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_tutor_role() )

    ),

    // Spectator

    bbp_get_spectator_role() => array(

    ‘name’ => ‘Spectator’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_spectator_role() )

    ),

    // Blocked

    bbp_get_blocked_role() => array(

    ‘name’ => ‘Blocked’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_blocked_role() )

    )

    );

    }

    #211197
    yongceih
    Participant

    Hi all,

    I would like to know how to change topic slug from default to %parentforum%/%childforum%/topic from DEFAULT: topic.

    https://prnt.sc/sk3e2k

    #211196
    marbaque
    Participant

    I have been having an issue with my website, almost once a day the pages return broken links and 404 errors. I have to manually save the permalinks to fix it.

    I have tried a lot of ways like creating a default htaccess file, but nothing works. So I started deactivating plugins once this happens. When I deactivate bbPress everything works again, so I was wondering if somebody knows what can be causing the issue?

    It happens only to pages, not posts or archives.

    This is the website I am having problems with: https://academiamunicipal.uned.ac.cr/

    #211193

    Topic: login plugin

    in forum Installation
    momomoko
    Participant

    Hello there,

    I am stucked with this issue since some days : i am using the default bbpress connection widget (bpress version : 2.6.4) , but i am not satisfied by it behaviors such as redirect to wordpress admin login, the fact that the link on registration mail, bring the user again to wordpress back end, and also that email sender adress is the wordpress email (not mine !!) .. i had tried to change this last issue with this code in my functions.php :

     add_filter( 'wp_mail_from', 'your_email' );
    function your_email( $original_email_address )
    {
    	return 'myemail@domain.com';
    }
    
    add_filter( 'wp_mail_from_name', 'custom_wp_mail_from_name' );
    function custom_wp_mail_from_name( $original_email_from )
    {
    	return 'My Forum Name';
    }

    But instead i just received a “mail delivery failed”

    I have tried other plugins such as “weaver” or “bbPress login register link..” but still not found the “good one” (or surely didn’t know how to optimize it)

    Did someone know how to solve this problem ??

    #211064
    momomoko
    Participant

    I am looking for a way to change default adress (wordpress) for registration email . Is it possible ?

    #210984
    maznin
    Participant

    Hello everyone.
    I am noticing weird behavior when user clicks on activation link in email.
    Upon clicking user is sent to page with input field that contains random generated password and below that button that says “Reset Password”.
    Now this is somewhat confusing because some users might think that there is no need to click that button and just copy the password and proceed to login link bellow.
    After that password is not working and user must reset password and basically do activation process again.
    Is this how default WordPress registration works?

    Robin W
    Moderator

    so have you essentially done this

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-single-user.php

    transfer this to your pc and edit

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/content-single-user.php

    bbPress will now use this template instead of the original

    #210978
    Robin W
    Moderator

    bbpress just uses WordPress login, so if your users have WordPress access (eg subscribers), then they will get the bbpress default access (or you can manually set this up).

    you then set each forum as ‘private’ and it’s existence is then only seen by subscribers

    #210945
    Robin W
    Moderator

    by default bbpress does not require approval – they should just publish.

    So either you have another plugin doing this (eg bbpress notify) or your comment moderation is set to tight – look in

    dashboard>settings>discussion and check the befor a comment appears and the part below where the no. links allowed in a comment and the words that are allowed.

    #210884
    jazibsaeed
    Blocked

    Hello,

    I am using yoast SEO and bbpress forums on my website i.e. Tooth Republic. Unfortunaltely, i am unable to figure out how to change meta description of main page of forums i.e. https://toothrepublic.com/forums/

    Unlike other pages, edit button does not appear from yoast SEO plugin on this page. When i go to search appearance setting in SEO, it has a section to change default meta description for forums. Should i makes changes there?

    #210839
    Robin W
    Moderator

    it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentyfifteen, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

    #210817
    gordnmclean
    Participant

    I’ve exported a forum from a website, and imported into the new one I’m building. All of the Forums, Topics, and Replies have come across and in the Dashboard it all looks good.

    However, on the live page – http://istc.ismysite.co.uk/our-community/discussion-forums/ – it looks like there are no Topics, and when I go into a Forum, it doesn’t show any topics at all.

    Looking at them in the Dashboard, all Topics are in the right forums.

    I’ve tried disabling this theme (going to the default WordPress Twenty Twenty) but still have the same issue.

    Any ideas? I tried some of the reset options but one of them wiped out all the reply > topic links so wary of having to reimport (again).

    Hayulp!

    g28f99
    Participant

    Hello, I am creating a specialized forum combining wordpress(5.4.1), bbpress(2.6.4) and buddypress(5.2.0). The website is exptoge.com. I have already created child thyme in the wp-content/themes/mytheme folder and used functions.php and style.css to make some customization. Now I need some help to personalize the forum new topic area and new reply area.

    1) New topic area, as shown in Fig 1,
    (please go to here to check all the figures ).
    For every new topic in this forum, I wish the following text appear in the “Topic content edit area” by default: “please clearly describe the place and time duration”. Once the user click in this area to input something, those text will disappear automatically.
    The google search box seems exactly demonstrate this effect as shown in Fig.2. Source of Fig 2, captured at chrome://newtab.

    2) New reply area, as show in Fig.3.

    For every new topic in this forum, I wish some text (e.g. “please select or input your selection” ) appear in the “Reply content edit area” and followed by a drop down selection list (similar to Fig. 4 or Fig.1 below part) by default.

    The selection list is composed of two parts. The first is designed to choose a color, red, blue or others. The second is designed to choose a shape, triangle, circle or others.
    If the users choose others, a new input box will appear so that they can input their other choice. Text “please input your choice” will appear in the input box with function similar to Fig. 2 (requirements of new topic area above).

    After the users make a choice or enter their choice, the choice result will exactly be the reply content. But, the above “please select or input your selection” text will be updated to be “I prefer” texts.

    I am not sure whether it is possible to achieve above functions through making modifications in my themes. Anyway, thanks a lot for your time and efforts. You can log in with username “Daniel” and password as “Daniel8” to test “new topic” and “new reply ” function in this website.

    deborahdavidson
    Participant

    Thank you so much for the plugin recommendation. It solved the problem (brilliant!) and then I started getting these error messages and the emails stopped sending again.

    EMAIL DELIVERY ERROR: the plugin WP Mail SMTP v2.0.0 logged this error during the last time it tried to send an email:
    Mailer: Default (none)
    PHPMailer was able to connect to SMTP server but failed while trying to send an email.
    Please review your WP Mail SMTP settings in plugin admin area. Consider running an email test after fixing it.

    Also “could not instantiate mail function” message appeared in the mail logs.

    Is it possible to point me in the right direction to resolve this? Many thanks.

    #210667
    Ellis Benus
    Participant

    Quick update. I used the CPT UI plugin to create a “Character” Custom Post Type.

    I modified form-reply.php to pull all these Characters and put those into a drop menu (select).

    Each of these CPT’s has their own Post ID, which I’m going to save as “d20_character” in the meta of the Reply.

    Question: Can you tell me the best way to modify the data saved for a reply when the user clicks “Submit”?

    Then in loop-single-reply.php I’m checking for the existence of the “d20_character” meta entry. If that entry exists for a reply, then I am pulling the Post Title of the Character Post by the ID, and the Post Thumbnail (Featured Image) to display that in the bbp-reply-author div instead of the default.

    Question: There are several actions in loop-single-reply.php. What’s the best way to modify those actions on an individual reply basis? I would like the use the same functionality those functions provide, but I need to tell them to use the ID of the Character post associated with the reply instead of the Reply WP User Author.

    Actions: bbp_theme_before_reply_author_details, bbp_reply_author_link, bbp_theme_before_reply_author_admin_details, bbp_theme_after_reply_author_admin_details, bbp_theme_after_reply_author_details

    #210656
    Robin W
    Moderator

    you would start by looking at the topic and reply forms in the templates

    \bbpress\templates\default\bbpress\form-topic.php

    which you can amend and copy to your child theme putting them in a bbpress folder

    these link to the new topic or reply handlers in

    \bbpress\includes\topics\functions.php line 96
    and an equivalent in

    \bbpress\includes\replies\functions.php

    these are called by filters eg

    add_action( ‘bbp_post_request’, ‘bbp_new_topic_handler’, 10 );

    so you could rewrite the new topic handler and call it from a new version of the above action, this could catch the $_POST from your dropdown, and add say an extra meta field, and allocating all topics/replies to a single user_id to prevent needing individual users.

    You can then amend the other templates or use filters to show the drop-down from the meta in the content field.

    #210468
    Robin W
    Moderator

    this

    Function reference

    suggests

    pll_register_string($name, $string, $group, $multiline);
    ‘$name’ => (required) name provided for sorting convenience (ex: ‘myplugin’)
    ‘$string’ => (required) the string to translate
    ‘$group’ => (optional) the group in which the string is registered, defaults to ‘polylang’
    ‘$multiline’ => (optional) if set to true, the translation text field will be multiline, defaults to false

    so maybe

    pll_register_string( 'slug_users', '_bbp_user_slug', 'polylang' );

    #210467
    Kenny Lajara
    Participant

    I tried changing the hook and nothing happened. This is my code now:

    /* Translate Users profile slug with Polylang */
    add_action( 'plugins_loaded','bbp_polylang_integration' );
    function bbp_polylang_integration() {
    	if ( function_exists( 'pll_register_string' ) ) {
    		pll_register_string( 'slug_users', '_bbp_user_slug', 'URL slugs' );
    	}
    } 

    About this:

    so is the context right – maybe ‘Polylang’ which seems to be the default?

    I don’t really understand what you mean.

    #210435
    Robin W
    Moderator

    but if you really want this box gone then,

    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php

    transfer this to your pc and edit to remove

    <?php do_action( 'bbp_theme_before_topic_form_subscriptions' ); ?>
    
    						<p>
    							<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe" <?php bbp_form_topic_subscribed(); ?> />
    
    							<?php if ( bbp_is_topic_edit() && ( bbp_get_topic_author_id() !== bbp_get_current_user_id() ) ) : ?>
    
    								<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php else : ?>
    
    								<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php endif; ?>
    						</p>
    
    						<?php do_action( 'bbp_theme_after_topic_form_subscriptions' ); ?>

    and save

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/form-topic.php

    bbPress will now use this template instead of the original

    then repeat for form-reply.php removing

    <?php do_action( 'bbp_theme_before_reply_form_subscription' ); ?>
    
    						<p>
    
    							<input name="bbp_topic_subscription" id="bbp_topic_subscription" type="checkbox" value="bbp_subscribe"<?php bbp_form_topic_subscribed(); ?> />
    
    							<?php if ( bbp_is_reply_edit() && ( bbp_get_reply_author_id() !== bbp_get_current_user_id() ) ) : ?>
    
    								<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify the author of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php else : ?>
    
    								<label for="bbp_topic_subscription"><?php esc_html_e( 'Notify me of follow-up replies via email', 'bbpress' ); ?></label>
    
    							<?php endif; ?>
    
    						</p>
    
    						<?php do_action( 'bbp_theme_after_reply_form_subscription' ); ?>
    #210383
    Robin W
    Moderator

    found and fixed.

    I’ve put the fix in my style pack plugin version 4.5.0

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>bug fixes

    or put this in your child theme’s function file – or use

    Code Snippets

    add_filter ('bbp_get_topic_merge_link', 'rew_get_topic_merge_link' , 10 , 3) ;
    add_filter ('bbp_is_topic_merge' , 'rew_is_topic_merge' ) ;
    
    function rew_get_topic_merge_link( $args = array() ) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'           => 0,
    			'link_before'  => '',
    			'link_after'   => '',
    			'merge_text'   => esc_html__( 'Merge', 'bbpress' ),
    		), 'get_topic_merge_link' );
    
    		// Get topic
    		$topic = bbp_get_topic( $r['id'] );
    
    		// Bail if no topic or current user cannot moderate
    		if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
    			return;
    		}
    
    		$uri    = add_query_arg( array( 'action' => 'bbp-merge-topic' ), bbp_get_topic_edit_url( $topic->ID ) );
    		$retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-merge-link">' . $r['merge_text'] . '</a>' . $r['link_after'];
    
    		// Filter & return
    		return apply_filters( 'rew_get_topic_merge_link', $retval, $r, $args );
    	}
    
    function rew_is_topic_merge() {
    
    	// Assume false
    	$retval = false;
    
    	// Check topic edit and GET params
    	if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'bbp-merge-topic' === $_GET['action'] ) ) {
    		return true;
    	}
    
    	// Filter & return
    	return (bool) apply_filters( 'rew_is_topic_merge', $retval );
    }
    #210308
    mehrankhanjan
    Participant

    Hi!
    I have a solution.
    In wp-content/plugins/bbpress/templates/default/js/reply.min.js
    replace (d.scrollHeight) with (64)
    that’s it.
    my email for more question if you have:
    mehrankh1913@gmail.com

    #210305
    Robin W
    Moderator

    Put this in your child theme’s function file – or use

    Code Snippets

    function rew_get_topic_split_link( $retval, $r, $args ) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'          => 0,
    			'link_before' => '',
    			'link_after'  => '',
    			'split_text'  => esc_html__( 'Split',                           'bbpress' ),
    			'split_title' => esc_attr__( 'Split the topic from this reply', 'bbpress' )
    		), 'get_topic_split_link' );
    
    		// Get IDs
    		$reply_id = bbp_get_reply_id( $r['id'] );
    		$topic_id = bbp_get_reply_topic_id( $reply_id );
    
    		// Bail if no reply/topic ID, or user cannot moderate
    		if ( empty( $reply_id ) || empty( $topic_id ) || ! current_user_can( 'moderate', $topic_id ) ) {
    			return;
    		}
    
    		$uri = add_query_arg( array(
    			'action'   => 'bbp-split-topic',
    			'reply_id' => $reply_id
    		), bbp_get_topic_edit_url( $topic_id ) );
    
    		$retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" title="' . $r['split_title'] . '" class="bbp-topic-split-link">' . $r['split_text'] . '</a>' . $r['link_after'];
    
    		// Filter & return
    		return apply_filters( 'rew_get_topic_split_link', $retval, $r, $args );
    	}
    
    add_filter ('bbp_get_topic_split_link', 'rew_get_topic_split_link' , 10 , 3) ;
    
    function rew_is_topic_split() {
    
    	// Assume false
    	$retval = false;
    
    	// Check topic edit and GET params
    	if ( bbp_is_topic_edit() && ! empty( $_GET['action'] ) && ( 'bbp-split-topic' === $_GET['action'] ) ) {
    		$retval = true;
    	}
    
    	// Filter & return
    	return (bool) apply_filters( 'rew_is_topic_split', $retval );
    }
    
    add_filter ('bbp_is_topic_split' , 'rew_is_topic_split' ) ;

    and come back and confirm that it works

    #210229
    Robin W
    Moderator

    I’ve had a play this evening with this issue.

    This code is very rough and ready, but if it works as I think it does, then it shows pending REPLIES to the user who posted them and moderators and keymasters. NOT topics !!

    so when a user posts a reply and it goes into moderation, they see there reply in the topic with a warning.

    If you want to try it, put this in your child theme’s function file – or use

    Code Snippets

    add_filter ('bbp_has_replies' , 'rew_has_replies' ) ;
    	
    function rew_has_replies( $args = array() ) {
    
    	/** Defaults **************************************************************/
    
    	// Other defaults
    	$default_reply_search   = bbp_sanitize_search_request( 'rs' );
    	$default_post_parent    = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any';
    	$default_post_type      = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
    	$default_thread_replies = (bool) ( bbp_is_single_topic() && bbp_thread_replies() );
    
    	// Default query args
    	$default = array(
    		'post_type'              => $default_post_type,         // Only replies
    		'post_parent'            => $default_post_parent,       // Of this topic
    		'posts_per_page'         => bbp_get_replies_per_page(), // This many
    		'paged'                  => bbp_get_paged(),            // On this page
    		'orderby'                => 'date',                     // Sorted by date
    		'order'                  => 'ASC',                      // Oldest to newest
    		'hierarchical'           => $default_thread_replies,    // Hierarchical replies
    		'ignore_sticky_posts'    => true,                       // Stickies not supported
    		'update_post_term_cache' => false,                      // No terms to cache
    
    		// Conditionally prime the cache for all related posts
    		'update_post_family_cache' => true
    	);
    
    	// Only add 's' arg if searching for replies
    	// See https://bbpress.trac.wordpress.org/ticket/2607
    	if ( ! empty( $default_reply_search ) ) {
    		$default['s'] = $default_reply_search;
    	}
    
    	// What are the default allowed statuses (based on user caps)
    	if ( bbp_get_view_all( 'edit_others_replies' ) ) {
    
    		// Default view=all statuses
    		$post_statuses = array_keys( bbp_get_topic_statuses() );
    
    		// Add support for private status
    		if ( current_user_can( 'read_private_replies' ) ) {
    			$post_statuses[] = bbp_get_private_status_id();
    		}
    
    		// Join post statuses together
    		$default['post_status'] = $post_statuses;
    
    	// Lean on the 'perm' query var value of 'readable' to provide statuses
    	} else {
    		//get public and pending (not sure if we need this or just to remove the perm status that was here ?
    		$post_statuses = array_keys( rew_get_topic_statuses() );
    	}
    
    	/** Setup *****************************************************************/
    
    	// Parse arguments against default values
    	$r = bbp_parse_args( $args, $default, 'has_replies' );
    
    	// Set posts_per_page value if replies are threaded
    	$replies_per_page = (int) $r['posts_per_page'];
    	if ( true === $r['hierarchical'] ) {
    		$r['posts_per_page'] = -1;
    	}
    
    	// Get bbPress
    	$bbp = bbpress();
    	
    	//now filter the query before execution
    	
    	// Add filter if participant
    	$user_id = get_current_user_id() ;
    	$role = bbp_get_user_role( $user_id );
    	if ($role == 'bbp_participant'  || $role == 'bbp_moderator' || bbp_is_user_keymaster($user_id)) { 
    		add_filter( 'posts_where', 'rew_where' );
    	}
    
    	// Call the query
    	$bbp->reply_query = new WP_Query( $r );
    	
    	
    		// Remove filter
    	if ($role == 'bbp_participant'  || $role == 'bbp_moderator' || bbp_is_user_keymaster($user_id)) { 
    		remove_filter( 'posts_where', 'rew_where' );
    	}
    	
    	// Maybe prime the post author caches
    	if ( ! empty( $r['update_post_family_cache'] ) ) {
    		bbp_update_post_family_caches( $bbp->reply_query->posts );
    	}
    
    	// Add pagination values to query object
    	$bbp->reply_query->posts_per_page = (int) $replies_per_page;
    	$bbp->reply_query->paged          = (int) $r['paged'];
    
    	// Never home, regardless of what parse_query says
    	$bbp->reply_query->is_home        = false;
    
    	// Reset is_single if single topic
    	if ( bbp_is_single_topic() ) {
    		$bbp->reply_query->is_single = true;
    	}
    
    	// Only add reply to if query returned results
    	if ( ! empty( $bbp->reply_query->found_posts ) ) {
    
    		// Get reply to for each reply
    		foreach ( $bbp->reply_query->posts as &$post ) {
    
    			// Check for reply post type
    			if ( bbp_get_reply_post_type() === $post->post_type ) {
    				$reply_to = bbp_get_reply_to( $post->ID );
    
    				// Make sure it's a reply to a reply
    				if ( empty( $reply_to ) || ( bbp_get_reply_topic_id( $post->ID ) === $reply_to ) ) {
    					$reply_to = 0;
    				}
    
    				// Add reply_to to the post object so we can walk it later
    				$post->reply_to = $reply_to;
    			}
    		}
    	}
    
    	// Only add pagination if query returned results
    	if ( ! empty( $bbp->reply_query->found_posts ) && ! empty( $bbp->reply_query->posts_per_page ) ) {
    
    		// Figure out total pages
    		if ( true === $r['hierarchical'] ) {
    			$walker      = new BBP_Walker_Reply();
    			$total_pages = ceil( $walker->get_number_of_root_elements( $bbp->reply_query->posts ) / $bbp->reply_query->posts_per_page );
    		} else {
    
    			// Total for pagination boundaries
    			$total_pages = ( $bbp->reply_query->posts_per_page === $bbp->reply_query->found_posts )
    				? 1
    				: ceil( $bbp->reply_query->found_posts / $bbp->reply_query->posts_per_page );
    
    			// Pagination settings with filter
    			$bbp_replies_pagination = apply_filters( 'bbp_replies_pagination', array(
    				'base'    => bbp_get_replies_pagination_base( bbp_get_topic_id() ),
    				'total'   => $total_pages,
    				'current' => $bbp->reply_query->paged
    			) );
    
    			// Add pagination to query object
    			$bbp->reply_query->pagination_links = bbp_paginate_links( $bbp_replies_pagination );
    		}
    	}
    
    	// Filter & return
    	return apply_filters( 'rew_has_replies', $bbp->reply_query->have_posts(), $bbp->reply_query );
    }
    
    function rew_get_topic_statuses( $topic_id = 0 ) {
    
    	// Filter & return
    	return (array) apply_filters( 'bbp_get_topic_statuses', array(
    		bbp_get_public_status_id()  => _x( 'Open',    'Open the topic',      'bbpress' ),
    		), $topic_id );
    }
    
    function rew_where( $where ) {
    	$user_id = get_current_user_id() ;
        global $wpdb;
    	$posts = $wpdb->posts ;
        return $where . " OR ( 
                 ".$posts.".post_author = ".$user_id."
            AND  ".$posts.".post_status = 'pending'
    		                 
        ) ";
    }
    
    add_action ('bbp_theme_before_reply_content' , 'rew_pending' );
    
    function rew_pending () {
    	$id = bbp_get_reply_id() ;
    	$status = get_post_status ($id) ;
    	if ($status == 'pending' ) {
    	echo '<i><b>This reply is pending review and can only be seen by you and the administrators</b></i>' ;
    	}
    	
    }
    #210167

    In reply to: CSS styling query

    Chuckie
    Participant

    For the other issue, the only thing I can come up with is Additional CSS:

    .enlighter-default .enlighter-raw {
    	display:none !important;
    }

    But is there a more robust solution that avoids the need for this?

    #210157
    Chuckie
    Participant

    Hi

    I have some queries and I wonder if you can help me get to the bottom of them. I would be grateful for your guidance. Here is the background.

    I am using the latest bbPress plugin and I notice that the bbpress.css file is 1702 lines long.

    I am using a premium theme (seos-video-premium) and even though I am using a child theme, I have noticed that my Support forum is actually using:

    wp-content/themes/seos-video-premium/seos-video-premium/css/bbpress.css

    I assume this is because there is no bbpress.css in my child theme css folder so it uses the themes one instead of the bbPress plugin’s one?

    So I have two specific questions here.

    1/ the bbpress.css file in the premium theme folder is actually 1408 lines of code. So it is 300+ lines shorter than the plugin version. To be honest, I was not expecting to find a bbpress.css file inside the theme. So what am I supposed to do? Simply replace the theme version with your plugin version?

    2/ I have been trying to use a beta version of EnlighterJS Plugin (it is their beta that uses EnlighterJS v3. There was an issue with these styles:

    #bbpress-forums div.bbp-topic-content pre,
    #bbpress-forums div.bbp-reply-content pre {
    	display: block;
    	line-height: 18px;
    	margin: 0 0 24px;
    	padding: 5px 10px;
    	white-space: pre;
    	overflow: auto;
    }

    In their classes they have this styling:

    .enlighter-default .enlighter-raw {
        display: none;
        min-width: 100%;
        line-height: inherit;
        font-size: 12px;
        font-family: inherit;
        margin: 0;
        padding: 0;
        white-space: pre-wrap;
        word-wrap: break-word;
        border: none;
        box-shadow: none;
    }

    The HTML is:

    <pre class="enlighter-raw">.textMaterial {
      /* Uncomment to hide the material */
      /* display:none;*/
      font-size: 10pt;
      font-style: italic;
      font-weight: 700;
      background-color: yellow;
    }
    .textMethod {
      /* Uncomment to hide the method */
      /* display:none;*/
      font-size: 10pt;
      font-style: italic;
      font-weight: 700;
      background-color: cyan;
    }</pre>

    Notice that ttheir CSS style uses display: none;? The bbpress CSS file pre class has a display:block;. This causes a problem with the plugin I am trying to use.

    The author does not want to use !important because he says it is bad design. So how do we fix this? How can we allow bbpress to do what it wants with pre and EnlighterJS do what it wants?

Viewing 25 results - 751 through 775 (of 6,789 total)
Skip to toolbar