Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,876 through 6,900 (of 32,505 total)
  • Author
    Search Results
  • #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
    #171995
    Pascal Casier
    Moderator

    The SQL I have is to wipe out ALL data from bbPress, so that’s not what you want.

    Workaround proposal:
    If you go on your dashboard > Replies > All Replies (so /wp-admin/edit.php?post_type=reply), and then select the forum in the dropdown box that says ‘in all forums’ and click filter.
    In the screen options, put the ‘number of items’ to e.g. 100.
    Delete some screens in this way…

    Does that work ?

    Then the same with the topics, empty the trash and try to delete the forum.

    Pascal.

    #171994
    Pascal Casier
    Moderator

    What exactly do you want to edit ?
    That shortcode will show you the index table. If you want to change something in it, have a look at https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/ if you find what you want to change.

    Pascal.

    #171981
    Pascal Casier
    Moderator

    After you installed bbPress, 3 new items should appear in your dashboard: Forums, Topics and Replies. That last one shows all the replies.
    The standard link is /wp-admin/edit.php?post_type=reply

    Pascal.

    #171980
    Pascal Casier
    Moderator

    For the forum list in your sidebar, check the widget: https://codex.bbpress.org/features/widgets/

    To edit the ‘index forum page’, create a standard WordPress page and change the slug to ‘forums’. This new page will then be used in stead of the standard list. You can then of course use the [bbp-forum-index] shortcode to display the list of forums.

    Pascal.

    #171979

    In reply to: smiles in the bbpress

    selenii
    Participant

    Yes it works, but how can I insert it on my text tool as a bbcode for the choice. I will that my users have one option to choice some smile from the list.

    #171977

    In reply to: smiles in the bbpress

    Pascal Casier
    Moderator

    As bbPress is using WordPress below, it supports the basic ones.
    When I type :-) or :-P, it automatically converts them to πŸ™‚ or πŸ˜›

    So if you have set that option, it comes automatically.

    Pascal.

    #171971

    In reply to: smiles in the bbpress

    Pascal Casier
    Moderator

    As said, the basic ones are already in WordPress (Dashboard: Settings > Writing > Formatting).

    If you want more, but no full plugin, check the code of the above plugins to see how they did it.

    Pascal.

    #171962

    In reply to: smiles in the bbpress

    Pascal Casier
    Moderator

    Hi,

    If you want custom smilies or stickers, then check for plugins like ‘wp-Monalisa’ or ‘Font Emoticons’, however bbPress can use WordPress’s supplied smilies, see https://codex.wordpress.org/Using_Smilies and https://codex.wordpress.org/Emoji
    πŸ˜› πŸ’€ πŸ‘» πŸ‘½ 😺 😸 😹 😻 😼 😽 πŸ™€ 😿 😾 πŸ™Œ πŸ‘ πŸ‘‹ πŸ‘ πŸ‘Š

    Pascal.

    #171961
    selenii
    Participant

    How can I use smiles in the bbpress. I will insert it in my reply form.

    For example with:

    <script type="text/javascript">
    function addsmile($smile){
    document.getElementById('comment').value=document.getElementById('comment').value+' '+$smile+' ';
    }
    </script>
    <?php
    global $wpsmiliestrans;
    $dm_showsmiles = '';
    $dm_smiled = array();
    foreach ($wpsmiliestrans as $tag => $dm_smile) {
     if (!in_array($dm_smile,$dm_smiled)) {
     $dm_smiled[] = $dm_smile;
     $tag = str_replace(' ', '', $tag);
     $dm_showsmiles .= '<img src="'.get_bloginfo('wpurl').'/wp-includes/images/smilies/'.$dm_smile.'" alt="'.$tag.'" onclick="addsmile(\''.$tag.'\');"/> ';
     }
    }
    echo '<div style="width:100%; margin-left:0px; margin-right:0px;">'.$dm_showsmiles.'</div>';
    ?>

    But it did not works. Have anybode idea why?

    #171958
    stewmills
    Participant

    I temporarily solved my problem by installing this widget, as I just got FTP access today and have not attempted to follow other options via creating a bbPress.php page, etc.

    Here’s the plugin: https://wordpress.org/plugins/bbpress-login-register-links-on-forum-topic-pages/

    You can edit it and configure 4 different places that it shows up, but it’s not in the plugin options, you have to “edit” the plugin and you’ll see the code that designates what shows up where, such as this:
    add_action(‘bbp_template_before_pagination_loop’,’bbpressLoginRegisterLinksOnForumPage’);

    #171926
    Robin W
    Moderator

    but yes as Pascal says, you do need to list the forums that you want to include

    and I have just updated the plugin for a technical error which should not affect you, but you may want to load the latest version from my site

    http://www.rewweb.co.uk/bbpress-additional-shortcodes/

    #171925
    Robin W
    Moderator

    ok, I think I know the problem.

    If you copied/pasted the shortcode from my website, it incorrectly formats the shortcode on your website.

    I’ve now corrected, so if you go back onto my website and copy/paste then it will now work.

    or just type the shortcode in !

    scorpnetwork
    Participant

    Hi!

    Late, but here is my promised Feedback.

    The Forum is just too big to get this going. I am paying a Coder not to get a custom Script for this.

    Cant wait to finally switch to BBpress…

    Thanks for the help tho!

    #171920
    Pascal Casier
    Moderator

    But… you wanted to limit to some forums, no ?

    So let’s say you only want to show 5 topics from forums 10, 11 and 12, then you would put:
    [bbp-display-topic-index show='5' forum='10,11,12']

    Pascal.

Viewing 25 results - 6,876 through 6,900 (of 32,505 total)
Skip to toolbar