Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 9,351 through 9,375 (of 32,505 total)
  • Author
    Search Results
  • #159091

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    Hi Robin,

    Thanks for replying and pointing out the issue for me. Woot! I see the two filters, in post 2. I’ll try to merge the two filters together, remove the second filter entirely and hopefully with the merge, it will work the way I’m intending. (This is literally the first time I’ve ever tried my hand at understanding PHP, so I’m totally new to this).

    The first bit of code (post 1) is simply just making new roles entirely.

    Post 2 is what I need to have. I want to change the name of the main three roles, and then add the others. Reason being, for starters, I think it will confuse my users to have those three the we won’t use, and I can’t seem to change my admit account from Keymaster to one I create.

    Thanks so much! ๐Ÿ™‚

    #159088

    In reply to: Add Custom User Roles

    Robin W
    Moderator

    there are two filters in the second example, and the second one wipes out the first !

    I tried your original code and it works fine, suggest you post it back and try it again, you may just have missed a character in the copy/paste.

    #159083
    Robkk
    Moderator

    @atlantis1525

    on the backend of wordpress you can see a menu item called toward the bottom-left called settings, from there , there is more settings for things like discussion , writing , and permalinks.

    here is what it looks like

    https://codex.wordpress.org/Settings_Permalinks_Screen

    #159082
    Robkk
    Moderator

    @jaydd

    was bbPress working fine for awhile then this error came out of nowhere??

    did this error come after you imported forums into bbPress??

    do you have a large number of topics/replies??

    have you followed these two guides for developing your child theme for bbPress??

    https://codex.bbpress.org/theme-compatibility/getting-started-in-modifying-the-main-bbpress-template/
    https://codex.bbpress.org/theme-compatibility/

    are your permalinks set to post-name??

    also could you paste an example url of the original topic url and the url you get when you have a 404 error.

    #159081
    Robkk
    Moderator

    i think you can bring information from another page using an iframe , which some lightbox scripts could use. Or you could just hide it with inline CSS then whenever the button/link with the class/id used for the lightbox is clicked it would display whatever you hid.

    you could use the shortcode like i said , because i think there is some modal popup form plugins that could just make life easier and you could input that shortcode and maybe place a template tag/use a shortcode in the template to show the popup for the reply form.

    you could use <?php bbp_get_template_part( โ€˜formโ€™, โ€˜replyโ€™ ); ?> in a template then configure your lightbox/popup code around that but you also need the PHP if statments so it doesnt show it to all users logged in or not.

    other then what i sorta told you its still custom development , and you would need to hire a custom developer.

    if you do have some ideas on what to use or code that you have been using but are quite not there you can try posting it and see if i can find some other information to help you or another developer from here can pick this up.

    #159079

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    Secondary Update:

    After making aforementioned changes, while I was able to change the name of the three major roles (Keymaster > Advisor, Moderator > Councilman, Participant > Apprentice), I’ve found that the newly added roles are no longer operational (nor showing).

    Screenshot: http://screencast.com/t/p28WJahSY4NU

    Can someone please take a look at my code and maybe provide some insight as to where I have gone wrong?

    Thanks in advance!

    Edit: I have tried modifying the newly added roles to the following:

    From:

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

    To:

    $bbp_roles['bbp_craftsman'] = array(
    'name' => 'Craftsman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_apprentice_role() ) // the same capabilities as participants
    );

    Which gave me immediate errors after re-uploading the function.php. If I leave it as is, I do not get any errors, they just simply don’t show.

    #159078

    In reply to: Add Custom User Roles

    Alice Kaye
    Participant

    Update – I managed to get it to work and managed to change the name of the defaults, to make things easier.

    This is the code in case anyone needs it for reference in the future:

    /* bbPress Custom Roles */
    function add_custom_role( $bbp_roles ) {
     
    $bbp_roles['bbp_craftsman'] = array(
    'name' => 'Craftsman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['bbp_journeyman'] = array(
    'name' => 'Journeyman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['bbp_adept'] = array(
    'name' => 'Adept',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['bbp_artisan'] = array(
    'name' => 'Artisan',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as moderator
    );
    return $bbp_roles;
    }
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
    /* bbPress Custom Roles */
    
    /* bbPress Custom Role Names */
    add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );
    
    function ntwb_bbpress_custom_role_names() {
    	return array(
    
    		// Keymaster - Advisor
    		bbp_get_keymaster_role() => array(
    			'name'         => 'Advisor',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
    		),
    
    		// Moderator - Moderator
    		bbp_get_moderator_role() => array(
    			'name'         => 'Councilman',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
    		),
    
    		// Participant - Apprentice
    		bbp_get_participant_role() => array(
    			'name'         => 'Apprentice',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
    		),
    	);
    }
    /* bbPress Custom Role Names */
    #159077
    eVersatile
    Participant

    Makes since, but since it needs to be auto generated it needs to be php script within the template. Isn’t working out so well so far.
    What about if the form was on a different page with the shortcode, is there a way to show only the forums that the current user created in the dropdown menu?

    #159076
    Alice Kaye
    Participant

    Hi everyone,

    I’m working on creating some custom user roles and I was wondering if I could get assistance with it, because the code I modified kind of killed my site (so I took it out and it’s working fine again).

    I’m running a guild website, so we have specific titles (in order from left to right for hierarchy):
    Advisor (Keymaster) > Councilman (Moderator) > Artisan (Moderator) > Adept (Participant) > Journeyman (Participant) > Craftsman (Participant) > Apprentice (Participant)

    I was trying to follow this guide: http://codex.bbpress.org/custom-capabilities/

    /* bbPress Custom Roles */
    function add_custom_role( $bbp_roles ) {
     
    $bbp_roles['my_custom_role1'] = array(
    'name' => 'Apprentice',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role2'] = array(
    'name' => 'Craftsman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role3'] = array(
    'name' => 'Journeyman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role4'] = array(
    'name' => 'Adept',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role5'] = array(
    'name' => 'Artisan',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster
    );
    $bbp_roles['my_custom_role6'] = array(
    'name' => 'Councilman',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster
    );
    $bbp_roles['my_custom_role7'] = array(
    'name' => 'Advisor',
    '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 );
    /* bbPress Custom Roles */

    Can someone tell me where I might have gone wrong?

    Thanks in advance! ๐Ÿ˜€

    #159074
    Robin W
    Moderator

    ok, try

    https://wordpress.org/plugins/widget-logic/

    use

    is_bbpress()where you want a widget displayed on bbpress pages and
    !is_bbpress() where you don’t

    #159039
    Robin W
    Moderator

    ok,

    1. not possible with bbpress as far as I know
    2. only admin/keymasters get this priviledge
    3. https://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/
    4. If I understand the question correctly, normal users – that is the default ie participants can create topics and replies, but not forums or categories. If you meant something different then come back

    #159017
    Spedwards
    Participant

    So I just installed bbPress (2.5.4) successfully after having buggy versions last week. Though I’m having a lot of issues this time. I’m using WordPress 4.1.1 and Twenty Fifteen as my theme.

    I created a new forum which I called, “forum” and a topic called, “general”. When I go to view the forum, it takes me to /forums/forum/forum which I believe should be /forums/forum but I can’t go there without it redirecting me. /forums just redirects me as well.

    Following the codex, I tried method two which involved using the shortcode. This works all fine until I clicked on the forum, which took me to /forums/forum/forum

    My site is:

    method 1
    method 2

    How can I fix this issue? Please don’t say disable plugins because I know for a fact, that isn’t the reason.

    #159016
    peter-hamilton
    Participant

    Or try playing around with his

    #bbpress-forums li.bbp-body ul.forum, #bbpress-forums li.bbp-body ul.topic {
    border-top: 1px solid #eee;
    overflow: hidden;
    padding: 8px;
    float: left;
    width: 20%;
    }

    This will give 5 rows, 10 would not fit any screen.
    his idea you have might sound good, but it will cause lots of issues on different viewports/mobile

    Robkk
    Moderator
    #159003
    Robkk
    Moderator

    when i said the reply form shortcode because i placed it into my sidebar and inputted a reply next to a topic and it worked fine.

    you might need to find a lightbox/popup plugin to enable popup on a class of a link and just place the link above the topic.

    when user hits link , popup opens shows reply shortcode then its added to the topic.

    but like i said this is some custom development.

    #158992

    In reply to: installation langauge

    Robkk
    Moderator

    i just tested it out and it seems to work fine.

    you can find the files to install for wp-content/languages/bbPress here

    http://danieljuhl.dk/wordpress/oversaettelse/

    more information specifically for your language

    https://codex.bbpress.org/bbpress-in-your-language/danish-dansk-da_dk/

    kiwi3685
    Participant

    Thanks. Nice to at least get a response, so your thoughts are appreciated.

    However, the ticket you refer to is closed. The file in latest bbPress download matches the final version (smf3.php) available there, so I’m sure it’s reasonable to assume the code is the latest available.

    But while waiting for some help I did some further digging in my smf database. I found one user with an invalidly formatted user_id. After removing that the import worked.

    Regarding “Remap existing users to default forum roles”, the import instructions recommend running ALL repair functions after importing, which I did at every import attempt.

    #158984
    Robkk
    Moderator

    you can see if any of the unread posts plugin add a body class to the replies to use.

    Feature Plugins Tracking

    other than that i suggest maybe https://wordpress.org/plugins/bbpress-new-topics/

    #158983
    Robkk
    Moderator

    @giuseppecuttone

    i dont know any plugin that can handle notifications very well , all i know is the default bbpress notifications and they seem to be having issues for users lately.

    as for changing the default email address see if this works

    use this for custom email address

    add_filter( 'wp_mail_from', function( $email ) {
    	return 'webmaster@mydomainname.com';
    });

    use this for custom from name

    add_filter( 'wp_mail_from_name', function( $name ) {
    	return 'WordPress Email System';
    });
    #158980
    Robkk
    Moderator

    @wpgerd

    you should of added the changes to a child theme.

    follow this so the next update you wont lose anything

    https://codex.bbpress.org/theme-compatibility/

    #158978
    Robkk
    Moderator

    make sure you are NOT just placing the new CSS at the bottom of the file , because the media queries will make it show for certain browser widths.

    place any custom CSS before this note in the bbpress.css file

    /*--------------------------------------------------------------
     Media Queries
    --------------------------------------------------------------*/
    
    /* =Standard Mobile Landscape
    -------------------------------------------------------------- */

    and any media querie specific size you want to have custom CSS please put custom CSS to the ones in the file.

    ^^i know it has to be that for sure.

    #158976
    wpgerd
    Participant

    Hello Robkk,

    thanks for your great help. I add this code in my style.css of the child-theme and everythings looks nice now. Thanks.

    What is your recommondation? I made in bbpress.css, but I think if there is an update of bbpress-Plugin, this possible will be deleted. So it’s better to add this changes in the style.css of the child-theme?

    Gerd

    Robkk
    Moderator

    @kiwi3685

    what importer did you use , the one listed in tools>forums Import??

    because i see the bbPress one doesnt have much information in the codex and it is still in beta testing.

    this could work or not , im only guessing to try to help

    what you could try is go to tools>forums Repair forums and check

    Remap existing users to default forum roles

    and see if that fixes it.

    there is also a ticket on the importer for SMF

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

    #158971
    Robkk
    Moderator

    well thanks for finding the code , im sure this will help alot of users who run into the same issue.

    #158970
    Robkk
    Moderator

    this will help put less of a margin after the captcha, if it doesnt work add !important at the end of the 0

    .cptch_block {
    direction: ltr;
    margin-bottom: 0;
    }

    this is for space above the register link

    a.bbp-register-link {
    margin-top:15px;
    }

    and im not sure how this is going to do with the checkbox but try it.

    .bbp-login-form label[for=rememberme] {
    width: auto;
    display: inline-block;
    }
Viewing 25 results - 9,351 through 9,375 (of 32,505 total)
Skip to toolbar