Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 12,476 through 12,500 (of 32,521 total)
  • Author
    Search Results
  • #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.

    #143336
    Stephen Edgar
    Keymaster

    To achieve this you would just make an alternate CSS stylesheet based of the main bbPress stylesheet and enqueue it as part of your theme.

    You’d simply use display: none for the bits you don’t need.

    <link rel="stylesheet" id="bbpress-print-css" href="http://example.com/bbpress-print-css.css" type="text/css" media="print">

    #143334
    Stephen Edgar
    Keymaster

    See this thread on how one user did it for SimplePress:

    bbPress SimplePress 5 Importer

    Also a search with a few of these keyowrds: mod_rewrite, phpbb or vbulletin at Stack Overflow will give you some good examples to go by: http://stackoverflow.com/

    mshane8
    Participant

    I have imported through WP Dashboard Import – Forums, Topics and Replies but they are not displaying properly. It shows Forums and then a # of Topics but on the far right it shows 0 topics in a forum and when I click on the specific forum it says “there are 0 topics” even though the topics and replies have all been imported and show in the WP Dashboard.

    I have a static page with shortcode: [bbp-forum-index] used to call the forum index. Maybe it is a permalink problem.

    #143321
    mshane8
    Participant

    Hi Robin –

    I am too far along. That is not an option.

    Do you know where bbPress places the database tables. What is the default table prefix?

    I am not sure why this is so complex. I have imported through WP/Dashboard/Tools/Import – Forums, Topics and Replies individually through xml files.

    I have a static page that calls the forum index using the shortcode : [bbp-forum-index]

    This page displays OK. It will show the # of topics but when I click on the forum itself it opens up the forum but shows 0 topics. All the topics, forums and replies are in the WP Dashboard assigned to the proper author.

    #143314

    In reply to: Forum Question

    Robin W
    Moderator

    ok, I’ll do some code tomorrow and come back !

    #143294
    Robin W
    Moderator

    Sort of think that’s how it is designed to work, the idea being that you eye is drawn to the latest unstuck post, and then immediately above it is the latest stuck post, so it works
    sticky – early to late.
    unsticky – late to early.

    Suspect there’s a bit of code you can do to change the order.
    The function bbp_get_stickies

    sits in

    \bbpress\includes\topics\functions.php

    #143292

    In reply to: Creating a new forum

    Robin W
    Moderator

    I don’t directly have any experience of maintenance plugins.

    However creating a test/backup site, whilst requiring some further learning, is of great benefit, and discussed in the documentation here

    https://codex.bbpress.org/creating-a-test-site/

    #143291
    Robin W
    Moderator

    Sorry, I failed to add the other bit of code you need !!

    The last paragraph should have read :

    …and then on your page template add this function where you want it.

    <?php if(is_front_page() ) { display_latest_topic () ; } ?>
    

    I’ve wrapped it in an if is_front_page statement so it only shows on the frontpage. You night need to use is_home instead depending on how your blog is set up.

    If you want it in the body, you should put it within the content div, either before or after the loop depending if you want it at the of or bottom of the page. You may need to play a bit !

    If any of that isn’t clear, do come back, but let me know what theme you’re using as well

Viewing 25 results - 12,476 through 12,500 (of 32,521 total)
Skip to toolbar