Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change position for post inputfield

  • Hi,

    hoping for help, since I´m not in no way good enough to find this answer.

    The inputfiled for posts/replys in atopic seems to be attached to the page where the first post in a topic was made. Since I´ve using the the threads so that the latest post gets on top in the first page (and therefore the first post ends upp last in the last page). What happens is that the posting (input)-field ends upp on the last page.

    Is it possible to change in the code så that the posting field ends upp connected to the last posting/reply. And then (hopefully on page one).

    Anybody?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Right.

    In topics.php, delete:

    <?php if ( topic_is_open( $bb_post->topic_id ) ) : ?>
    <?php post_form(); ?>
    <?php else : ?>
    <h2><?php _e('Topic Closed') ?></h2>
    <p><?php _e('This topic has been closed to new replies.') ?></p>
    <?php endif; ?>

    Then after the first <?php topic_pages( array( 'before' => '<div class="nav">', 'after' => '</div>' ) ); ?>, insert:

    <?php if ( $page === 1 ) : ?>
    <?php if ( topic_is_open( $bb_post->topic_id ) ) : ?>
    <?php post_form( array( 'last_page_only' => false ) ); ?>
    <?php else : ?>
    <h2><?php _e('Topic Closed') ?></h2>
    <p><?php _e('This topic has been closed to new replies.') ?></p>
    <?php endif; ?>
    <?php endif; ?>

    It’ll be different if you’re using something that’s radically different to Kakumei, but the general idea is to take the bit that looks something like the first part and put <?php if ( $page === 1 ) : ?> and <?php endif; ?> around it, change post_form() to post_form( array( 'last_page_only' => false ) ) then move it to the top of the page.

    Hmm… almost there.

    Do you (or anyone else) have clue what to do. After posting i end up at the last page anyway. the input fields position is where it should be.

    Again, thanks for any respons

    Hmm… easy way of doing that :)

    function bb_reset_newpostlink() {
    global $link, $topic_id;
    $link = get_topic_link( $topic_id );
    }
    add_action( 'bb-post.php', 'bb_reset_newpostlink' );

    Put that in either functions.php or a plugin, it’ll overwrite the redirect link with the general topic one.

    Dont know if Im gone blind, but I cant find a file named functions.php

    help

    If you don’t have a functions.php in tour theme folder, just create one & add the above code, just make sure to include the opening & closing functions, so it would look like

    <?php
    function bb_reset_newpostlink() {
    global $link, $topic_id;
    $link = get_topic_link( $topic_id );
    }
    add_action( 'bb-post.php', 'bb_reset_newpostlink' );
    ?>

    Wow!,

    I cant explain enough how grateful I am for your help

    Kudos to both of you

    /Patric

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

You must be logged in to reply to this topic.