Advanced Forum: Forum Topic List Customizations
Hi folks. I am working with Advanced Forum on Drupal 5.7, a really great module, BTW.
I've easily figured out how to adjust the advf-forum-list.tpl.php page to make "Topics" and "Posts" into clickable links to the topic list page
Now, on the topic list page, I'd like to make both the icon and "replies" link to their respective topic in advf-forum-topic-list.tpl.php
Currently, I've tried the following in advf-forum-topic-list.tpl.php (code without beginning comments):
<?php print $pager; ?>
<table id="forum-topic-<?php print $topic_id; ?>">
<thead><tr><?php print $header; ?></tr>
</thead>
<tbody>
<?php foreach ($topics as $topic): ?>
<?php
if ($topic->sticky) {
$stickyclass = 'stickytopic';
$wassticky = TRUE;
$topic->title = '<em>' . t('Sticky') . ':</em> ' . $topic->title;
} else {
if ($wassticky) {
$stickyclass = 'firstnotsticky notsticky';
$wassticky = FALSE;
} else {
$stickyclass = 'notsticky';
}
}
?>
<tr class="<?php print $topic->zebra;?> <?php print $stickyclass;?>">
<td class="icon"><a href="<?php $topic->title; ?>"><?php print $topic->icon; ?> </a> </td>
<td class="title">
<?php
print $topic->title;
if (!empty($topic->pager)) {
print '<div class="forum-topic-pager">' .$topic->pager . '</div>';
}
?></td>
<?php if ($topic->moved): ?>
<td colspan="3">
<?php print $topic->message; ?>
</td>
<?php else: ?>
<td class="replies">
<a href="<?php $topic->title; ?>"><?php print $topic->num_comments; ?></a>
<?php if ($topic->new_replies): ?>
(<a href="<?php print $topic->new_url; ?>"><?php print $topic->new_text; ?></a>)
<?php endif; ?>
</td>
<td class="created"><?php print $topic->created; ?>
<td class="last-reply"><?php print $topic->last_reply; ?>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php print $pager; ?>Basically the parts I modified were:
<td class="icon"><a href="<?php $topic->title; ?>"><?php print $topic->icon; ?> </a> </td>and
<a href="<?php $topic->title; ?>"><?php print $topic->num_comments; ?></a>Hoping to turn those items into clickable links.
I'd also like to add a link in advf-forum-topic-list.tpl.php under "Last Reply" to take a user to the last reply/comment for that topic.
Finally, on advf-forum-topic-list.tpl.php I would like to be able to include the data for "$forum->description" from advf-forum-list.tpl.php to advf-forum-topic-list.tpl.php
Looking for some advice on how to accomplish these in Drupal 5 (and Drupal 6 eventually), and pledge to rework into a wiki page here that can be included in documentation. Thanks!!!!!

