Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1,001 through 1,025 (of 32,431 total)
  • Author
    Search Results
  • #230716
    ewd910
    Participant

    Wow that code is a lot more involved than I thought it would be. I’ll probably end up just using your plugin. Thanks as always! Do I need to send as text/html if I just want the correct line spacing or is there a way to fix that for plain text emails? Right now by default all the carriage returns get stripped by default, that’s really all I’m trying to fix. If I need to send HTML that’s fine but I have a hard time believing the default bbpress notifications should look like this

    #230712
    ewd910
    Participant

    Hi, I’m having an issue where my forum notifications are not being formatted correctly. None of the spacing that exists in the default notification message exists in the resulting email, and I have confirmed that the message is being sent using the ‘text/html’ content type header. I added a <br> tag to the notification email as a test as well, but it was sent in plain text and not rendered as a line break. Anything I should try?

    #230686
    Robin W
    Moderator

    only show if user is logged out

    function bbp_goto_login_page() {
    if (!is_user_logged_in ()) {
    echo '<p><a href="/login"><div class="gotologin">You must be logged in</div></a></p>' ;
    }
    }

    But you should be seeing the login automatically – what theme and other plugins are you using?

    #230685
    jokke72
    Participant

    Hi, for some reason the login does not work on bbpress topic page.

    I have this code in my functions.php file.

    add_action ('bbp_theme_after_reply_form_content' , 'bbp_goto_login_page' ) ;
    
    function bbp_goto_login_page() {
    echo '<p><a href="/login"><div class="gotologin">You must be logged in</div></a></p>' ;
    }

    This is working, but not the way I want. I would like it to only show if user is logged out and it should be visible on the topic page where there is normally the login form.

    Is there something like bbp_theme_after_topic_content?
    Tried googling, but could not find anything similar.

    #230609
    Robin W
    Moderator

    for the furst two, add this to your theme custom css

    .forum h1.page-title, .forum div.page-description p {
      display : none ;
    }

    for the last, install this additional plugin

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Breadcrumbs

    #230590
    Robin W
    Moderator

    ok, I’ve found the problem, and this filter fixes

    add_filter ('bbp_after_has_search_results_parse_args', 'rew_search') ;
    
    function rew_search ($args) {
    	/*mods and above get permissions to see all from line 50 of \bbpress\includes\search/template.php which sets a list of $default['post_status']
    	//participants/spectators get $default['perm'] = 'readable' set instead of $default['post_status'].  
    	'perm' is a wordpress wp_query setting, and wordpress does not have 'hidden' status, so allows hidden forums to show
    	//so if $default['perm'] is set, we add a 'post_status' as well to restrict to statuses user is allowed
    	*/
    	if (!empty($args['perm'])) {
    		$post_statuses = array(bbp_get_public_status_id()) ;
    		// Add support for private status
    		if ( current_user_can( 'read_private_topics' ) || current_user_can( 'read_private_forums' ) ) 
    			$post_statuses[] = bbp_get_private_status_id();
    		}
    		// Add support for hidden status
    		if ( current_user_can( 'read_hidden_forums' )) {
    			$post_statuses[] = bbp_get_hidden_status_id();
    		}
    		// Join post statuses together
    		$args['post_status'] = $post_statuses;
    	}
    return $args ;
    }

    if you are using

    bbp style pack


    then this is included in version 5.0.8 just released

    Otherwise put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    I’ll update the bbpress trac ticket shortly

    #230577
    kwk
    Participant

    It’s a pleasure to have people like you,@robin-w, around to get things fixed and get the job done. I’m still playing with the above CSS code and it is producing positive results. Thanks a bunch.

    #230570
    Robin W
    Moderator

    A lot of mobile changes depend on the theme being used.

    These are the css changes that this site uses for smaller devices

    /* Do not fix #header for non-desktops */
    @media screen and ( max-width: 782px ) {
    	#header {
    		top: 0;
    		z-index: 99999;
    		position: absolute;
    	}
    	#wpadminbar {
    		z-index: 88888;
    		height: 56px !important;
    		position: absolute;
    	}
    	#wp-toolbar {
    		width: 100%;
    	}
    	#main {
    		margin: 100px 10px 40px 10px;
    	}
    	body:not(.trac):not(.home-page) #main {
    		margin-top: 140px;
    	}
    	#footer {
    		padding: 10px;
    		margin: 10px;
    	}
    	#footer div.links,
    	#footer div.details {
    		float: none;
    		margin: 10px 0;
    	}
    	#bb-menu-icon,
    	#mobile-menu-button {
    		display: block;
    		position: absolute;
    		right: 0;
    		padding: 33px 20px 33px 33px;
    		text-decoration: none;
    	}
    	#header #nav,
    	#wporg-header #wporg-header-menu {
    		margin: 0;
    		float: right;
    		overflow: visible;
    	}
    	#header #bb-nav,
    	#wporg-header #wporg-header-menu {
    		position: absolute;
    		width: 100%;
    		right: 0;
    		top: 81px;
    		border-bottom: 1px solid #aaa;
    	}
    	#header #bb-nav li,
    	#wporg-header #wporg-header-menu li {
    		width: 100%;
    		text-align: center;
    		margin: 0;
    		padding: 0;
    	}
    	#header #nav #bb-nav li a,
    	#wporg-header #wporg-header-menu li :link,
    	#wporg-header #wporg-header-menu li :visited {
    		display: block;
    		margin: 0;
    		padding: 20px;
    		color: #000;
    		text-shadow: none;
    		border-radius: 0;
    	}
    	#header #nav #bb-nav li.current a,
    	#header #nav #bb-nav li a:hover {
    		color: #fff;
    	}
    	#header #bb-nav,
    	#bbpress-forums .bbp-pagination-count,
    	.bbp-topic-meta,
    	#wporg-header #wporg-header-menu {
    		display: none;
    	}
    	#header #nav:hover #bb-nav,
    	#header #nav:focus #bb-nav,
    	#wporg-header #wporg-header-menu.toggled {
    		background-color: #eee;
    		display: block !important;
    	}
    	#wporg-header #wporg-header-menu.toggled {
    		background: #eee;
    	}
    	#header #nav:hover #bb-menu-icon:before,
    	#header #nav:focus #bb-menu-icon:before,
    	#wporg-header #mobile-menu-button[aria-expanded="true"]:before {
    		color: #fff;
    	}
    	#wp-admin-bar-my-account img.avatar {
    		height: 38px !important;
    		width: 38px !important;
    	}
    }
    
    /* Mobile */
    @media only screen and (max-width: 480px) {
    	#bbpress-forums div.bbp-topic-author img.avatar,
    	#bbpress-forums div.bbp-reply-author img.avatar {
    		width: 72px;
    		height: 72px;
    		margin: -5px 0 0 -5px;
    		transform: rotate(-5deg);
    	}
    
    	#bbpress-forums .bbp-author-role {
    		border: none;
    		background: transparent;
    		padding: 0;
    		margin: 0;
    	}
    
    	#bbpress-forums p.bbp-topic-post-date,
    	#bbpress-forums p.bbp-reply-post-date {
    		position: absolute;
    		right: -13px;
    		top: -17px;
    		font-size: 10px;
    		margin: 0;
    	}
    
    	#bbpress-forums div.bbp-topic-author .bbp-author-avatar + br,
    	#bbpress-forums div.bbp-reply-author .bbp-author-avatar + br,
    	#bbpress-forums div.bbp-topic-ip,
    	#bbpress-forums div.bbp-reply-ip {
    		display: none;
    	}
    
    	#bbpress-forums li.bbp-body div.type-topic span.bbp-admin-links,
    	#bbpress-forums li.bbp-body div.type-reply span.bbp-admin-links {
    		display: block !important;
    		border-top: 1px dotted #ddd;
    		margin: 10px 10px 0 10px;
    		padding: 5px 0;
    		position: relative !important;
    		top: 0;
    		left: 0;
    	}
    }

    You can play with them to get your site looking nicer

    either add them to the custom css part of your theme, or use

    Code Snippets

    #230443
    rinh
    Participant

    Hi
    First, thanks for all the help so far with functions and filters! The forum is done, but there is one feature I missed from the old forum and that’s having the editor autoresize with the content. I think this may be out of scope for this plugin, but perhaps someone knows something.

    I looked around and it seems WordPress TinyMCE have this feature, but it’s not enabled. I did some terrible attempt (you’re allowed to laugh) to add it. Not only did it break my toolbar 1, but it didn’t work either

    function bbp_enable_visual_editor( $args = array() ) {
    	
        $args['quicktags'] = false;
        $args['teeny'] = false;
        $args['tinymce'] = array( 
        'tinymce' => array(
                'toolbar1' => 'formatselect, bold, italic, underline, strikethrough, blockquote, link, forecolor, bullist, numlist, alignleft, aligncenter, alignright, outdent, indent, undo, redo',
    	    'autoresize_min_height' => 100,
                'wp_autoresize_on'      => true,
                'plugins'               => 'wpautoresize',
            ), 
        );
    	
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
    #230433
    Robin W
    Moderator

    no it’s my bad coding !!

    I hadn’t spotted that you were using a child theme.

    I add some code to pick up on this, and be back in the next day

    gtatar
    Participant

    Robin, your code change worked for new topics. Did you say we would need an additional code change for replies?

    rinh
    Participant

    Oh! I did not see that the code changed when I pasted it in here and the ‘;’ even disappeared. I kept retrying with the one in the documentation.

    Thanks again Robin, you’re awesome 🙂

    Robin W
    Moderator

    ok, so just looked the documentation says

    ‘& lt;’

    when it should say

    ‘<‘
    etc.
    This is just internet stuff between stating and interpreting.

    so if you copy the code in your first post, then this is the correct code to have.

    I’ll look to correct the documentation

    rinh
    Participant

    Thank you for trying.

    That’s odd.

    I’ve tried it again, and also in my functions.php instead of Code Snippets. It doesn’t say there’s any errors until I try to save it.
    I tried another theme as well and also to remove all other custom snippets I got, but the same result.

    Robin W
    Moderator

    just loaded that code to my test site, and it runs fine.

    suggest you delete and try it again

    rinh
    Participant

    Hi!
    I tried a snippet from this page: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#24-show-status-labels-for-bbpress-topics
    to get a label or icon for sticky topics.

    function rk_sticky_topics() {
     
       if ( bbp_is_topic_sticky() && !bbp_is_topic_closed() )
          echo '<span class="sticky">[Sticky]</span>';
    }
     
    add_action( 'bbp_theme_before_topic_title', 'rk_sticky_topics' );

    I get a fatal error with syntax error unexpected ‘;’ on the line starting with if.

    Thank you in advance

    #230409
    cathyskach
    Participant

    I tested this on our staging site. Switching out for the Twenty Twenty theme, the dates populated, so I presume the problem to be the theme. What advice do you have for a fix?

    PS: I tried taking out the short code on the member-only (parent) page to allow you access to the forum but it seems to still want a password.

    Cathy

    #230408
    coopersita
    Participant

    I haven’t made much progress. I tried adding a rewrite rule and changing from ‘users’ from ‘members’ to avoid rules clashing:

    function bbp_custom_author_rewrite(){
        add_rewrite_rule(
            "^forums/members/([^/]*)$",
            'index.php?bbp_user=$matches[1]',
            "top"
        );
    }
    add_action( 'init', 'bbp_custom_author_rewrite', 10);

    But I think I’m missing the part where the template uses the query var to load the correct content because I keep getting 404 errors.

    #230405
    chenryahts
    Participant

    BBpress keeps loading the empty index.php in the TwentyTwentyTwo Child theme I’m working on, which loads a WSOD.

    I can’t get any of the template filters to use one of the html files, so temporarily have it working with the index.php file as:

    wp_head();
    block_header_area();
    block_template_part( 'page-inner' );
    wp_footer();
    block_footer_area();

    And… its almost all working? But, this can’t be the right way to get it to use the new default page template in the block theme.

    Thoughts? Ideas? How can I get it to use the new theme templates?

    Thanks!

    #230370
    Robin W
    Moderator

    ok, so to restrict :

    dashboard>forums>all forums>edit the forum you want>right hand side you will find a box called ‘Forum Moderators’ add his name

    Then make him a participant.

    see thsi for role fresponsibilities

    bbPress User Roles and Capabilities

    I’m not sure that this wil let him create forums – but I suppose I would ask if he is that dangerous, maybe that’s something he should be asking you to do 🙂

    gtatar
    Participant

    Robin, I applied your code change. Will report results once I have them.

    #230348
    Robin W
    Moderator

    just taken a look, that theme is a ‘block theme’ the new way that themes are written.

    If you want to use it. come back and I’ll give you some code to try

    #230340
    Robin W
    Moderator

    ok, so page is now ok, but suspect from

    https://middleagedwitch.com/Forums/forum/general-discussion/

    that you have a capital F somewhere

    so either your permalink is ‘Forums’ or in

    dashboard>settings>forums>root forum slug you have ‘Forums’

    it needs to be lower case ‘forums’

    #230339
    Robin W
    Moderator

    ok, so I’m guessing you have a page called ‘Forum’ in which you have put the shortcode

    [bbp-forum-index]

    If so change the permalink on this page from ‘forum’ to ‘forums’ and it should all work

    ppoirier1995
    Participant

    Hi there,

    I’m trying to find a solution to the problem of participants being able to remove single topic tags by simply removing them from the “Tags” input field on the reply-to form.

    I’ve found this thread that clearly explains the issue

    Topic tags deleted by other participants


    and offers a solution that is unfortunately not working on my end.

    My form-reply.php currently has this line:
    <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() )) : ?>
    which I tried to replace with:
    <?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) && current_user_can('moderate') ) : ?>
    to no avail.

    Has anyone solved this issue? Would love some guidance here! 🙂

Viewing 25 results - 1,001 through 1,025 (of 32,431 total)
Skip to toolbar