Info
- 7 posts
- 3 voices
- Started 2 years ago by BaraBajen
- Latest reply from BaraBajen
- This topic is resolved
Change position for post inputfield
-
- Posted 2 years ago #
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?
-
- Posted 2 years ago #
Right.
Intopics.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, changepost_form()topost_form( array( 'last_page_only' => false ) )then move it to the top of the page. -
- Posted 2 years ago #
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
-
- Posted 2 years ago #
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.phpor a plugin, it'll overwrite the redirect link with the general topic one. -
- Posted 2 years ago #
Dont know if Im gone blind, but I cant find a file named functions.php
help
-
- Posted 2 years ago #
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' ); ?> -
- Posted 2 years ago #
Wow!,
I cant explain enough how grateful I am for your help
Kudos to both of you
/Patric
-
You must log in to post.