Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,851 through 5,875 (of 32,505 total)
  • Author
    Search Results
  • #178572
    THWright
    Participant

    I can’t recall where I had found this code, fairly certain on the forums here, but here is a pastebin of the code:
    http://pastebin.com/J9whPuCV

    It shows category forums and then any forums beneath it, up to one level. It isn’t the entire hierarchical display but could be modified somehow, I would imagine, to show more. How I’m not sure.

    You will want to place this file in your child theme in the themes/childtheme/bbpress directory; you’ll want to name the file loop-forums.php

    Note: I did change the names of my forum’s columns to Topics, Posts, and Recent, for what its worth.

    #178564
    maegras
    Participant

    Hi all i’m new to bbpress. I read lot of docs but i was unable to solve this issue

    I’m setting up a forum for my website, i installed bbpress, created a forum, created a page with bbpres shortcode and now i’m able to see forum root clicking on the link in menu.

    I can create discussions from backend but when i try to create a new topic from frontend, logged in as admin, i got “you don’t have permission to post”.

    How could it be?

    #178528

    In reply to: BBPress slowness save

    Stephen Edgar
    Keymaster

    If it’s taking 15 seconds to do add a reply or a topic you most definately have a plugin or theme manipulating post queries, most likely pre_get_posts filter is running in a plugin, maybe a theme.

    Please disable ALL our plugins and test the speed again please.

    If the speed remains the same, try switching to the Twenty Fourteen theme.

    You’ll also notice here on bbpress.org it does not take 15 seconds

    #178512
    Robin W
    Moderator

    something is broken !

    can you tell me how your page is set up?

    see https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/

    and which of item 3?

    contemplate
    Participant

    Hi All. Needed this exact behavior as well. It really should be the default behavior. But if you don’t want to hack the core here is the code to place in your functions.php or custom plugin:

    
    /**
     * Format the BuddyBar/Toolbar notifications
     * Fixed: https://bbpress.org/forums/topic/new-reply-notification-link-to-the-reply/
     */
    function bbp_format_buddypress_notifications_custom( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
    
    	// New reply notifications
    	if ( 'bbp_new_reply' === $action ) {
    		$topic_id    = bbp_get_reply_topic_id( $item_id );
    		$topic_title = bbp_get_topic_title( $topic_id );
    		$topic_link  = wp_nonce_url( add_query_arg( array( 'action' => 'bbp_mark_read', 'topic_id' => $item_id ), bbp_get_reply_url( $item_id ) ), 'bbp_mark_topic_' . $item_id );
    		$title_attr  = __( 'Topic Replies', 'bbpress' );
    
    		if ( (int) $total_items > 1 ) {
    			$text   = sprintf( __( 'You have %d new replies', 'bbpress' ), (int) $total_items );
    			$filter = 'bbp_multiple_new_subscription_notification';
    		} else {
    			if ( !empty( $secondary_item_id ) ) {
    				$text = sprintf( __( 'You have %d new reply to %2$s from %3$s', 'bbpress' ), (int) $total_items, $topic_title, bp_core_get_user_displayname( $secondary_item_id ) );
    			} else {
    				$text = sprintf( __( 'You have %d new reply to %s',             'bbpress' ), (int) $total_items, $topic_title );
    			}
    			$filter = 'bbp_single_new_subscription_notification';
    		}
    
    		// WordPress Toolbar
    		if ( 'string' === $format ) {
    			$return = apply_filters( $filter, '<a href="' . esc_url( $topic_link ) . '" title="' . esc_attr( $title_attr ) . '">' . esc_html( $text ) . '</a>', (int) $total_items, $text, $topic_link );
    
    		// Deprecated BuddyBar
    		} else {
    			$return = apply_filters( $filter, array(
    				'text' => $text,
    				'link' => $topic_link
    			), $topic_link, (int) $total_items, $text, $topic_title );
    		}
    
    		do_action( 'bbp_format_buddypress_notifications', $action, $item_id, $secondary_item_id, $total_items );
    
    		return $return;
    	}
    }
    remove_filter( 'bp_notifications_get_notifications_for_user', 'bbp_format_buddypress_notifications', 10 );
    add_filter( 'bp_notifications_get_notifications_for_user', 'bbp_format_buddypress_notifications_custom', 10, 5 );
    
    /**
     * Hooked into the new reply function, this notification action is responsible
     * for notifying topic and hierarchical reply authors of topic replies.
     * Fixed: https://bbpress.org/forums/topic/new-reply-notification-link-to-the-reply/
     */
    function bbp_buddypress_add_notification_custom( $reply_id = 0, $topic_id = 0, $forum_id = 0, $anonymous_data = false, $author_id = 0, $is_edit = false, $reply_to = 0 ) {
    
    	// Bail if somehow this is hooked to an edit action
    	if ( !empty( $is_edit ) ) {
    		return;
    	}
    
    	// Get autohr information
    	$topic_author_id   = bbp_get_topic_author_id( $topic_id );
    	$secondary_item_id = $author_id;
    
    	// Hierarchical replies
    	if ( !empty( $reply_to ) ) {
    		$reply_to_item_id = bbp_get_topic_author_id( $reply_to );
    	}
    
    	// Get some reply information
    	$args = array(
    		'user_id'          => $topic_author_id,
    		'item_id'          => $reply_id,
    		'component_name'   => bbp_get_component_name(),
    		'component_action' => 'bbp_new_reply',
    		'date_notified'    => get_post( $reply_id )->post_date,
    	);
    
     	// Notify the topic author if not the current reply author
     	if ( $author_id !== $topic_author_id ) {
    		$args['secondary_item_id'] = $secondary_item_id ;
    
    		bp_notifications_add_notification( $args );
     	}
     
     	// Notify the immediate reply author if not the current reply author
     	if ( !empty( $reply_to ) && ( $author_id !== $reply_to_item_id ) ) {
    		$args['secondary_item_id'] = $reply_to_item_id ;
    
    		bp_notifications_add_notification( $args );
     	}
    }
    remove_action( 'bbp_new_reply', 'bbp_buddypress_add_notification', 10 );
    add_action( 'bbp_new_reply', 'bbp_buddypress_add_notification_custom', 10, 7 );
    
    #178488
    Jon Fergus
    Participant

    r-a-y and Robkk, you can have a look on my staging site’s group topic to see the reply form location issue live. This is how it operates for me (using Robkk’s example above): Attempting to reply to Reply 1 will prompt the reply form to appear under Reply 3. Attempting to reply to Reply 2 will also prompt the reply form to appear under Reply 3. The only time the reply form appears where we want it is when replying to Reply 3 (i.e. the last reply of any column of replies, so long as there are no sub-replies).

    See here: http://staging-nexus.universaltheosophy.com/groups/test-group/forum/topic/test-group-topic/

    I think I remember seeing someone playing with the reply.js code trying to tackle this very issue, so will try to find that again. At the time it didn’t help me because I still hadn’t got reply.js to work at all.

    I’ll spend some time working through the visual tab issue. Thanks for the links.

    #178487
    Milan Petrovic
    Participant

    Hi,

    Does anyone know how to use bbPress conditionals when bbPress is used for group forums? None of the bbp_is_ functions is working outside of the bbPress templates, and the point of the conditional functions is to have them work outside of the bbPress own template so that some other piece of code knows what is the page context. I am trying to use these functions inside the page BODY.

    So, how to determine which forum is loaded as group forum, which topic is currently displayed, and anything else related to subpages for edit of topics and replies?

    Milan

    #178476
    Robkk
    Moderator

    One other little thing though. I notice that the reply form appears below all sub-replies of a reply, instead of directly beneath the intended reply.

    I think the reply.js code and possible other areas for threaded replies code can be improved to fix this. No idea how right now.

    When the reply form is at its default location in a bbpress topic, the Visual tab works fine. But when the reply form pops up after clicking “reply” on a comment, the Visual tab fails to work (can’t type in it or see the contents).

    I think this is another known issue. One of these tickets need to possible be reopened and include a patch for this issue.

    https://bbpress.trac.wordpress.org/ticket/2700

    https://bbpress.trac.wordpress.org/ticket/2646

    #178471
    Jon Fergus
    Participant

    Damn, another issue has come up. On my main site I’ve added the “Visual” tab to the reply form, using the following code in my functions.php file:

    /* add visual editor to bbpress replies */ 
    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        $args['teeny'] = false;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    When the reply form is at its default location in a bbpress topic, the Visual tab works fine. But when the reply form pops up after clicking “reply” on a comment, the Visual tab fails to work (can’t type in it or see the contents). I reproduced the issue on my staging site for you to see:

    http://staging-nexus.universaltheosophy.com/groups/test-group/forum/topic/test-group-topic/

    I’m also using the “TinyMCE Advanced” plugin, but can verify that the issue with the Visual tab is independent of that plugin.

    #178468
    benzouye
    Participant

    Hi,

    GD bbPress Toolbox Pro seems to propose what I want … In their “Integration tweaks” there is a “Logged in user reply in topic” option …
    https://bbpress.dev4press.com/features/integration-tweaks/
    Wish I could see the code only for this option 🙂

    I’ll continue working on it !

    Thanks.

    #178450
    Robkk
    Moderator

    Ok. I found the problem: Buddypress.

    The functionality of reply.js works for bbpress, but does not work if the topic is in a forum that is within a Buddypress group.

    Just tested on your site, as well as my test site. And yes that BuddyPress is related to this issue.

    May not specifically be BuddyPress and their code. I think there are tickets with bbPress’ BuddyPress extend code that might have issues with some conditionals in a bbPress post that is in a group.

    Will look through bbPress trac for some possibly related tickets.

    Edit: Found the ticket.

    https://bbpress.trac.wordpress.org/ticket/2974

    It is pretty easy to workaround this issue as well, since all you have to do is enqueue the javascript with a different conditional or enqueue it sitewide, but doing it sitewide might cause another issue somewhere.

    Will do some testing and get back.

    #178426
    james8181
    Participant

    I just put your code snipets in and saved it but unfortunately it is not taking effect still.

    View post on imgur.com

    I cleared cache and tried a difference browser too but not showing up

    #178424
    james8181
    Participant

    Hi Robin,

    I re-enabled bbpress and the style pack and it seems stable now.

    Your 2 code snippets are saved but not taking effect:

    .entry-content fieldset legend {
    color: #fff !important;
    }

    #bbpress-forums p.bbp-topic-content, #bbpress-forums p.bbp-reply-content {
    color: #1e73be !important;
    }

    A snipet i made myself to style the background of the reply form is taking effect so this customer code area for css in the beaver theme seems to work for bbpress:

    .bbp-form{
    background-color:rgba(250, 236, 113, 0.90);
    }

    Here is a screenshot of what i still need to style. If you could take a look when you get the chance that would be great. http://imgur.com/a/tKRoc

    Many thanks

    #178420
    james8181
    Participant

    No worries. I appreciate your help with this Robin.

    I am using the beaver builder page builder and their beaver child theme. I am entering it into the Appearance > customizer area. There is an area for code snippets in there. I usually put CSS in their global CSS area but have been advised from beaver builder that CSS that needs to affect dynamically generated pages (ie, not pagesi have created in the wordpress UI) need to be put in here.

    #178402

    In reply to: Multiple Forums

    Robin W
    Moderator

    depends

    if you are just talking about having two forums, then if you want you use shortcodes

    single forum [bbp-single-forum id=$forum_id] – Display a single forums topics. eg. [bbp-single-forum id=32]

    and have

    page 1

    [bbp-single-forum id=32]

    Page 2

    [bbp-single-forum id=35]

    #178397
    Robin W
    Moderator

    Ow!! Sorry – believe it or not, that is the first time anyone has tried that !!

    I’ve coded a fix for the next release that will stop that happening in future.

    Can you tell me where you are adding those snippets? I’m more dubious on the first, but the second should work.

    #178378
    Robin W
    Moderator

    ok, I think the first is your theme, but try adding this to the custom css

    #bbpress-forums p.bbp-topic-content, #bbpress-forums p.bbp-reply-content {
        color: #1e73be !important;
    }

    and also add this for the Reply to :

    .entry-content fieldset legend {
        color: #fff !important;
        }
    #178369
    james8181
    Participant

    Hi Robin,

    I have been trying to persevere with this but i am having problems styling this still. I used the parts from the codex to style the background as below, and that is working nicely.

    /*1 Forum Header and Footer*/
    /*2 Reply header*/
    /*3. Template notice info*/
    (also manually changed the background color of the reply form)

    Everything past that up to 8 does not take effect. I would like to just have all of the text in the forum as black as it is currently white on white. My theme settings for text are set to black so i am not sure why it does not inherit this.

    I have tried manually changing each element on there but nothing takes effect (tried prefixing them all with #bbpress-forums like your snippets too). IF you could spare a moment could you take a look at the page (I’ve changed it to show when not logged in) and advise me on what i am doing wrong. Below are all of the areas of text i need as black which i am just appending with { color:#000000;}

    A) On the list of all forums page:

    bbp-forum-info
    bbp-forum-topic-count
    bbp-forum-reply-count
    bbp-forum-freshness

    B) on any topic page with create a new topic option:

    bbp-forum-description
    bbp-topic-permalink
    bbp-author-name
    bbp-topic-freshness

    (The following bit of text are just showing as “label” in chrome inspect so not sure how to target them)
    Topic Title (Maximum Length: 80):
    Notify me of follow-up replies via email
    Attachments:
    No file chosen

    C) within a topic with reply option

    bbp-reply-content
    bbp-topic-description

    (The following bit of text are just showing as “label” in chrome inspect so not sure how to target them)
    Topic Title (Maximum Length: 80):
    Notify me of follow-up replies via email
    Attachments:
    No file chosen

    2)

    I have noticed a seperate issue:

    http://clashingbeavers.com/beaver-forums/
    If i enter any forum and then navigate back by clicking on the Home > Forums link within bbpress UI it will take me to a diffrerent url

    http://clashingbeavers.com/forums/

    and this one looks different. How to stop it taking users to this other url?

    Sorry this went on a bit and your advice is much appreciated!
    Many thanks

    #178367
    james8181
    Participant

    Actually, i will just use change the css using this very informative article:

    bbPress Styling Crib

    I was being lazy not to have done this originally!
    cheers!

    #178360
    james8181
    Participant

    Hello,

    When any user posts in any forum the following error messages appear, however the message DOES actually post. Anyone know what is causing this problem? and how to fix it. I am not a programmer so the code does not mean much to me

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, class ‘BBP_Admin_Replies’ does not have a method ‘update_reply’ in /home/clashing/public_html/wp-includes/plugin.php on line 524

    Warning: Cannot modify header information – headers already sent by (output started at /home/clashing/public_html/wp-includes/plugin.php:524) in /home/clashing/public_html/wp-includes/pluggable.php on line 1174

    WordPress 4.6.1
    bbpress Version 2.5.10
    Beaver Builder Child ThemeVersion: 1.0
    http://clashingbeavers.com/beaver-forums/ (although the forums are hidden when not logged in)

    Thanks for you help

    #178352
    Stephen Edgar
    Keymaster

    Yes, you sure can, either way you mention would work, another option is multisite.

    That said, for either way you mention you’d utilise “shared user tables”

    See this codex doc on setting that up: https://codex.wordpress.org/Editing_wp-config.php#Custom_User_and_Usermeta_Tables

    #178327
    Fourmi
    Participant

    Sorry my message was lacking one useful info! I’m using it from a theme file’s code, using
    echo do_shortcode('[bbp-single-tag id=19]');
    (19 is a correct topic tag id)

    It’s printing the same content that’s in the page I’m looking at (ex: in a forum I see the topics of the forum instead of the topics with the tag). It’s working if I update the query before calling the shortcode:

    $wp_query = new WP_Query(array('post_type' => 'topic'));

    I thought it should be working without having to add this but now it works so I’m happy!

    Thanks for your help!

    #178316
    Robkk
    Moderator

    It works fine for me, remember to use a topic tags id instead of a name.

    [bbp-single-tag id=$tag_id] – Display a list of all topics associated with a specific tag. eg. [bbp-single-tag id=64]

    https://codex.bbpress.org/features/shortcodes/

    To find a topic tags id, you can go to Topics > Topic Tags in the WordPress backend, then edit a topic tag and look at the url. You should see something like this. You can also hover over each edit link and look at the bottom left and see the same url appear. You will see tag_ID=(number).

    yoursite.com/wp-admin/term.php?taxonomy=topic-tag&tag_ID=4&post_type=topic&…

    To make it easier to find an ID of a post, tag, user, you can also install the Reveal IDs plugins to add a column to tables that show the ID.

    #178314
    Fourmi
    Participant

    I’m trying to use this shortcode and it’s not working. I saw this issue was reported several times by the past and it seemed to be resolved but it’s still not working for me.
    I think this was the original ticket: https://bbpress.trac.wordpress.org/ticket/1948

    I want to achieve the same comportment – get a list of topics classified under a specific topic tag. Is there a way I can get the shortcode to work OR could you help me code a workaround?

    Thanks in advance!

    #178307
    Robkk
    Moderator
Viewing 25 results - 5,851 through 5,875 (of 32,505 total)
Skip to toolbar