Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,451 through 12,475 (of 32,504 total)
  • Author
    Search Results
  • #143485
    Gilles Vauvarin
    Participant

    I found this solution :

    add_action( 'bbp_template_before_single_forum' , 'xxxx_bbp_display_forum_description' );
    
    function xxxx_bbp_display_forum_description() {
        echo '<div>';
        bbp_forum_content();
        echo '</div>';
    }
    #143484

    In reply to: Fly-Fishing Site

    ZachMatthews
    Participant

    It’s a nice site; no worries about the ad, but I would be curious to see what that code does to an out of the box version of bbPress. It should get it pretty close; I just use a lot of ‘Inspect Element’ clicking to figure out what might be broken and tweak it. The main issue with bbPress and Pinboard is to do with the .onecol format, which for some reason is broken. Just an FYI, I’ve also modified the header.php file and the search.php file in Pinboard to move their built-in slider up to the utmost top of the page, so I can use it as a banner. It doesn’t quite work on my forums page, because that’s actually in a sub-category but in the blog section it slides. Just to explain why that may look different.

    One other thing of note: in building my site I did a multisite install with three different instances of Pinboard running different sections. This allows me to keep the (1) Board, (2) Blog/Gear Reviews/Podcasts/Videos, and (3) Photoblog separate. The photoblog has like 1700 images so I didn’t want those mixed in with general purpose posts, and in order to make the board work with the CSS tweaks above, I had to set it up as a multisite so I could configure the other sections differently, get away from a one column layout, etc. The good news is in a multi-site the user carries their logged in status and identity from section to section regardless of which blog they’re in.

    Zach

    #143479
    Kris35
    Participant

    Hi Robin, thanks for this and sorry for not thanking you sooner – I completely forgot…..oops!! My coder is trying to sort this out for me but it really isnt a simple task. If anyone else out tehre has managed to do this, please let me know and if I manage it, I will post how here.

    #143470
    kvr28
    Participant

    if the topic index shortcode would work in a widget, that would make me happy, I just tried it with a plugin, didn’t work so good

    #143465

    Topic: User Profiles

    in forum Themes
    NovaSev
    Participant

    I’m trying to figure out a few things – I’ve done a search and read through a couple dozen or so items without much luck.

    I’d like to incorporate some more info into the bbPress user profiles – I know I can probably do this using the $curauth params but want to make sure. I also want to make authors/contributors/etc link to the bbPress profiles as well. Is there a quick piece of code I can use to do this within my WordPress theme files?

    I have this function to return an author profile page when the name is clicked on:

    function new_comment_author_profile_link(){
    
        /* Get the comment author information */
        global $comment;
        $comment_ID = $comment->user_id;
        $author = get_comment_author( $comment_ID );
        $url    = get_comment_author_url( $comment_ID );
    
        /* Return the default WordPress comment author link if comment author is not
        a registered user */
        if ($comment_ID == 0){
            if ( empty( $url ) || 'http://' == $url )
                $return = $author;
            else
                $return = "<a href='$url' rel='' class='author-url'>$author</a>";
        } else {
        /* Return the link to the comment author's profile page if otherwise */
            $return = '<a href="'.home_url().'/?author='.$comment_ID.'">'.$author.'</a>';
        }
    
        return $return;
    }

    Can I plug in some line/piece of code to direct it to the bbPress profile instead? If so, what piece?

    Wordpress & bbPress are latest versions – website is http://www.novasev.com
    Appreciate the feedback.

    #143452

    In reply to: No toolbar available

    Liberty
    Participant

    I added the code and got an error message: Connection lost.

    #143449
    Bob1nz
    Participant

    hmm seems the formatting for that code in 14 is not quite right

    $bbp_roles['my_custom_role1'] = array(
    'name' => 'name 1',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
     
    );

    is => supposed to be => (just from other examples I’v seen in other posts)
    it also spat errors at me with the extra empty lines between the lines of code.

    Either way here is the code that works might be worth updating the codex thing

    function add_custom_role( $bbp_roles ) {
    
    $bbp_roles['my_custom_role1'] = array(
    'name' => 'name 1',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants 
    );
    $bbp_roles['my_custom_role2'] = array(
    'name' => 'name 2',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role3'] = array(
    'name' => 'name 3',
    'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster 
    );
    return $bbp_roles;
    }
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );

    Thanks heaps for your help 🙂
    Now to play around with this and the capabilities.

    #143448

    In reply to: No toolbar available

    Robin W
    Moderator

    Try it with the return added !

    function add_tiny() {
    bbp_get_the_content(array ( 		
    'tinymce' => true,
    ));
    Return $args ;
    }
    add_filter ('bbp_before_get_the_content_parse_args','add_tiny') ;
    #143446
    Robin W
    Moderator

    yes, go to

    Layout and functionality – Examples you can use

    and no. 15 if you want to change capabilities

    sremy
    Participant

    Hi,

    I recently installed bbpress on my site and had no issues with it – it worked really well. But I changed my permalinks to %category% for the category base. And suddenly the forums stopped working. I tried copying the short code, and even clicking “view forum” direct from the forum creator, and it keeps coming up as a 404, even though they are clearly visible in the back end.

    When I remove the %category% permalink, it returns to normal, but then of course that stops me being able to permalink my categories (which is something I need to do for this site). I have tried un installing and re installing the plugin, but it doesn’t seem to have any effect. Any idea what might be going on, and how to resolve it?

    #143438
    Stephen Edgar
    Keymaster

    Someone else here has done the import/conversion when using wp-united, here it is, should be some good tips for you: https://bbpress.org/forums/topic/phpbb3-import-incomplete-and-switches-authors/

    Also https://codex.bbpress.org/import-forums/ & https://codex.bbpress.org/import-forums/phpbb

    #143432

    In reply to: No toolbar available

    Liberty
    Participant

    I already tried this code but I had the same problem with this editor.

    function add_tiny() {
    bbp_get_the_content(array ( 		
    'tinymce' => true,
    ));
    }
    add_filter ('bbp_before_get_the_content_parse_args','add_tiny') ;

    I think the problem is in the bbpress.php file. I will change same code on weekend and hope I will find the problem.

    #143427

    In reply to: No toolbar available

    Robin W
    Moderator

    ok, I had a look, and yours is definitely trying to use the wp-editor not the tinymce one.

    My forum calls

    <div id="qt_bbp_topic_content_toolbar" class="quicktags-toolbar">
    

    under the title.

    Yours calls

    <div id="wp-bbp_topic_content-editor-container" class="wp-editor-container">
    

    As to why, I can’t say. You could try

    function add_tiny() {
    bbp_get_the_content(array ( 		
    'tinymce' => true,
    ));
    }
    add_filter ('bbp_before_get_the_content_parse_args','add_tiny') ;
    

    in your functions file to force it to use the mce editor

    (I haven’t tried that code so may need some editing)

    The function in form-topic uses bbp_the_content which calls bbp_get-the_content – both functions are in

    bbpress/includes/common/template.php

    if you want a look.

    I am now away for the weekend !

    #143408

    That will definitely cause you some grief. pre_get_posts is called on every posts query that fires, even non-bbPress ones.

    In this case, you’re filtering every admin query and looking for a meta value that won’t exist for certain post types (like revisions, pages, posts, attachments, navigation menus, etc…)

    You’ll want to target your code much more specifically than you are here, so that you’re only matching the correct query conditions for what you’re trying to accomplish. This might be hard if you’re also trying to filter sidebars and widgets, since you want something broad, but not too broad.

    #143403
    inspirationally
    Participant

    ok, got it.
    I was sorting the topics by number of replies with this:

    <?php
    /*
    Plugin Name: Set Post Order In Admin
    Version: 0.1
    Plugin URI: https://wordpress.org/support/topic/336715/
    Description: In Posts->Edit, display posts in title order.
    Author: MichaelH
    Author URI: https://codex.wordpress.org/User:MichaelH/MyPlugins
    */
    
    function set_post_order_in_admin( $wp_query ) {
      if ( is_admin()) {
    
    $wp_query->set( 'orderby', 'meta_value_num' );
    $wp_query->set( 'meta_key', '_bbp_reply_count' );
        $wp_query->set( 'order', 'DESC' );
      
    }}
    
    add_filter('pre_get_posts', 'set_post_order_in_admin' );
    ?>

    this seems to cause the replies not to be deleted, too, curiously.`

    Any idea why this happens? And how to delete the orphan replies + postmeta.

    #143382
    kvr28
    Participant

    thanks, actually one of my forum members has been working on it as well, I had shown the wpengine desk his code and above is what they came up with, so he made a change and it works

    here was his thoughts on it

    The reason I asked if you still had an old version running was to check if there might be any variations to the old urls that we might want to process. But as long as people can get to the main threads, its better than them hitting 404s (not found).

    So I tried it and it worked. A bit of redundancy in there, but its working. Very close to mine, not entirely sure where mine went wrong other than that I gobbled across a “/” to “-forum/”. I’m also puzzled by the .* instead of .+ I think his choice to leave off the end-of-line $ is interesting.

    The redundancy I refer to is he captures garbage twice, then uses the 3rd capture. Would you humor me and try…

    Source = ^/forum/.+/.+/(.+)-thread.+
    Destination = /forums/topic/$1/

    I did and it works well, so his might be a better option

    #143377
    Robin W
    Moderator

    The display name is currently a user choice. You could disable that by some code, but you would need to decide what to display instead eg username, email etc. But this is now completely opposite to your starting point to “allow users to choose a name and avatar before posting on a forum”.

    Perhaps it would be easier if you described what it is that you would like to achieve and why in both profile and in the topic/reply display, rather than specific queries without any explanation.

    I will try and assist you further

    Robin W
    Moderator

    ok,

    What I’d suggest you do is look in the main theme for a 404.php, and edit this to give a login link.

    (If it doesn’t have a 404.php, then copy a page.php or index.php file across to your child theme and rename it 404.php. Look for the “loop” part of the code, and put the stuff in there instead)

    You could then edit this file to have a link to your login and some different text.

    So for instance if the 404.php files says “oops sorry this link appears to be broken”

    you could amend this to :

    This page cannot display. This maybe because you are not logged in. To login click here

    or however your users login on.

    They will probably go to the home page once logged in, so having the relevant posts in say the sidebar (eg latest topics widget) will let them quickly navigate to the post.

    If any of the above not clear, please do come back.

    #143354
    Robin W
    Moderator

    “I needed to add the form, topic and forum manually [bbp-topic-index] [bbp-topic-form][bbp-forum-index] and have not found a manual solution for the login ([bbp-topic-login] didn’t work..))”

    See the documentation for set up details including login in sidebar

    Step by step guide to setting up a bbPress forum – Part 1


    and

    Layout and functionality – Examples you can use


    for setting up menu and modal logins

    As for your 404 error, I presume that the urls are correct, for instance

    http://www.hightearecepten.nl/recipe/vijgencompote/

    works with bbpress deactivated, but not when it is activated?

    I’d check first whether there is a plugin conflict, and then a theme conflict viz ;

    Check other plugins

    Check that no other plugins are affecting this.

    Turn off all other plugins, and see if that fixes the problem. If the problem is resolved, add back one at a time to see which is causing the conflict.

    Check themes

    If plugins are not the cause, then it may be a theme issue. Switch to a default theme, such as twentytwelve, and test.

    If it is Themeforest, I’d raise it with them, as it is a paid theme, and with over 1 million bbpress downloads they should have seen it, or know what to do. I have seen some comments that some themeforest themes do not support bbPress, but don’t know about this one.

    #143349

    In reply to: Forum Question

    Robin W
    Moderator

    ok, so create the forum as ‘private’ – you see a visibility setting on the forum page when you create it.

    Then drop this code into your (child)themes functions file.

    //code to add tutor role 
    
    function add_tutor_role( $bbp_roles )
    {
    	/* Add a role called Tutor */
    	$bbp_roles['bbp_tutor'] = array(
    		'name' => 'Tutor',
    		'capabilities' => custom_capabilities( 'bbp_tutor' )
    		);
    	return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_tutor_role', 1 );
    
    function tutor_role_caps_filter( $caps, $role )
    {
    	/* Only filter for roles we are interested in! */
    	if( $role == 'bbp_tutor' )
    		$caps = custom_capabilities( $role );
     
    	return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'tutor_role_caps_filter', 10, 2 );
    
    function custom_capabilities( $role )
    {
    	switch ( $role )
    	{
    		 
    		/* Capabilities for 'tutor' role */
    		case 'bbp_tutor':
    			return array(
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => false,
    				'moderate'              => false,
    				'throttle'              => false,
    				'view_trash'            => false,
     
    				// Forum caps
    				'publish_forums'        => false,
    				'edit_forums'           => false,
    				'edit_others_forums'    => false,
    				'delete_forums'         => false,
    				'delete_others_forums'  => false,
    				'read_private_forums'   => true,
    				'read_hidden_forums'    => false,
     
    				// Topic caps
    				'publish_topics'        => false,
    				'edit_topics'           => false,
    				'edit_others_topics'    => false,
    				'delete_topics'         => false,
    				'delete_others_topics'  => false,
    				'read_private_topics'   => true,
     
    				// Reply caps
    				'publish_replies'       => false,
    				'edit_replies'          => false,
    				'edit_others_replies'   => false,
    				'delete_replies'        => false,
    				'delete_others_replies' => false,
    				'read_private_replies'  => true,
     
    				// Topic tag caps
    				'manage_topic_tags'     => false,
    				'edit_topic_tags'       => false,
    				'delete_topic_tags'     => false,
    				'assign_topic_tags'     => false,
    			);
    			break;
     
    		default :
    			return $role;
    	}
    }
    

    The set any tutors up with the tutor role in dashboard>users> user and at the bottom of the set up you’ll see forum role.

    If any of that’s not clear or beyond your knowledge, do come back, and I’ll help further

    Mike
    Participant

    Hi,
    The menu options Forums, Topics and Replies appear on some of my sites in a multisite install, but not all.

    If I change this in bbpress.php:

    'show_ui' => current_user_can( 'bbp_topics_admin' ),

    to

    'show_ui' => current_user_can( 'manage_options' ),

    I can see the Topics menu. Same if I change the permissions for the Forums and Replies menu.
    Why should it be that the Forums, Topics and Replies menus are showing in some of my sites, but not others? I am administrator and keyholder in all of my sites.

    I am using WordPress 3.8.1 and Buddypress 1.9.1 and I’ve set up bbPress for Sitewide and Group forums.

    #143345
    Gilles Vauvarin
    Participant

    Hello,

    I would like to display on the front-end (over forum list on bbpress root page) the forum’s description (see here: http://i.imgur.com/o3c5iA1.png … to see what i’m speaking about).

    I know there is a hook to put some content in this area “bbp_template_before_forums_index” but is there a function or a shortcode to get the forum’s description (http://i.imgur.com/o3c5iA1.png) ?

    Thx

    #143344
    Apokh
    Participant

    Okay the first part is to replace the function within the template.php but where goes the second one? function alsb_get_post_root_forum($post_id)

    I´m not php common, so di I have to replace the whole function bbp_current_user_can_publish_replies()function within the template.php with your code?

    #143339
    dtbaker
    Participant

    I couldn’t find a working (simple) voting system for bbpress so I rolled my own:

    Feature Requests

    If it continues to work over the coming weeks I’ll clean up the code and share it.

    #143338
    dtbaker
    Participant

    I couldn’t find a working (simple) voting system for bbpress so I rolled my own:

    Feature Requests

    If it continues to work over the coming weeks I’ll clean up the code and share it.

Viewing 25 results - 12,451 through 12,475 (of 32,504 total)
Skip to toolbar