kasperdalkarl (@kasperdalkarl)

Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)

  • kasperdalkarl
    Participant

    @kasperdalkarl

    Thanks, that worked perfectly. Now I got my forum set up just as my users want it. Thanks a lot for your amazing and fast assistance!


    kasperdalkarl
    Participant

    @kasperdalkarl

    Yeah but for my needs I don’t really need to translate the whole site. But if that’s the best way I will of course give it a shot! Thanks a lot for your help! You have been the most helpful mod I’ve ever met online and your solution works really great for what I needed!


    kasperdalkarl
    Participant

    @kasperdalkarl

    Thanks again for your amazing help!

    I did as you asked, and I realized a few things.

    Adding your code in form-reply.php only changed how it looks in the reply form, i.e. when you open a thread and scroll down to the actual box where you write replies.

    What I realised is that “Reply To:” that shows in the forums is actually not from code, it’s automatically added to the topic name when someone answers a thread.
    Reply to

    So the follow up question is, can you somehow in bbpress change so replies doesn’t add “Reply To”, I would like to change it to the Swedish equivalent: “Svar till:”. And is it possible then to add what we tried earlier with the avatar+name in front of the name of the topic reply?

    Thanks a lot!


    kasperdalkarl
    Participant

    @kasperdalkarl

    Hi again!

    I managed to find it now. It’s here:
    wp-content/themes/godlike/bbpress/form-reply.php

    <?php if (bbp_is_reply_edit()) : ?>
    
    <div id="bbpress-forums">
    
        <?php endif; ?>
    
        <?php if (bbp_current_user_can_access_create_reply_form()) : ?>
            <div class="nk-gap-2"></div>
            <h3 class="h4"><?php printf(esc_html__('Reply To: %s', 'godlike'), bbp_get_topic_title()); ?></h3>
            <div class="nk-gap-1"></div>
            <div id="new-reply-<?php bbp_topic_id(); ?>" class="bbp-reply-form nk-box-3 bg-dark-1">
    
                <form id="new-post" name="new-post" method="post" class="nk-form" action="<?php the_permalink(); ?>">
    
                    <?php do_action('bbp_theme_before_reply_form'); ?>
    
                    <fieldset class="bbp-form">
    
                        <?php do_action('bbp_theme_before_reply_form_notices'); ?>
    
                        <?php if (!bbp_is_topic_open() && !bbp_is_reply_edit()) : ?>
    
                            <?php echo do_shortcode('[nk_info_box icon="fa fa-exclamation-circle" show_close_button="true" class="bg-main-1"]' . esc_html__('This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.', 'godlike') . '[/nk_info_box]'); ?>
    
                        <?php endif; ?>

    kasperdalkarl
    Participant

    @kasperdalkarl

    Hey!

    Yeah I have actually been trying to do that for the last hour or so, but can’t find it anywhere. Any suggestions are appreciated, but my search continues in the files!


    kasperdalkarl
    Participant

    @kasperdalkarl

    Hi again!
    I tried the different order numbers but no change sadly.


    kasperdalkarl
    Participant

    @kasperdalkarl

    Hi there!
    Thanks for the help! I added it using Code Snippets, and now the last reply author’s name appears in front of “Started by”, as you can see on this link here: https://www.talanrien.com/rollspel/

    Maybe with some minor adjustment it could appear in front of “Reply To”. Thanks for your amazing help!


    kasperdalkarl
    Participant

    @kasperdalkarl

    Thanks a lot, it’s much appreciated!


    kasperdalkarl
    Participant

    @kasperdalkarl

    It probably comes from the theme I have, it currently looks like this in loop-single-topic:

       <div class="nk-forum-title-sub">
    
          
            <?php
            $link_url = bbp_get_topic_last_reply_url();
            $title = bbp_get_topic_last_reply_title();
            ?>
            <div class="nk-forum-activity-title" title="<?php echo esc_attr($title); ?>">
                <a href="<?php echo esc_url($link_url); ?>"><?php echo esc_html($title); ?></a>
            </div>
            
            
             <div class="nk-forum-activity-date">
                <?php do_action('bbp_theme_before_topic_freshness_link'); ?>
                <?php $time_since = bbp_get_topic_last_active_time();
                if (!empty($time_since)) {
                    echo esc_html($time_since);
                } else {
                    echo esc_html__('No Replies', 'godlike');
                }
                ?>
                <?php do_action('bbp_theme_after_topic_freshness_link'); ?>
            </div>
               
    
                <?php do_action('bbp_theme_before_topic_started_by'); ?>
    
                <span
                    class="bbp-topic-started-by"><?php printf(esc_html__('Started by %1$s', 'godlike'), bbp_get_topic_author_link(array('type' => 'name')), bbp_get_reply_post_date()); ?></span>
    
                <?php do_action('bbp_theme_after_topic_started_by'); ?>
    
                <?php if (!bbp_is_single_forum() || (bbp_get_topic_forum_id() !== bbp_get_forum_id())) : ?>
    
                    <?php do_action('bbp_theme_before_topic_started_in'); ?>
    
                    <span
                        class="bbp-topic-started-in"><?php printf(__('in: <a href="%1$s">%2$s</a>', 'godlike'), bbp_get_forum_permalink(bbp_get_topic_forum_id()), bbp_get_forum_title(bbp_get_topic_forum_id())); ?></span>
    
                    <?php do_action('bbp_theme_after_topic_started_in'); ?>
    
                <?php endif; ?>
    
            </div>

    kasperdalkarl
    Participant

    @kasperdalkarl

    I actually found a solution by trying some stuff out.

    Go to this file: …/wp-content/plugins/bbpress/includes/common/formatting.php

    And at the bottom of that file, add this:

    add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' );
    function ntwb_bbpress_custom_kses_allowed_tags() {
    	return array(
    		// Links
    		'a'          => array(
    			'class'    => true,
    			'href'     => true,
    			'title'    => true,
    			'rel'      => true,
    			'class'    => true,
    			'target'    => true,
    		),
    		// Quotes
    		'blockquote' => array(
    			'cite'     => true,
    		),
    		
    		// Div
    		'div' => array(
    			'class'     => true,
    		),
    		
    		// Span
    		'span'             => array(
    			'class'     => true,
                            'style'     => true,
    		),
    		
                    // Paragraph
    		'p'             => array(
    			'class'     => true,
                            'style'     => true,
    		),
    
    		// Code
    		'code'       => array(),
    		'pre'        => array(
    			'class'  => true,
    		),
    		// Formatting
    		'em'         => array(),
    		'strong'     => array(),
    		'del'        => array(
    			'datetime' => true,
    		),
    		// Lists
    		'ul'         => array(),
    		'ol'         => array(
    			'start'    => true,
    		),
    		'li'         => array(),
    		// Images
    		'img'        => array(
    			'class'    => true,
    			'src'      => true,
    			'border'   => true,
    			'alt'      => true,
    			'height'   => true,
    			'width'    => true,
    		),
    		// Tables
    		'table'      => array(
    			'align'    => true,
    			'bgcolor'  => true,
    			'border'   => true,
    		),
    		'tbody'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'td'         => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'tfoot'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'th'         => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'thead'      => array(
    			'align'    => true,
    			'valign'   => true,
    		),
    		'tr'         => array(
    			'align'    => true,
    			'valign'   => true,
    		)
    	);
    }

    kasperdalkarl
    Participant

    @kasperdalkarl

    Thanks for posting this. I installed the plugin, and added

    			// Paragraph
        	'p'          => array(
        	    'class'    => true,
            	'style'    => true,

    But sadly I still get this in cleartext:
    <p style=”text-align: center;”>Test 3</p>

    Any suggestions? Thanks!

    In reply to: HTML in text

    kasperdalkarl
    Participant

    @kasperdalkarl

    Same issue for me, no solution?

    In reply to: Recent replies list

    kasperdalkarl
    Participant

    @kasperdalkarl

    I tried to do that now and update the file, but still no change.

    <?php

    /**
    * Forums Loop
    *
    * @package bbPress
    * @subpackage Theme
    */

    ?>

    <?php echo do_shortcode(‘[bbpress_recent_replies_by_topic show =5]’) ?>

    <?php do_action( ‘bbp_template_before_forums_loop’ ); ?>

    <ul id=”forums-list-<?php bbp_forum_id(); ?>” class=”bbp-forums nk-forum”>

    <?php while ( bbp_forums() ) : bbp_the_forum(); ?>

    <?php bbp_get_template_part( ‘loop’, ‘single-forum’ ); ?>

    <?php endwhile; ?>

    <!– .forums-directory –>

    <div class=”nk-gap-2″></div>

    <?php do_action( ‘bbp_template_after_forums_loop’ ); ?>

    In reply to: Recent replies list

    kasperdalkarl
    Participant

    @kasperdalkarl

    Currently it looks like this:

    <?php

    /**
    * Forums Loop
    *
    * @package bbPress
    * @subpackage Theme
    */

    ?>

    <?php echo do_shortcode(‘[bbpress_recent_replies_by_topic]’) ?>

    <?php do_action( ‘bbp_template_before_forums_loop’ ); ?>

    <ul id=”forums-list-<?php bbp_forum_id(); ?>” class=”bbp-forums nk-forum”>

    <?php while ( bbp_forums() ) : bbp_the_forum(); ?>

    <?php bbp_get_template_part( ‘loop’, ‘single-forum’ ); ?>

    <?php endwhile; ?>

    <!– .forums-directory –>

    <div class=”nk-gap-2″></div>

    <?php do_action( ‘bbp_template_after_forums_loop’ ); ?>`

Viewing 14 replies - 1 through 14 (of 14 total)