I'd like to adhere to forum norm and stick a big 'Post Reply' button at the bottom and end of a thread, just like phpBB and the rest. It's okay if I have to keep the 'reply/add new comment' links on each node/comment. Here are my thoughts:

I'm not a coder but I've found the 'reply' code in advanced_forum.module:

 if (!empty($vars['node']->links) && !empty($vars['node']->links['comment_add'])) {
   $vars['node']->links['comment_add']['title'] = t('Reply');
   $vars['links'] = theme('links', $vars['node']->links, array('class' => 'links inline'));
}

I could stick this in forum-thread.tpl.php, but a 'Post Reply' button would appear for every comment/node so there would be multiple 'Post Reply' buttons and not just the two at the opposite ends of a page. It seems there is no 'overall' template for threads. Would a block with the 'Post Reply' code be the best bet?

the forum: http://sourdough.com.au/forum/topic/834

Comments

Michelle’s picture

You would have to put the code in page.tpl.php to have it outside the thread itself. That file is badly named as it implies it formats the whole thread rather than the individual posts. I'm thinking of changing it when I do the D6 backport.

That code you pasted won't work as all that is doing is changing the existing link name from "add comment" to "reply". You would need to make a link to the add reply page.

Michelle

Maedi’s picture

Hi Michelle, BTW thanks for a great module. The life blood of my site is its forum and Advanced Forum popped up just in time when I was considering to jump to Drupal. Thankyou.

On my site page.tpl.php is used on pages that aren't forum related. Can I use something like a 'page-forum.tpl.php'? Will there ever be an overall template for forum-thread.tpl.php?

Coding the 'Post Reply' button is a bit beyond me. Is this something you would be interested in putting into Advanced Forum? Could you show me an example? I read somewhere that someone is working on a new theme, how's that going? I'd love to help with any styling and might even make some buttons.

Michelle’s picture

This is something I was planning on doing. I don't remember if it's on the to do list or not. Too much of the to do list is still in my head.

eigentor got the theme updates done and they are in the latest alpha. There's a few minor fixes in the dev as well. I'll be doing another alpha later this week.

Michelle

Maedi’s picture

Okay, great. I'll design a post reply button if you'd like.

Michelle’s picture

I'm actually looking for a set of buttons for all the links. See http://groups.drupal.org/node/7809#comment-27080 if you're interested.

Michelle

Michelle’s picture

Status: Active » Fixed

Partially done. Actually putting the button on the top was easy. I just added it to the node. Putting it at the end is much more complicated because it would have to be done at the bottom of the last comment on the page. I think it would be much easier for you to put it in your page.tpl.php. Once I integrate panels, stuff like this will be easier, but that's a ways off. Marking this fixed as it's as fixed as I'm going to be doing pre-panels.

Michelle

Maedi’s picture

Just like:

 if (!$top_post) {
        print '<span class="post-num">';
        print $comment_link;
        print '</span>' ;
      } 

You could have one for the last post as well and include the buttons in forum-thread.tpl.php instead of node.tpl.php so it's forum specific. When you say node, you're talking about the overall node? or a node-forum.tpl.php?

Michelle’s picture

Your code would put the link at the top of every comment, which isn't what you asked for. I put the code at the top of forum nodes, which puts it at the top of the thread. Putting it at the bottom of the thread requires calculating the last comment on every page and putting it on the bottom of that. That's extra overhead on every thread, plus I need to figure out how to do it. Since you can get the same effect by adding it to page.tpl.php, I'm going to leave it at that for now. Once I integrate panels, I'll have more control over the page and be able to do more.

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.