Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 7,701 through 7,725 (of 32,519 total)
  • Author
    Search Results
  • #167424
    Robkk
    Moderator

    Sorry you had to start over, but glad you got bbPress working fine on your site.

    Make sure to take regular backups, so that you do not have to just redo everything and just restore to a previously saved backup.

    https://codex.wordpress.org/WordPress_Backups

    Backing up your Database and Files

    #167422
    mica123
    Participant

    Thank you very much. I did set up the bbpres.php template on the basis of page.php – the same way as I did in my test site. However, this does not work for the user profile at all on the live site for some strange reason. Just now I found a workaround by using CSS – not sure if this is the correct way. But I would really like to know what the bbpress.php works for all pages except the user page. The CSS I used is:

    body.bbp-user-page.single.singular.bbpress div#content.grid.col-620 {
    		width: 100%;
    	}
    
    	body.bbp-user-page.single.singular.bbpress div#widgets.grid.col-300.fit {
         		display: none;
    	}
    

    Please let me have your thoughts.

    #167419
    Robkk
    Moderator

    This might be related to your theme and bbPress theme compatibility. I think what you are experiencing is similar to what other theme frameworks could experience with bbPress.

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

    There might be a workaround for this though by using the template you are already using and creating a bbpress.php template from that so that all your bbPress pages you that template.

    Use what the file to find out what template is being used from your theme for the other bbPress pages, then copy that template and rename it bbpress.php.

    Getting Started in Modifying the Main bbPress Template

    #167416
    Robkk
    Moderator

    The forum search should show up on the forum archive page that is usually yoursite.com/forums by default and I do see it there on your site.

    The input box for the math captcha could just be a CSS issue. Unless you have anonymous posting activated in bbPress, you may need to send me account details for a Subscriber/Participant test user account as I may need to be logged in to your site to be able to even see the captcha.

    Also not sure why you are using bbPress with some other forum software plugin, you could possibly get issues by having them both activated together. If you are just importing from one to the other your simplepress data should stay in your database and you just import all of that.

    You should try some troubleshooting to see if some of the issues could be theme related. Make sure to check in a theme like Twenty Twelve, and also check to see if Simplepress could be causing an issue if you have it activated with bbPress.

    Troubleshooting

    #167414
    Loc Pham
    Participant

    I’m using bbPress’s “favorite” feature as “like” feature in other social networks in my application. Is there a function which would allow me to count the number of users whom “favorited” a topic? I’m also interested in counting the number of subscribed users for a particular topic as well. I’ve looked into /bbpress/includes/topics/templates.php but did not find any and wondering if you’re aware of any.

    Thanks.

    #167402
    oliver_rub
    Participant

    Hey guys,
    i have the problem that moderators in my forum can assign/modify tags at all. According to the bbPress role they should be able to do so. The template checks whether tags are allowed (which is true, since normal users (=participants) and admins can successfully post tags). I tried to fix it with the following code:

    function rub_fix_moderator_tags_capability($allcaps, $caps, $args){
    
    	if($args[0] !== 'assign_topic_tags'){
    		return $allcaps;
    	}
    
    	if(bbp_group_is_mod()){
    		$allcaps['manage_topic_tags'] = 1;
    		$allcaps['edit_topic_tags'] = 1;
    		$allcaps['delete_topic_tags'] = 1;
    		$allcaps['assign_topic_tags'] = 1;
    	}
    
    	return $allcaps;
    }
    add_filter('user_has_cap', 'rub_fix_moderator_tags_capability', 10, 3);

    Not sure whether this approach is correct, since it doesnt solve my problem 😉 Also when i try something like echo current_user_can('assign_topic_tags'); in there as a check, the page doenst load anymore.
    But also I´m a little bit clueless in terms of where to look for a solution. I created a somewhat clean install (just copied over the files, but new db) using the twentyfifteen theme, and there moderators are also not able to post tags. In terms of plugins I only have BuddyPress and bbPress enabled.
    Has someone an idea where to start looking or how to approach this?

    #167399
    Loc Pham
    Participant

    My post stripped the bracket in my endpoints, it should be the following instead:

    http://localhost:8888/wp-json/wp/v2/topic?filter[forum_type]=sports
    http://localhost:8888/wp-json/wp/v2/topic?filter[forum]=sports
    #167396
    Carp Talk
    Participant

    For anyone looking for a better and easier way to do this, i just added this to header.php after the

    							<?php if ( is_user_logged_in() ) { ?>
                
    <li><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>" >My Account</a>
                    <ul class='sub-menu'>
    <li><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>replies" >My replies</a></li>
    <li><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>topics" >My topics</a></li>
    <li><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>favorites" >My favorites</a></li>
    <li><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>subscriptions" >My subscriptions</a></li>
    <li><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>edit" >Edit profile</a></li>
                    </ul>
                </li>

    It works a treat and i even guessed the edit lol

    #167395
    Carp Talk
    Participant

    Hi guys i have used the code above and it works perfect, one problem i have though is it appears in every menu (3 of them) as shown in the screen shot how do i get it to show only in the top right ?

    Here is the screenshot

    Here is the code i used

    // Filter wp_nav_menu() to profile link
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link' );
    function my_nav_menu_profile_link($menu) {
        if (!is_user_logged_in() && $args->menu->slug == 'right-top-nav')
            return $menu;
        else
            $current_user = wp_get_current_user();
            $user = $current_user->user_login ;
            $class = 'sub-menu';
            $profilelink = '
                <li><a href="/forums/users/' . $user . '/">My Account</a>
                    <ul class=' . $class . '>
                        </li><li><a href="/forums/users/' . $user . '/replies">My Replies</a></li>
                        <li><a href="/forums/users/' . $user . '/topics">My Topics</a></li>
                        <li><a href="/forums/users/' . $user . '/subscriptions">My Subscriptions</a></li>
                        <li><a href="/forums/users/' . $user . '/edit">Edit My Profile</a></li>
                    
                
            ';
            $menu = $menu . $profilelink;
            return $menu;
     
    }<code></code>
    #167394
    Carp Talk
    Participant

    Hi guys i have used the above code but the profile link appears in every menu. How do i add it to just the top menu ?

    #167380
    mica123
    Participant

    @robkk
    Thank you so much. I finally got the wp-login forms working. I even managed to style them by enqueuing the login style sheet. Here I have a question – I used the following:

    function my_login_stylesheet() {
        wp_enqueue_style( 'custom-login', get_template_directory_uri() . '/style-login.css' );
        wp_enqueue_script( 'custom-login', get_template_directory_uri() . '/style-login.js' );
    }
    add_action( 'login_enqueue_scripts', 'my_login_stylesheet' );

    This is fine, but the style sheet is loaded in my theme directory (responsive). I tried to load it into my child theme (responsive-child-theme) but it doesn’t work. Is the maian theme directory the correct location? What happens if the theme is updated?

    All this is new to me as I never set up a forum before, just websites. I am concerned about security. I am going to install Akismet. Should I also do something about honeypot registration? If so, what would you recommend? Would you also recommend reCaptcha? If so, what would be the best way to implement it?
    Many thanks.

    #167363
    Robkk
    Moderator

    In the code I posted the menu links should lead to the default WordPress forms.

    Login, Register, Lost Password links

    Other plugins can add frontend forms like Theme My Login, woocommerce, some other membership plugins.

    I am basically saying the bbPress forms are incomplete in functionality, it might be better to use something else like the default WordPress forms.

    #167357
    mica123
    Participant

    Yes, I am using the bbpress forms. Where would I find the default WordPress forms? Also, by other frontend forms – I am not sure what you mean? It is just difficult for me to understand that by not using the bbpress forms, redirects will show error messages without any code?

    #167356
    Robkk
    Moderator

    Are you trying to use the bbPress shortcodes in pages for logging in and registering??

    These forms are really incomplete in functionality, they don’t redirect back to the login form and show error messages above that form, it just redirects to the default WordPress form to show the error messages. I think using the default WordPress forms or other frontend forms are better for now.

    #167347
    mica123
    Participant

    @robkk I have now tried your code and it works beautifully. The links show up in the sub-header-menu. The login and logout redirect works too. As I am trying this out on my local computer I don’t know if the reset and lost password redirect would work as well?

    There is another problem: if I click on login or reset or lost password button without giving a user name and password, it goes to the standard WordPress login page which is not good at all. Can this be remedied? We are almost there.
    Many, many thanks.

    #167328
    GreatOldiesDJ
    Participant

    Hi and thanks for that update. I saw that little icon but I didn’t realize what it was. Your code change took care of it.

    #167325
    Robkk
    Moderator

    I think you just copied form-user-register.php into your theme and added that text, not entirely sure though.

    #167318
    Robkk
    Moderator

    Use background: none; in the submit buttons CSS. The little icon image is showing.

    I edited the other reply I posted code, so you can just copy over the code over again.

    #167316
    tkse
    Participant

    Wow, I’m sorry. I didn’t realize I had forgotten this line.

    I noticed the second line I had in my code was to disable the HTML editor, not teeny. However, is it possible to display the HTML editor only for moderators and above?

    #167314
    GreatOldiesDJ
    Participant

    Hi again. This code worked perfectly. Thanks you very much for your help!

    #167313
    Robkk
    Moderator

    Here try some of this custom CSS, put it in your child theme or in a custom css plugin.

    This is for the submit button

    #bbpress-forums #bbp-search-form input[type=submit], 
    #bbpress-forums #bbp-search-form input[type=submit] {
        text-indent: 0;
        background: none;
        background-color: #3F51B5;
        color: #fff;
        width: auto;
        height: auto;
        border-radius: 0;
        margin-top: 0;
    }

    This is for the search input.

    #bbpress-forums #bbp-search-form input[type=text], 
    #bbpress-forums #bbp-search-form input[type=text] {
        border: 1px solid #3F51B5;
    }
    #167312
    Robkk
    Moderator

    You did add this argument right?? Having this at false shows the full editor. Some button may be not usuable for the forums though, so you need to move them around in the TinyMCE advanced plugin settings.

    $args['teeny'] = false;

    #167309
    BewitchingFiction
    Participant

    As a minor update, even the word cocktails appears to be blacklisted though I have no idea WHERE this blacklist is – is it possible to just remove that ‘check blacklist’ code from BBPress because it’s ridiculous – I don’t want it to check something that I have no control over just because, especially when I don’t even know where this list is.

    #167306
    project_subdomain
    Participant

    thanks @robkk. makes sense, think it’s not in the codex.
    I’ve got a navigation menu with links to specific topics (made with the backend’s customizer). Would like to add the correct count to each navigation menu link.

    Suppose that it would be easier to create a new custom navigation menu via functions as it’s not that easy to target the specific locations, right?

    But in case you have an idea how to target those customizer created links to add a count, this surely would help for many other things as well.

    #167290
    Robkk
    Moderator

    Here is the code for that exact error notice. bbp_check_for_blacklist is checking the comment blacklist in Settings > Discussion. Since you said that you do not have anything in the blacklist do you have another plugin with a blacklist that could be hooking into the default comment blacklist??

    /** Reply Blacklist *******************************************************/
    	if ( ! bbp_check_for_blacklist( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) {
    		bbp_add_error( 'bbp_reply_blacklist', __( '<strong>ERROR</strong>: Your reply cannot be created at this time.', 'bbpress' ) );
    	}
Viewing 25 results - 7,701 through 7,725 (of 32,519 total)
Skip to toolbar