I'm trying to make some adjustments to the topic list page. I'm hoping that someone can help me figure these out:

1. I want to get rid of the whole created column, but I'm not sure how to delete the created table header.

2. I want to change the last reply column to more of a last post column. So if there's no replies it would display the created date and author instead of n/a.

3. I'm trying to put the post author underneath the topic title. I managed to do this with the '$topic->name', shown in the following code, but I can't figure out how to have the author name link to their profile.

<td class="title">
   <?php 
      print $topic->title; 
      if (!empty($topic->pager)) {
        print '<span class="forum-topic-pager"> ' .$topic->pager . '</span>';
      }
      print '<div class="topicauthor">' . $topic->name . '</div> '; 
   ?>
</td>

Thanks

Comments

michelle’s picture

Component: Theming » Styles
Status: Active » Postponed

I can't help with this until the new alphas are out because of the massive theme changes.

Michelle

dbirider’s picture

Version: 5.x-1.0-alpha10 » 5.x-1.0-rc2
Status: Postponed » Active

Hey Michelle,

I see that you were able to take care of #1 as part of the module :)! #2 isn't an issue for me, so we can leave that one alone.

I'm still interested in #3 though, if you can help. How can print the topic authors name below the topic title and have it link to their profile? Using 'print $topic->name' only prints the authors name in plain text.

Thanks,

michelle’s picture

This isn't something I know off the top of my head. It's been a long time since I really worked with those templates. I'm going to be doing some heavy customization of this for my own site and will likely be able to answer you then. Not sure when that will be. If you can't wait, I suggest using http://us2.php.net/get_defined_vars to see what variables are all available to the template.

Michelle

weimeng’s picture

Aha! I was searching through the issue queue looking for which variable to print the topic creator name. You provided the missing piece to the puzzle I needed. :D

Anyway, this works for me in D6, hope it works for you in D5:

<?php
  print l("$topic->name","user/$topic->uid");
?>
michelle’s picture

Sorry, I've not gotten anywhere on my own site so still hadn't looked this up. If the UID is available as Matafleur says, then what you would want is:

$account = user_load(array('uid' => $topic->uid));
print theme('username', $account);

Not tested... May have typos and it may be user_name but I'm fairly sure it's username. Doing this way ensures that anything that overrides theme_username will work.

If that works for the OP, please mark this fixed. And sorry for it taking forever. I should have just gone in and looked it up instead of waiting until I got that far on my own site, which is likely sitll months off.

Michelle

michelle’s picture

Status: Active » Fixed

Left it open a month and no more comment. Going to assume the issue is resolved.

Michelle

Status: Fixed » Closed (fixed)

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

mr.j’s picture

I know this is really old but for anyone else searching for the answer to #2 like we were, here is the solution:

change
print $topic->last_reply

to
print trim($topic->last_reply) == 'n/a' ? $topic->created : $topic->last_reply;

in advf-forum-topic-list.tpl.php

This prints the author and created time instead of n/a when there have been no replies made to a topic.