Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 8,701 through 8,725 (of 32,505 total)
  • Author
    Search Results
  • #162446

    In reply to: Searching by user

    Robkk
    Moderator

    @van24

    yeah i tested it and it seems to work good.

    and yes the PHP code snippets you can add to a child themes functions.php file.

    Robkk
    Moderator

    WAIT: I think I found it here:
    http://www.theworshipcommunity.com/members/admin/forums/subscriptions/

    There you go!

    Also, if you’re good w/ design/style, etc — can you tell me why my right sidebar gets pushed down to the bottom of the page on certain forum pages?

    i tired it last night but i couldn’t find what was causing the problem easily through CSS, i would have to dig in your code more.

    #162436
    Robkk
    Moderator
    #bbpress-forums .bbp-body .reply {
      background: #f5f5f5;
    }
    #162434
    Robkk
    Moderator

    @juggledad

    @robkk: Just to clarify something, the OR function_exists(‘is_bbpress’) was added (with some other code, to get around a bug that bbpress doesn’t seem to want to acknowledge or fix. see https://bbpress.trac.wordpress.org/ticket/2723

    Thanks for pointing that out, i did not know about that bug.

    Okay with this bug in bbPress you cannot use the WP conditional is_single() to affect all of the bbPress pages, since for some reason there is a bug for single user pages.Thanks for creating the trac ticket, I tested out and see that yes it does not work on user pages. Over the next few days/week i will check it out and see I can come up with a fix.

    But this bug is easily avoidable by creating a bbpress.php for your theme and just using the_content() instead of bfa_post_bodycopy() and removing OR function_exists('is_bbpress') from the bfa_post_bodycopy() function. The bbpress.php file also helps remove other post meta that might not be useful for bbPress forums instead of using CSS to hide them.

    The OR function_exists('is_bbpress') you can keep in bfa_get_options.php though as i do not see any problems with that.

    If there is something you can find on your end to fix the issue with your theme and bbPress then please drop an answer on this topic, because i haven’t looked and learned your theme 100% yet. Removing the function exists and creating a bbpress.php is the quickest solution to the problem that I could find.


    @kitfreeman

    This excerpt issue that you are seeing affects all of these areas

    category pages
    tag pages
    author pages
    archive pages
    search result pages
    and the home page

    which is where all the excerpt theme settings modify.

    Robkk
    Moderator

    @fmckinnon

    you do not have to be subscribed to the topic for it to be unread and show if i remember correctly, and its just the area the plugin developer put it.

    that plugin should display a list of topics that are unread in the subscriptions area.

    it should kind of similar to these screenshots here, it looks really different because the developer was using a custom theme.

    https://wordpress.org/plugins/bbpress-mark-as-read/screenshots/

    if there is a way to use custom user meta in wp-query then i could just give you a snippet to add a custom view for bbPress that would list all the unread topics in one place , and you just place a shortcode in a page and all.

    viewing unead forums is not part of both of these two plugins i think but you could mark a forum read in both to clear any unread topics in it.

    unread replies go to first unread post shows which topics that are unread replies using that little [>] icon.

    #162430

    In reply to: Replies cutting off

    Robkk
    Moderator

    bbPress is inheriting .hentry and .reply styles from your theme.

    you can add this custom css to fix it.

    #bbpress-forums .reply {
      margin-left: 0;
      text-align: inherit;
    }
    
    #bbpress-forums .hentry {
      margin: 0;
    }
    #162422
    kylestubbins
    Participant

    I am a little confused on how and when updates are included in the released versions.

    Specifically, I am working on converting / importing a forum, but have run into errors, such as the sync table not being created. I do a Google search and find this –> https://bbpress.trac.wordpress.org/ticket/2650 which states that the problem has been corrected. Great!

    The problem is, the code shown here –> https://bbpress.trac.wordpress.org/changeset/5525 is not included with bbPress version 2.5.7, which is the latest release as of this writing. Lines 1023 through 1038 do not exist (just as an example as they are only comments… I picked this as it was easy to spot and just for reference).

    In fact, there are a bunch of things that are said to be fixed in the Trac (Thanks, Stephen), but they do not appear to be included with the official release of bbPress.

    Am I missing something?

    (Just a comment, but it would be nice to have version info in the headers of files as I cannot tell which version of converter.php is included with 2.5.7 without doing a diff on them and figuring it out from GIT.)

    #162419
    Shaktimaan
    Participant

    You must edit the file activity.php that is located at /wp-content/plugins/bbpress/includes/extend/buddypress/activity.php

    find // Get the activity stream item, bail if it doesn't exist

    and apply the patch manually that i have given in post # https://bbpress.org/forums/topic/bbpress-post-edit-causes-multiple-activity-entries/#post-160330

    #162417
    Robin W
    Moderator

    No, do you have any idea why i can’t see topics below Forum names?

    What you are seeing is the list of forums, you then click a forum to see the topics for that forum.

    if you want each forum to have then topics below it, then use shortcodes within a page

    [bbp-single-forum id=$forum_id]
    [bbp-single-forum id=$forum_id]
    [bbp-single-forum id=$forum_id]

    see

    https://codex.bbpress.org/shortcodes/

    or use the shortcodes from

    https://wordpress.org/plugins/bbp-style-pack/ in a page

    Also i was wondering how i can order Forums by some hierarchy?

    If not using the shortcodes above, then use dashboard>forums>all forums and edit a forum. On the right hand side you’ll see ‘parent’ and ‘order’ boxes that let you build a hierarchy

    #162411
    Chad R. Schulz
    Participant

    I know this is an old post. However, I’ve been screwing around with various javascript suggestions from other forums and came up with a solution that works (no problems yet discovered). I’m not exactly a code ninja, so if anyone can help to streamline the code let me know.

    Just insert the following lines into a custom javascript for your theme (if you need guidance on this there’s a lot of help available all over wordpress.org and other forums).

    jQuery(function($) {
    	var forum_input = $( '#bbpress-forums textarea' );
    	var forum_button = $( '#bbpress-forums .submit' );
    	var forum_limit = 50;
    	var forum_class = $( '<div class="forum_limit_info"><span>' + forum_limit + 
    	    '</span> characters needed</div>' ).insertAfter( forum_input );
    	forum_button.hide();
    	forum_class.show();
    	
    	forum_input.bind( 'keyup', function() {
    		var forum_length = $(this).val().length;
    		var chars_left = forum_limit - forum_length;
    
    		$( '.forum_limit_info span' ).html( chars_left );
    
    		if (forum_input)
    			( chars_left > 0 ) ? forum_class.show() : forum_class.hide();
    		
    		if (forum_button)
    			( chars_left > 0 ) ? forum_button.hide() : forum_button.show();
    	});
    });

    Basically this function hides the submit button and displays a countdown text counter until the minimum length is reached and then the button appears and the counter disappears.

    There are ways of hard-coding a minimum into php but I believe you have to edit core files and then insert these modified php files into a child theme. I couldn’t figured out how to insert a simple php function that would do what I wanted in a clean and simple way. So javascript it is.

    The forum_limit setting can be anything you want it to be, just change it. And you can customize your topics and replies minimums separately, if needed, with separate javascript functions using textarea#bbp_reply_content, textarea#bbp_topic_content instead of #bbpress-forums textarea.

    For my CSS stylings I chose to put a :before message on the left and the character count on the right using these:

    .forum_limit_info {
      text-align: right;
      font-size: 13px;
      color: red;
      line-height: 1.2;
      margin: 5px 5px 0px;
    }
    
    .forum_limit_info:before {
      float: left;
      content: '(Minimum Length: 50)';
      color: blue;
    }

    CSS Styling is theme dependent and can basically be however you want/need it to be–very flexible.

    I also created a similar javascript function for my site’s commenting system. Here’s that code as well:

    jQuery(function($) {
    	var comment_input = $( '#commentform textarea' );
    	var comment_button = $( '#entry-comment-submit' );
    	var comment_limit = 25;
    	var comment_class = $( '<div class="comment_limit_info"><span>' + comment_limit + 
    	    '</span> characters needed</div>' ).insertAfter( comment_input );
    	comment_button.hide();
    	comment_class.show();
    	
    	comment_input.bind( 'keyup', function() {
    		var comment_length = $(this).val().length;
    		var chars_left = comment_limit - comment_length;
    
    		$( '.comment_limit_info span' ).html( chars_left );
    
    		if (comment_input)
    			( chars_left > 0 ) ? comment_class.show() : comment_class.hide();
    		
    		if (comment_button)
    			( chars_left > 0 ) ? comment_button.hide() : comment_button.show();
    	});
    });

    Good luck to all,

    Chad

    #162407
    juggledad
    Participant

    @robkk: Just to clarify something, the OR function_exists('is_bbpress') was added (with some other code, to get around a bug that bbpress doesn’t seem to want to acknowledge or fix. see https://bbpress.trac.wordpress.org/ticket/2723

    #162406
    Robkk
    Moderator

    you can use something like this.

    #bbpress-forums .bbp-body .topic-author {
      background: #f5f5f5;
    }
    #162404

    In reply to: Searching by user

    Robkk
    Moderator

    this has something to search by user.

    its not a plugin more of a file to put in a folder called bbpress in your child theme and some PHP code snippets but i will test it out to see if it works.

    https://github.com/MateuszNowicki/bbpress-Advanced-Search

    #162388
    Robkk
    Moderator

    hmmm that is odd. i did not find a css issue, so it must be something else.

    as a test try this to see if the avatars render correctly in the area if there is correct code.

    function rkk_topic_av() {
    	    	echo bbp_get_topic_author_link( array( 'size' => '48' , 'type' => 'avatar'));
    }
    add_action('bbp_theme_before_topic_title','rkk_topic_av');

    then give me the results then we will look over it more.

    #162385
    PinkishHue
    Participant

    You should be able to control this in Yoast SEO by changing the meta title settings, or it may be something you have to do in your theme / a custom plugin.

    See info here re: using Yoast and the different settings:
    http://kb.yoast.com/article/146-yoast-wordpress-seo-titles-metas-template-variables

    It looks like you want to make sure the meta title is set to just use this Yoast variable:

    %%title%%

    #162382
    PinkishHue
    Participant

    Hmm, this sounds a bit complicated as bbpress replies are not technically ‘comments’, they are a separate post type, the same as topics, that are simply connected to their parent topic (as far as I know anyway).

    The first thing I would try is to copy the code that displays comments on a regular post, and add this to the template that displays my topics. That way, if comments are attached to the topic, they will display when viewing the topic on the front end.

    You want to find the template ‘content-single-topic.php’

    This should be at wp-content/themes/your-theme/bbpress/

    (If it’s not, read up on theming here: https://codex.bbpress.org/theme-compatibility/)

    Then add this code somewhere in that file:

    <?php wp_list_comments(); ?>

    If no comments appear when you view a topic, then I would check in my mysql database to see how the comments are being saved – perhaps they are saving to the database but without being assigned to a specific post (topic). You may need to enable comments for the ‘topic’ post type.

    I hope that helps, it is a bit complicated as I said.

    #162380
    Robkk
    Moderator

    @ricsca2

    this should do it.

    function rk_show_advstats() {
      echo do_shortcode( '[bbpas-activity]' );  
    }  
    
    add_action( 'bbp_template_after_forums_index', 'rk_show_advstats' );
    add_action( 'bbp_template_after_topics_index', 'rk_show_advstats' );
    add_action( 'bbp_template_after_single_topic', 'rk_show_advstats' );
    add_action( 'bbp_template_after_single_forum', 'rk_show_advstats' );


    @geekserve

    add this to your plugin description or installation.section on your plugins page.

    it seems it would be the most useful function for your plugin.

    #162375
    Robkk
    Moderator

    ok thanks for reminding me …again.

    i have been losing track on these topics lately.

    What i found is that this bug is because of your theme and not really bbPress. So i recommend contacting your theme developers about this especially since they want to support bbPress.

    in the bfa_post_parts.php file in your functions folder, under the bfa_post_bodycopy function you will see

    OR function_exists('is_bbpress')

    This is what is causing your issue.

    the way i figured out to fix it is to remove this and create my own bbpress.php off of the index.php file from your theme.

    this is all the code i used to create the file. So you can copy and paste this into your theme into a bbpress.php file and all should work …hopefully.

    I also left the widget areas there if you want them still there user theme/replace them or just remove them.

    <?php 
    list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
    get_header(); 
    extract($bfa_ata); 
    global $bfa_ata_postcount;
    ?>
    
    <?php /* If there are any posts: */
    if (have_posts()) : /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>
    
        <?php  if ($bfa_ata['widget_center_top'] <> '') { 
              echo bfa_parse_widget_areas($bfa_ata['widget_center_top']); 
    	} ?>
    
    	<?php while (have_posts()) : the_post();?>
    	
    		<?php /* Post Container starts here */
    		if ( function_exists('post_class') ) { ?>
    		<div <?php if ( is_page() ) { post_class('post'); } else { post_class(); } ?> id="post-<?php the_ID(); ?>">
    		<?php } else { ?>
    		<div class="<?php echo ( is_page() ? 'page ' : '' ) . 'post" id="post-'; the_ID(); ?>">
    		<?php } ?>
    		<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
    		<div class="post-bodycopy clearfix"><?php the_content(); ?></div>
    		</div><!-- / Post -->	
    						
    	<?php endwhile; ?>
    
        <?php if ($bfa_ata['widget_center_bottom'] <> '') { 
              echo bfa_parse_widget_areas($bfa_ata['widget_center_bottom']); 
        } ?>
    
    <?php endif; /* END of: If there are no posts */ ?>
    
    <?php get_footer(); ?>
    #162366
    Robin W
    Moderator

    you can have a page and then put at the bottom the shortcode

    [bbp-single-topic id=$topic_id] – Display a single topic. eg. [bbp-single-topic id=4096]

    #162358
    Robin W
    Moderator

    Sorry, been busy with other things – thanks for the reminder.

    Having taken a second look, I think boith are coming form your theme, not bbpress.

    I can’t hide the first one, as it is also used by other post enturies on the site, so suggest you lose the blue one, for which you need to put the following in your style.css

    see

    Forum & Thread Titles Duplicated

    .entry h1 {
        visibility: hidden !important;
    }

    You might need to check that this doesn’t affect anything else – I can’t see that it did – worse case is that you would not see a blue title, so if you have any others in the site this might affect them.

    #162355
    Hunniemaid
    Participant

    Make a folder in your theme folder labeled “bbpress”. You will then want to go to /wp-content/plugins/bbpress/templates/default/bbpress and copy the reply-form.php and paste it into the bbpress folder you made in your theme folder.

    Open the file, scroll down towards the bottom, you will see where it says “You must be logged in”. Delete that section of code.

    <div id="no-reply-<?php bbp_topic_id(); ?>" class="bbp-no-reply">
    		<div class="bbp-template-notice">
    			<p><?php is_user_logged_in() ? _e( 'You cannot reply to this topic.', 'bbpress' ) : _e( 'You must be logged in to reply to this topic.', 'bbpress' ); ?></p>
    		</div>
    	</div>
    
    #162350
    usr79223992
    Participant

    I figured it out.
    1st way: count clicks of “submit” button:

    //custom function
     function custom_trackEvent_newTopic ()
      {
    	echo '
    	<script>
    	  addListener(document.getElementById(\'bbp_topic_submit\'), \'click\', function() {
    		ga(\'send\', \'event\', \'forum\', \'btn_click_new topic\');
    	  });
    	  function addListener(element, type, callback) {
    		if (element.addEventListener) element.addEventListener(type, callback);
    		else if (element.attachEvent) element.attachEvent(\'on\' + type, callback);
    	  }
    	</script>
    	';
      }
    add_action ('bbp_theme_after_topic_form_submit_button', 'custom_trackEvent_newTopic') ;

    2nd way: count actual topic creation
    This would be more precise, but I didn’t figure it out yet. Actually this should work:

    function custom_trackEvent_newTopic ()
      {	
    	window.ga('send', 'event', 'forum', 'new topic');	  
      }
    add_action ('bbp_new_topic', 'custom_trackEvent_newTopic') ;

    …but it doesn’t.

    Fatal error: Call to undefined function ga() in /…/themes/…/functions.php on line 1594

    Somehow the function can’t be referenced that way. 🙁

    Evan100
    Participant

    This had got my head spinning. I have a new bbpress install, and have set up a login widget with a ‘Lost Password’ URI. I’ve also got a lost password page, with the [bbp-lost-pass] shortcode.

    When I go direct to the page, or click on the lost password link, I can see only an empty input box, and a big ‘Reset My Password’ button. Do I have to do something else to set up the widget?

    The page contents are mostly hidden in the css. The legend (which says ‘Lost Password’) is disabled (bbpress.css):

    .bbp-login-form fieldset legend {
    	display: none;
    }

    And the label for the input box is hidden in the template (form-user-lost-pass.php):

    <label for="user_login" class="hide"><?php _e( 'Username or Email', 'bbpress' ); ?>: </label>

    So, presumably some JavaScript somewhere should magically make all this appear, but it’s not firing, or I’ve just messed up. Any ideas? Note that I also have a lost password form in Woocommerce, but disabling Woocommerce doesn’t affect this. Thanks.

    #162347
    itsmeitsb
    Participant

    Hello,

    WP 4.2.2
    BB 2.5.7

    Looking to find where I can just remove the “You Must Be Logged In” prompts all together. I’ve already got the login/register stuff added to my sidebar, I don’t need the prompts to direct people.

    View post on imgur.com

    View post on imgur.com

    These are the specific things I’m speaking of. Can I just block them somehow in the css or is there somewhere I can simply delete the code to remove them all together?

    Thanks for your help.

    #162339
    Evan100
    Participant

    Stephen – I don’t know if this has changed since your post, but this isn’t great on bbpress 2.5.6, since it also affects the text for the topic subscribe/unsubscribe. Instead of seeing Favorite | Subscribe, you get Favorite (Subscribe). To fix this, you need to post-filter the args, and check before:

    function sa_after_get_forum_subscribe_link_parse_args($args) {
       if(empty($args['before'])) {
          $args['before'] = '&nbsp;(';
          $args['after']  = ')';
       }
       return $args;
    }
    
    add_filter(
       'bbp_after_get_forum_subscribe_link_parse_args',
       'sa_after_get_forum_subscribe_link_parse_args');
Viewing 25 results - 8,701 through 8,725 (of 32,505 total)
Skip to toolbar