baylock (@baylock)

Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • In reply to: Persistant login form

    baylock
    Participant

    @baylock

    After 3 months and still not a clue, I come back with my question, hoping this time to get a working answer:

    I have installed the forum and created a template page called “forum.php” embedding a shortcode for the login form and another for the forums list to be displayed.
    The thing is that the login form only appears on the first page of the forum (forums list), but if a visitor is in the “topic” or “reply” page, he will not see the login form anymore and will have to go back to the first forums page in order to login.

    I looked into the login widget but this solution displays the login form everywhere on the website, not only on the forum section. Moreover, this solution forces me to have the login form on the header, footer or sidebar when I want it to be inside the forum area.

    I also looked into the shortcode solution but to be able to put that shortcode you need a page template. And, as far as I know, the template “forum.php” applies to the first page of the forum, not to the “topics/replies” pages which are accessed through the forums list (also a short code).

    Three months and still not a clue.
    It would be nice if you could help me on this one.
    Having the login form on each page of a forum system is not an odd request…

    Thank you.

    PS: the external plugin solution is not relevant for me as it is a mutinlingual website with RTL and LTR languages. Finding a plugin which tolerates so many languages is almost not an option and complicates things for no reason as this request is trivial enough. At least, I hope it is…


    baylock
    Participant

    @baylock

    Thank you, I’ll do that!


    baylock
    Participant

    @baylock

    Thank you for your answer.

    Well, I must insist:
    If ‘ar’ is used, only BBpress is in arabic and if ‘ar_AR’ is used, only WordPress is in arabic.

    What you point out may be so in writing but pointing it out will not change the fact that it’s not working in real life.
    It’s quick and easy to verify and the marge of error of doing it wrong is very small.
    So, I’m quite positive.

    So, what are my options then?

    Thank you for your help.

    In reply to: Persistant login form

    baylock
    Participant

    @baylock

    Thank you for your answer Robin W.
    I would rather use the shortcode as I don’t even use a sidebar.
    How come I can’t see the login form through all the views as they are all part of the same WP page (which has the shortcode) ?

    Thank you.


    baylock
    Participant

    @baylock

    I really hope someone will be able to help you on this but I believe, as long as BBpress works ok out of the box, that the question should be asked to your main theme maker.
    Maybe it was supposed, at some point, to work on some previous version of BBPress?

    Anyway, if you know how to use css, this should be something that could be solved within minutes.
    I would help if I could but without having this specific theme styles, it’s difficult to know remotely what to tweak.

    Anyway, I hope you’ll find your answer around here!

    Regards.


    baylock
    Participant

    @baylock

    Ok, thank you!

    I achieved what I wanted, this way:

    Forums list:

    <p class="bbpx-topic-meta">
        <?php
        $forum_id  = bbp_get_forum_id();
        $last_active = get_post_meta( $forum_id, '_bbp_last_active_time', true );
        if ( empty( $last_active ) ) {
            $reply_id = bbp_get_forum_last_reply_id( $forum_id );
    	if (!empty( $reply_id)){$last_active = get_post_field( 'post_date', $reply_id );} 
            else 
            {
    	    $topic_id = bbp_get_forum_last_topic_id( $forum_id );
                if (!empty( $topic_id)){$last_active = bbp_get_topic_last_active_time( $topic_id );};
    	};
        };
        $date= date('d/m/Y',bbp_convert_date( $last_active ));
        $active_id = bbp_get_forum_last_active_id( $forum_id );
        $link_url  = $title = '';
    
        //these two next lines are beyond me: same condition, two results for the same variable...
        if (empty($active_id)){$active_id = bbp_get_forum_last_reply_id( $forum_id );};	
        if (empty($active_id)){$active_id = bbp_get_forum_last_topic_id( $forum_id );};
    
        if (bbp_is_topic($active_id)) 
        {
    	$link_url = bbp_get_forum_last_topic_permalink( $forum_id );
    	$title    = bbp_get_forum_last_topic_title( $forum_id );
        } 
        elseif (bbp_is_reply($active_id)) 
        {
    	$link_url = bbp_get_forum_last_reply_url( $forum_id );
    	$title    = bbp_get_forum_last_reply_title( $forum_id );
        };
        $time_since = bbp_get_forum_last_active_time( $forum_id );
        if (!empty($time_since) && !empty($link_url) 
        {
    	$anchor = '<a href="'.esc_url($link_url).'" title="'.esc_attr($title).'">'.$date.'</a>';		
            ?>
            <span class="bbp-topic-freshness-author">
              <?php
                  bbp_author_link(array('post_id'=>bbp_get_forum_last_active_id(),'size'=> 14));
              ?>
            </span>
            <?php	
        }
        else {$anchor = 'esc_html__( 'No Topics', 'bbpress' );};
        ?>
    </p>
    		
    <?php
    echo apply_filters( 'bbp_get_post_time', $anchor, $forum_id, $time_since, $link_url, $title, $active_id );
    ?>

    Topics list:

    <p class="bbp-topic-meta">
        <span class="bbp-topic-freshness-author"><?php bbp_author_link(array('post_id =>bbp_get_topic_last_active_id(),'size'=>14)); ?></span>
            <?php
    	$topic_id   = bbp_get_topic_id();
    	$reply_id   = bbp_get_topic_last_reply_id();
    	$title      = bbp_get_topic_last_reply_title( $topic_id );
    	$link_url   = bbp_get_topic_last_reply_url( $topic_id );
    	$date   = get_post_time( 'd/m/Y', $gmt, $reply_id, true );
    	$anchor = '<a href="'.esc_url($link_url).'" title="'.esc_attr($title).'">'.esc_html($date).'</a>';
    	echo apply_filters( 'bbp_get_topic_freshness_link', $anchor, $reply_id, $result, $link_url, $title );	
    	?>
    </p>

    As you can see, I didn’t hook anything already. So far I just got rid of the “bbp_topic_freshness_link()” in the templates and simply replaced the initial function by these lines, just to make a test. I still have to make a function out of these.

    Not happy with this mess as I’m sure it’s more complicated that it should be, but it works.

    Thank you for your guidance koendb!


    baylock
    Participant

    @baylock

    Please guys, this is not something trivial.

    I tried to work it out but I couldn’t as there is not a single post around here answering that and there is nowhere I can find a comprehensive list and description of the BBPress functions.

    All BBpress functions I happened to find that are related to the dates are displaying them in a sophisticated way, there is none I could find that just displays the date in its simplest form.
    I tried to “date()” and “strtotime()” every single variable I could find but with no success.

    There are posts telling how to use flat dates around here but these posts are very old (4 years..) and they make use of functions that don’t exist anymore.
    There was supposed to be a plugin for that but this plugin doesn’t exist anymore neither.
    And the more recent questions about this issue are just not answered.

    I hope this will not be taken the wrong way: I’m very grateful for this plugin and for all the people working on it. Really. I just don’t know how to move on with an unanswered question and some outdated answers.

    PS: I asked you how to get the latest post date in the forum list view but now, I also (and mainly) need to know how to achieve this in the topic list view and posts view as they are not documented neither.
    Long story short: how to get real dates everywhere!

    It’s been two days and I’m still in the dark. If it’s there somewhere, my bad, but please be assured that, as obvious as it might be, I tried my best.

    Thank you very much for your help.


    baylock
    Participant

    @baylock

    I answered to the post of @tansu (called “Theme issues”).
    I just began using BBpress so I’m not a BBPress savvy but I had this part working.
    I hope it will help you both.


    baylock
    Participant

    @baylock

    Very clean, very nice!
    Congrats.

    In reply to: Theme issues

    baylock
    Participant

    @baylock

    There are two ways for achieving what you need and it took me quite a long time to figure it out too:

    1) You create a child theme just like you did but what I didn’t know is that, after doing it (not forgetting to declare the parent template and the “@import” path accordingly in the css file located inside your child theme folder), you NEED to activate the child theme in your theme section of your WordPress admin. This last part is the one I didn’t know about, which is why it didn’t work at first.

    2) the easier and a little more messier technique is straight forward:
    Just write your custom BBpress css styles at the end of your main theme css file. It’ll work.
    And if you need to change the bbpress template files, just copy the needed files inside your main WordPress theme folder and make the changes there. These files will overwrite the default ones that are in the original bbpress template folder. As simple as that

    Both will work and will not be a problem in case of a WordPress or BBpres update.
    The first technique is to be preferred because you will gather your BBpress children files within a same recognizable folder when the second technique will blend the BBpress children files among the ones of your main theme. Not to mention that if you decide later to switch the WordPress theme, you will have to extract the bbpress children files and styles from the previous WordPress theme to put them in the the new one.
    But ultimately, the result will be the same.

    Hope it helped.

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