Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,876 through 6,900 (of 32,519 total)
  • Author
    Search Results
  • #172111
    RLsARc
    Participant

    @robkk kindly pls help me 🙂

    change Administrator to an image.

    bbp_get_keymaster_role() => array(
    			'name'         => 'Administrator',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
    		),

    found some code in the net but i don’t know where to insert it.

    #172105

    In reply to: Hiding Sub-parents

    Robin W
    Moderator

    Ok, you need to amend some templates and put these into your child theme

    https://codex.bbpress.org/functions-files-and-child-themes-explained/

    Sub-forum removal

    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

    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-forum.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/loop-single-forum.php
    bbPress will now use this template instead of the original
    and you can amend this to remove the sub forums

    line 44 says <?php bbp_list_forums(); ?>

    delete this line and the sub forums will go !

    forum posts

    do the same as above, but for content-single-forum

    and then take out line 26 that says

    <?php bbp_single_forum_description(); ?>
    
    
    #172100
    Robin W
    Moderator

    https://en-gb.wordpress.org/plugins/global-admin-bar-hide-or-remove/

    or if you know code

    add_filter('show_admin_bar', '__return_false');

    #172087
    _az_
    Participant

    Thanks for pointing that out. I think i should make more use of bbp_parse_args().

    bbp_create_initial_content() seems to be a good idea for deploying initial content, but i needed something more flexible, which can be used in the Dashboard. E.g. for deploying a default structure, given in said JSON File to a newly created Forum.

    #172086
    Robin W
    Moderator

    The code isn’t better, but I wanted to be sure that code itself wasn’t an issue. obviously posting the exact code works, although it doesn’t preform what you wish.

    So back to the gallery plugin author for his help

    I don’t know what giving throttle capability does the dics only discuss the setting

    Throttle posting every
    Set this to the minimum time (in seconds) between posting new replies in bbPress forums. This is useful to help stop spamming or other attempts to interrupt the normal flow of the forum.

    #172085
    awal16
    Participant

    I copied and paste the code again, and now I don’t get the warnings. So, why is this code better :)?

    Besides, what does throttle mean, in the capabilitie?

    #172081
    Robin W
    Moderator

    so did you copy/paste it – exactly as per my code and what exact errors did you get?

    #172078
    Pascal Casier
    Moderator

    Code can go in functions.php of your (child) theme: https://codex.bbpress.org/functions-files-and-child-themes-explained/

    Pascal.

    #172076
    Pascal Casier
    Moderator

    Hi @brad3n,
    When there is a mention of functions.php to add code, it’s always referring to the functions.php of your (child) theme, never inside a plugin.

    https://codex.bbpress.org/functions-files-and-child-themes-explained/

    Pascal.

    #172065
    RONO2
    Participant

    Pascal, so where exactly would I put those particular 3 codes at in the wordpress? or actually in the css section of the theme editor?

    #172063
    Robin W
    Moderator

    Whilst I can see some of your concerns, there are no security concerns that bbpress will let your users access your wordpress site backend – none of us would use bbpress if it had backdoors like that.

    You core issue seem to stem from

    I had to install some bbPress code in my functions file to stop non-administrator profiles from seeing the WordPress main menu at the top of the forum.

    Please explain further? or give us the code you used.

    With that, in having to add code such as this I subsequently shut down my entire site due to adding code the functions.php file that it didn’t like. Not a good situation for me.

    That is a wordpress issue, and if you are not good at coding you should not be editing files ion a live site. You really need a test site

    https://codex.bbpress.org/getting-started/testing-your-bbpress-installation/creating-a-test-site/

    Yes you can set up a separate domain/sub-domain with wordpress and bbpress running, and just show bbpress in this site. BUT you can’t have this administered by the other wordpress site (well at least not at any level of understanding that you would have – you are not ready for multisite 🙂 )

    So either you run one site or two sites. 1 site will not give you security issues if set up correctly in wordpress. 2 sites will mean lots of duplication of usernames, double updating, and more room for error.

    I’d suggest you look strongly at the test site route – this will force you to learn about how a wordpress site is put together, which will allow you to do changes with confidence of more technical knowledge and no risk to live

    Good luck, and do come back and let us know how you get on

    #172062
    awal16
    Participant

    Yes, I tried your other code, in an earlier post of yours. But then I get the warnings again.

    #172058
    Robin W
    Moderator

    All plugin writers write code to try and not interfere with each other – but occasionally we fail.

    I’d suggest you post a thread on their support forum to see if they can help.

    Did you try my shorter code – there is a reason for this question !

    #172057

    In reply to: bbPress & tinyMCE

    mateomrqz
    Participant

    Hi!

    Thank you for the reply. I just want to edit the wp_editor that displays when I click
    “Topics” > “New Topic”.

    I want to remove a couple of buttons of that editor, but I don’t want the change to be global, as I have a lot of other editors with specific parameters. This function works:

    function my_format_TinyMCE( $in ) {
        //styles for the editor to provide better visual representation.
        $in['content_css'] = get_template_directory_uri() . "/build/styles/tiny-mce-editor.css";
        $in['block_formats'] = "Paragraph=p; Heading 1=h1; Heading 2=h2";
        $in['toolbar1'] = 'formatselect,bold,italic,underline,superscript,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,spellchecker';
        $in['toolbar2'] = '';
        $in['toolbar3'] = '';
        $in['toolbar4'] = '';
        return $in;
    }
    add_filter( 'tiny_mce_before_init', 'my_format_TinyMCE' );

    BUT! It will affect and overwrite parameters to my other editors.
    The Hooks/Filters in the documentation of bbpress work, but they seem to only affect when creating a topic/forum not from the wp-admin but from the actual bbpress page.

    Any ideas? Thank you!

    #172056
    Robin W
    Moderator

    ok, so you need to amend form-topic.php

    Presumimg you can use FTP and use an editor

    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

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

    Make a copy of this file, 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
    and you can amend this

    So in form-topic.php you need to amend line 28 from

    <?php if ( bbp_current_user_can_access_create_topic_form() ) : ?>
    

    to

    <?php if ( bbp_current_user_can_access_create_topic_form() && (bbp_get_forum_title() == 'other'  ) : ?>
    

    This should then only allow new topics if the user can create a topic and the cforum title is ‘other’ forum

    This is untested, but should work !

    #172052
    Robin W
    Moderator

    so did you try my code???

    #172043
    mateomrqz
    Participant

    Hello!

    I’m having some issues styling the buttons in the bbPress Topics/Forum section. My website contains a large amount of TinyMCE editors — some need specific styles and buttons. Assigning this was very easy to my custom editors, but I’m facing an issue when trying to customize the bbpress editor. None of the code I found in the forums seems to do anything to the buttons.

    Here is a snipped of how I’m modifying my other editors. Since these are custom, Is easy to modify by just adding the parameters.

    wp_editor(
        $options['callout_body'],
        'callout_body’, //ID OF EDITOR
        array(
            'textarea_name' => 'page_options_employer_guide_thrive_overview[callout_body]',
            'media_buttons' => false,
            'textarea_rows' => 8,
            'tabindex' => 4,
            'quicktags' => false,
            'tinymce' => array(
            'toolbar1'=> 'bold,italic',
            'toolbar2'=> '',
            'toolbar3'=> '',
            ),
        )
    );
    

    The buttons that I need displayed in the bbpress editor are different from any other custom post type or options page editor.

    I’ve tried every snippet I could find in the forums with no luck, no change. I tried to hook to the examples and add filters, with no luck as well.

    I hope I’m clear enough to what I’m trying to achieve.

    Thanks

    #172040
    Robin W
    Moderator

    Try :

    function rew_add_custom_role( $bbp_roles ) {
     
    $bbp_roles['bbp_global_moderator'] = array(
    'name' => 'Globale moderator',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as moderator
    );
    return $bbp_roles;
    }
    add_filter( 'bbp_get_dynamic_roles', 'rew_add_custom_role', 1 );
    #172035
    Robin W
    Moderator

    It’s because you haven’t set the moderate primary cap 3rd one down in the list below.

    The full default mod caps are

    // Moderator
    		case bbp_get_moderator_role() :
    			$caps = array(
    
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    				'moderate'              => true,
    				'throttle'              => true,
    				'view_trash'            => true,
    
    				// Forum caps
    				'publish_forums'        => true,
    				'edit_forums'           => true,
    				'read_private_forums'   => true,
    				'read_hidden_forums'    => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    				'edit_others_topics'    => true,
    				'delete_topics'         => true,
    				'delete_others_topics'  => true,
    				'read_private_topics'   => true,
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    				'edit_others_replies'   => true,
    				'delete_replies'        => true,
    				'delete_others_replies' => true,
    				'read_private_replies'  => true,
    
    				// Topic tag caps
    				'manage_topic_tags'     => true,
    				'edit_topic_tags'       => true,
    				'delete_topic_tags'     => true,
    				'assign_topic_tags'     => true,
    			);

    you are missing

    'moderate'              => true,
    

    from yours !

    #172021

    In reply to: Responsive Issue

    Anticosti
    Participant

    I solved this issue (plus some others) on my side, by adding this CSS:
    Hope this may help someone else….

     
    input#bbp_search { 
      margin: 0.25em 0.25em 0.25em 0.25em;
    }
    li.bbp-header {
      margin-top: 0px !important;
      margin-bottom: 2px !important;
      border: solid 0px red !important;
    }
    /* START -- Main Effect on Forum width on small devices */
    ul.forum-titles li {
    text-transform: uppercase !important;
      font-size: 12px !important;
    }
    li.bbp-forum-info, li.bbp-topic-title {
        width: 40%;
    }
    li.bbp-forum-topic-count, li.bbp-topic-voice-count, li.bbp-forum-reply-count, li.bbp-topic-reply-count {
        width: 15%;
    }
    li.bbp-forum-freshness, li.bbp-topic-freshness {
        width: 30%;
    }
    /* END -- Main Effect on Forum width on small devices */
    
    #bbpress-forums ul[id*='forums-list-'] {
      padding: 0px !important;
      border: solid 0px red !important;
      margin-bottom: 2px;
    }
    #bbpress-forums ul[id*='forums-list-'] li.bbp-body ul[id*='bbp-forum-'] {
      	padding: 10px !important;
        border: solid 0px red !important;
      	margin-bottom: 2px;
    }
    #bbpress-forums ul[id*='bbp-forum-'] {
    border-radius: 0px;
        -webkit-border-radius: 0px;
        -moz-border-radius: 0px;
        -ms-border-radius: 0px;
        -khtml-border-radius: 0px;
        -o-border-radius: 0px;
      	padding: 0px !important;
        border: solid 0px red !important;
      	margin-bottom: 2px;
    }
    #bbpress-forums ul[id*='bbp-topic-'].post-inner {
      border-radius: 0px 0px 0px 0px !important;
        -webkit-border-radius: 0px 0px 0px 0px !important;
        -moz-border-radius: 0px 0px 0px 0px !important;
        -ms-border-radius: 0px 0px 0px 0px !important;
        -khtml-border-radius: 0px 0px 0px 0px !important;
        -o-border-radius: 0px 0px 0px 0px !important;
    
    }
    #bbpress-forums ul[id*='bbp-topic-'] {
    padding: 10px !important;
      margin-bottom: 2px;
      border: solid 0px red !important;
    }
    
    #bbpress-forums p.bbp-topic-meta img.avatar,
    p.bbp-topic-meta span.bbp-topic-freshness-author a img.avatar {
      display: none;
    }
    	 

    Kind Regards,

    #172018
    stewmills
    Participant

    Ok, here’s my dilemma. I have a corporate website and we are working on adding a forum. After working with bbPress for a couple of weeks I like what I see and have a good working shell, but as I get deeper I have some concerns with integrating a forum into my WordPress site versus completely stand-alone.

    My question is, on a single host is there a way to have bbPress installed and totally separate from the main website. For example, current forum requests get added to my users within WordPress. While they get credentials to only have forum access and not WordPress access, it still concerns me that this is leaving open back doors for smart hackers to sneak in to my WordPress administration. I had to install some bbPress code in my functions file to stop non-administrator profiles from seeing the WordPress main menu at the top of the forum. This just seems too loose, as if hiding it with code really stops someone that knows what they are looking for from finding it.

    With that, in having to add code such as this I subsequently shut down my entire site due to adding code the functions.php file that it didn’t like. Not a good situation for me. So, my second and really primary question is how I can have a forum administered in WordPress but totally separate from my main website. What I feel this gives me is 1) totally separate sites where my forum user profiles are not intermingled with my WordPress corporate site administrators and 2) a separate place where I can make site changes that I know only impact the forum and not the main site at all, so if I hose the forum temporarily it’s not as big of a crisis as if I shut down our entire web presence.

    Can this be done on the same host where I have a subdomain and a separate WordPresss login for the forum as if the main website didn’t exist, or am I better off just having these creates separately under truly separate hosts and just pointing a URL on the corporate site’s menu to the stand-along forum that’s on the separate host and managed as a totally independent website?

    I appreciate your suggestions.

    #172017
    awal16
    Participant

    I have a problem with custom capalities. I have this code in my functions.php in the child-theme:

    // Nieuwe forumrolnaam toevoegen
    function add_new_roles($bbp_roles){
    	$bbp_roles['bbp_global_moderator'] = array(
    		'name' => 'Globale moderator',
    		'capabilities' => custom_capabilities( 'bbp_global_moderator' )
    	);
    	return $bbp_roles;
    }
    
    // Nieuwe forumregels toevoegen
    add_filter('bbp_get_dynamic_roles', 'add_new_roles', 1);
    
    function add_role_caps_filter($caps, $role) {
    	// Only filter for roles we are interested in!
    	if ($role == 'bbp_global_moderator')
    		$caps = custom_capabilities($role);
    	
    	return $caps;
    }
    
    add_filter('bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2);
    
    function custom_capabilities($role) {
    	switch($role) {
    		// Capabilities for 'global_moderator' role
    		case 'bbp_global_moderator';
    			return array(
    				// Primary caps
    				'spectate'				=> true,
    				'participate'			=> true,
    				'view_trash'			=> true,
    				
    				// 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'		=> true,
    				'edit_topics'			=> true,
    				'edit_others_topics'	=> false,
    				'delete_topics'			=> true,
    				'delete_others_topics'	=> false,
    				'read_private_topics'	=> true,
    				
    				// Reply caps
    				'publish_replies'		=> true,
    				'edit_replies'			=> true,
    				'edit_others_replies'	=> false,
    				'delete_replies'		=> true,
    				'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;
    	}
    }

    When I set a user to the specific role, he/she can’t read the closed forum or topic. I get the 404 error: oops, can’t find that page. When I set the user to a standard role, like moderator, it’s fine. So, I copied the same rules capabilities (true/false part) of the moderator, to my functions.php in the child, but that doesn’t seem to help. What is going wrong?

    #172007
    Robin W
    Moderator

    on first issue – We need a link to your site to be able to see what is happening

    On second – this will let you display a badge dependant on no. posts – load it and if you like what it does I can give you a piece of code to make it work for user levels

    #171997
    selenii
    Participant

    I want to delete this function.

    https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#21-show-5-recent-topics-after-forum-index

    How can I make this?

    And how can I put into the Forumlist widget all forums with subforums?

    #171996
    Robin W
    Moderator
Viewing 25 results - 6,876 through 6,900 (of 32,519 total)
Skip to toolbar