PinkishHue (@pinkishhue)

Forum Replies Created

Viewing 25 replies - 26 through 50 (of 80 total)
  • @pinkishhue

    Participant

    Not sure if this is the right place to add another suggestion but something that just occurred to me that I think would be helpful –

    Perhaps all bbpress custom post types could be grouped together under 1 ‘bbpress’ entry in the admin menu. I find it feels quite cluttered once you’ve installed bbpress and suddenly have the 3 entries there for forums, topics & replies, and this must also be confusing for less experienced users who might not understand that they are 3 different post types.

    @pinkishhue

    Participant

    Another suggestion to try – check out CSV importer plugins, you *should* be able to create a simple spreadsheet with all the fields you need (taxonomies, parent posts etc), save as CSV and import.

    (If all works as it should! Certainly works with posts/pages etc so should work with bbpress forums/categories etc)

    In reply to: Proper Emoji Plugin

    @pinkishhue

    Participant

    Certainly will do 🙂

    In reply to: Proper Emoji Plugin

    @pinkishhue

    Participant

    I’ve not had chance to try it out yet but I think you could achieve this using some javascript like this example which inputs a list in to a textarea:

    http://stackoverflow.com/questions/14444938/append-text-to-textarea-with-javascript

    But instead of the list in the example you could have the emoji’s listed under your reply window.

    I’m going to try something like this but I’m not quite at that stage in development yet. Will update if/when I get to it.

    @pinkishhue

    Participant

    I’m assuming by category you mean the forum that the topic is in?

    You can remove the forum dropdown menu and use a hidden field here instead.

    In your theme you need to have this file:

    wp-content/your-theme/bbpress/form-topic.php

    If you don’t have it, copy it over from the bbpress default templates at:

    wp-content/plugins/bbpress/templates/default/bbpress

    Then open your new form-topic.php in a text editor and find this part of the code:

    <p>
    	<label for="bbp_forum_id"><?php _e( 'Forum:', 'bbpress' ); ?></label><br />
    	<?php
    		bbp_dropdown( array(
    		'show_none' => __( '(No Forum)', 'bbpress' ),
    		'selected'  => bbp_get_form_topic_forum()
    		) );
    	?>
    </p>

    and replace it with this:

    <input id="bbp_forum_id" type="hidden" name="bbp_forum_id" value="20">

    Where 20 is the ID no. of the forum you want all topics to be created in.

    Hope that helps 🙂

    @pinkishhue

    Participant

    Ok got it, needs sprucing up design-wise but this nicely outputs the reply content and date (with permalink) directly under the topic title on the single forum view topics list:

    (With thanks to some code used here – https://bbpress.org/forums/topic/how-to-get-reply-ids-within-topic-loop/)

    // https://bbpress.org/forums/topic/how-to-add-latest-reply-or-topic-to-forum-list/ - SHOW REPLIES ON SINGLE FORUM LIST OF TOPICS
    function jagreplies_add_last_reply() { { 
    $new_args = array(
        'post_type'=> 'reply'
    );
    $topic_id = bbp_get_topic_id();
    $new_args['post_parent'] = $topic_id;
    
    $new_query = new WP_Query( $new_args );
    
    if ( $new_query->have_posts() ) : while ( $new_query->have_posts() ) : $new_query->the_post();
    
         $reply_id=$post->ID;
         $reply_title= get_the_title();
         $reply_date= get_the_date();
         $reply_content= the_content(); 
         $reply_permalink= get_the_permalink(); 
    	?>
    
         <div class="the_content">
    		<?php echo $reply_content; ?>
    		<a href="<?php echo $reply_permalink ?>"><?php echo $reply_date ?></a>
    	</div>
                         
       <?php endwhile; ?>   
       <?php endif; 
    
        }} 
    // Hook into action
    add_action('bbp_theme_after_topic_freshness_author','jagreplies_add_last_reply');
    In reply to: Say hi to Robkk

    @pinkishhue

    Participant

    Well deserved, thanks for all the time and effort you put in Robert 🙂

    @pinkishhue

    Participant

    Could you just add some sort of conditional to say ‘if subscribed’ and ‘if in forum X’ in the replies loop template so say only people subscribed can see replies? Sounds like it should work?

    @pinkishhue

    Participant

    Just to add another suggestion, I’ve found this plugin works well on a regular WP install (not yet used with a live bbpress installation but the plugin info does say it supports it):

    https://wordpress.org/plugins/wp-spamshield/

    @pinkishhue

    Participant

    This plugin is really handy for logging in as different users/user levels:

    https://wordpress.org/plugins/user-switching

    @pinkishhue

    Participant

    Aah just realised of course that code is showing just the *last* reply, not listing all replies, so I will keep tweaking it and update if I can get it showing *all* replies.

    @pinkishhue

    Participant

    @julia_b (If you’re still waiting for a reply!) – you need to put this in your functions.php file, more info here: https://codex.bbpress.org/functions-files-and-child-themes-explained/

    This works great, thanks so much for sharing this code!

    I’ve also managed, with very little tweaking, to get this displaying replies under topics within the topics list (this is very rough with some bits commented out but pasting here in case it helps someone)

    
    // https://bbpress.org/forums/topic/how-to-add-latest-reply-or-topic-to-forum-list/
    function jagreplies_add_last_reply() { { 
     $jagreplies_last_reply_id = bbp_get_topic_last_reply_id();
     //$jagreplies_last_topic_id = bbp_get_forum_last_topic_id();
    
    $new_args = array(
        'post_type'=> 'reply',
        'p' => $jagreplies_last_reply_id
    );
    $post_title_args = array(
        'post_type'=> 'topic',
        'p' => $jagreplies_last_topic_id
    );
    $other_args = array(
        'post_type'=> 'topic',
        'p' => $jagreplies_last_topic_id
    );
    $jagreplies_query = new WP_Query( $post_title_args );
    $nest_query = new WP_Query( $new_args );
    $another_nest_query = new WP_Query( $other_args );
    
       if ( $jagreplies_query->have_posts() ) : while ( $jagreplies_query->have_posts() ) : $jagreplies_query->the_post();
         $this_post_id=$post->ID;
         $this_post_permalink= get_permalink(); ?>   
                                 
         <!--<a href="<?php //echo $this_post_permalink; ?>">-->
    
    <?php endwhile; 
       endif; wp_reset_query();
    
       if ( $nest_query->have_posts() ) : while ( $nest_query->have_posts() ) : $nest_query->the_post();
         $this_post_id=$post->ID;
         //$this_post_title= get_the_title();
         //$this_post_content= get_the_excerpt(); 
         $this_post_content= the_content(); ?>
    
         <h1><?php echo $this_post_title; ?></h1></a>
         <div class="the_content"><?php echo $this_post_content; ?></div>
                         
       <?php endwhile;
    elseif ( $another_nest_query->have_posts() ) : while ( $another_nest_query->have_posts() ) : $another_nest_query->the_post();
         $this_post_id=$post->ID;
         //$this_post_title= get_the_title();
         //$this_post_content= get_the_excerpt();
         $this_post_content= the_content(); ?>   
                                      
         <!--<h1><?php //echo $this_post_title; ?></h1></a>-->
         <div class="the_content"><?php echo $this_post_content; ?></div>
                         
       <?php endwhile; 
       endif; 
        }} 
    // Hook into action
    add_action('bbp_theme_after_topic_freshness_author','jagreplies_add_last_reply');

    This is extremely useful in creating a ‘Facebook’ style site where all content can be displayed on one single page (I know, Facebook, yuck! But it’s what ‘the people’ like)

    Now I just need to try to get the bbpress Ajax Replies plugin working in conjunction with this so people can post and reply from that single page. Interesting!

    **edited to add – if using my code above you may just want to change the last line ‘bbp_theme_after_topic_freshness_author’ to a different hook depending on where you want to display it, I am using customised templates but I’m not sure how it would look loading the content there if using the default templates

    @pinkishhue

    Participant

    Sorry for the delayed reply, you could upload your screengrab to http://imgur.com and then give us the link.

    Do you have some topics within your forums? Could it be that the template is saying ‘by’ as it’s trying to show the latest topic but there’s no topic there to show?

    And what theme are you using? It could be that the ‘by’ has been hard coded in to the templates?

    @pinkishhue

    Participant

    One way to do this is to simply hide the reply form for the roles you do not want to be able to reply.

    There is a similar topic here talking about making it so that only admins can post in X forum so hopefully this will be a jumping off point for you:

    Disallow topic creation but allow comments in certain forums

    I think there’s a ‘form-reply.php’ so you’d use that instead of ‘form-topic.php’ and you’d need to alter the conditional statement to say IF you are in forum ID X and the user has Y role – then show the reply form.

    Hope that helps but come back to us if you need more help.

    @pinkishhue

    Participant

    Hmm that’s a stinker.

    What URL are you actually taken to when you get the 404 message, is the URL right? I believe it should be – ‘my-post-title/edit’

    Have you tried disabling all other plugins AND using the default theme at same time? (difficult if the site is live of course)

    If it’s not on a live site maybe try a fresh bbpress install? Also there are some repair tools in the settings you can try (I haven’t had experience using these but it’s worth a try)

    @pinkishhue

    Participant

    First I would download a copy of my mysql database using phpmyadmin, then do a search in there for that email address.

    Then you can see where it has that data saved, and if possible, remove it manually, then reupload the mysql file (but be careful as the database uses serialised data* in places so if you change things by hand sometimes this can cause problems).

    *Think that’s right but haven’t double checked! It’s something like that.

    @pinkishhue

    Participant

    The positioning should be do-able using CSS but it’s hard to advise without access to the page to see what CSS classes etc are on those elements.

    For the login form area you want something like…

    .login-form {
    width: 70%;
    float: left;
    display: inline;
    }

    and for the search area…

    .theclassname {
    width: 27%;
    float: right;
    display: inline;
    }

    But you may also want to look in to using media queries so that this CSS is only used when the browser window is big (on a pc) so that when people access the site on a smaller browser window (on a mobile or tablet etc) those areas aren’t all crammed in together.

    Re: defining different class names – I think we’d need to see your site/code to make sense of that, I just had a quick look at the buddypres template for the registration page and can’t see any classes of .login-form there so it may depend on your theme.

    Hope that’s of some help 🙂

    @pinkishhue

    Participant

    Can he set himself to Keymaster?

    Also, maybe try running the repair tools?

    In reply to: BBPress fullwidght

    @pinkishhue

    Participant

    Your site is not available so I can’t have a look.

    If you’re using a custom theme with ‘theme options’ you need to look at the settings there to see if the default setting is with a sidebar, your forum will use this default page unless you create templates specially for it.

    Here’s some info on the templates that bbpress looks for in your theme:

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

    Usually using page.php in most themes, so you could try opening up your page.php, remove the code that includes a sidebar, then save it as bbpress.php

    @pinkishhue

    Participant

    Please can someone advise how the code above could be used only if using the reply form within a certain forum? e.g Forum ID 20

    I’ve tried the following at a guess but it’s not working…

    add_filter( 'bbp_get_the_content', 'amend_reply', 10, 3);
    
    Function amend_reply ($output, $args, $post_content) {
    if ( bbp_is_single_forum('20') ) {
    if ($args['context'] == 'reply' && $post_content == '') $output=str_replace('></textarea>', 'placeholder="Reply..." ></textarea>',$output) ;
    return $output ;
    }
    }
    

    or

    add_filter( 'bbp_get_the_content', 'amend_reply', 10, 3);
    
    Function amend_reply ($output, $args, $post_content) {
    if ($args['context'] == 'reply' && $post_content == '' && bbp_is_single_forum('20') ) $output=str_replace('></textarea>', 'placeholder="Reply..." ></textarea>',$output) ;
    return $output ;
    }
    

    or the same but using ‘bbp_is_forum_archive()’

    Many thanks for any help anyone can give me.

    @pinkishhue

    Participant

    I was able to do this by adding this to my functions.php / custom plugin:

    
    // Add custom fields to bbpress topics on front end
    add_action ( 'bbp_theme_before_topic_form_content', 'bbp_extra_fields');
    function bbp_extra_fields() {
       $value = get_post_meta( bbp_get_topic_id(), 'YOUR-FIELD-NAME', true);
       echo '<label for="bbp_extra_field">My Extra Field:</label><br>';
       echo "<input type='text' name='YOUR-FIELD-NAME' value='".$value."'>";
    }
    
    //Save and update the values from the front end
    add_action ( 'bbp_new_topic', 'bbp_save_extra_fields', 10, 1 );
    add_action ( 'bbp_edit_topic', 'bbp_save_extra_fields', 10, 1 );
    
    function bbp_save_extra_fields($topic_id=0) {
      if (isset($_POST) && $_POST['YOUR-FIELD-NAME']!='')
        update_post_meta( $topic_id, 'YOUR-FIELD-NAME', $_POST['YOUR-FIELD-NAME'] );
        
    }
    

    I think that’s correct but am in a bit of a code-haze at the moment! Hopefully it puts you on the right track at least. (And I can’t remember where I got the original code so apologies for not crediting original author)

    In reply to: Forum closed and topic

    @pinkishhue

    Participant

    You could leave the forum open but just hide the form for creating new topics in that forum. There’s a similar topic here that may help you:

    Disallow topic creation but allow comments in certain forums

    @pinkishhue

    Participant

    This is an old topic but in case you’re still looking for help (or if helpful to someone else), this plugin allows you to use a shortcode to display a list of notifications (and other buddypress things) in a page or post:

    https://wordpress.org/plugins/bowe-codes/

    @pinkishhue

    Participant

    You could use buddypress group forums for this, they can be set to be private or hidden (not sure which) which means other users can not view/post in them

    BuddyPress

    @pinkishhue

    Participant

    This topic is a bit old now but if you’re still looking for an answer (or if helpful to other people)

    Here’s some info that should help:

    Layout and functionality – Examples you can use

    Sticky thread Issues

Viewing 25 replies - 26 through 50 (of 80 total)