Link to latest post in 'Last post' in forums table

Gurpartap Singh - May 26, 2007 - 15:52
Project:Drupal
Version:7.x-dev
Component:forum.module
Category:feature request
Priority:normal
Assigned:Gurpartap Singh
Status:patch (code needs work)
Description

Currently on the forums listing page, in the Last post column, it displays time ago and username, but it would be lots handy for the user to see the linked title.

Something like this(node title is trimmed):

This is node title...
2 hours ago
by Admin

Couldn't prepare a working patch; http://drupal.org/node/144292 needs to gets in.

#1

Gurpartap Singh - June 1, 2007 - 12:30
Title:Forum module: Link to latest post on forum main page» Link to latest post in 'Last post' in forums table

This is a usability feature, users usually see last update in a forum, but Drupal's forum provides no link to the latest post, making the user go into the forum and look at them. Most of the time it's just easier for the user to directly goto the latest post in any forum.

Patch is simple, but can be improved?

AttachmentSize
drupal6-feature_forum_latest_post.patch3.48 KB

#2

Gurpartap Singh - June 1, 2007 - 12:30

Here's a screen shot.

AttachmentSize
Forums | Drupal_1180700686481.png13.33 KB

#3

ChrisKennedy - June 1, 2007 - 12:34

This is a tricky situation, as it falls into the same problems as #new links don't work across multiple pages. We probably don't want to propagate that bug into a second interface area.

#4

Gurpartap Singh - June 1, 2007 - 13:46
Status:active» patch (code needs review)

#5

Gurpartap Singh - June 1, 2007 - 13:47

Well, currently we are not linking to latest comment, but the node with latest comment. Btw, already working on that thing.

#6

Gurpartap Singh - June 1, 2007 - 14:18

Ok this has the requested feature. Please review that part, if it looks good, maybe it can be put into comment.module as a function(which returns an array -- the third argument for l()) and use wherever necessary.

AttachmentSize
drupal6-feature_forum_latest_post_0.patch4.16 KB

#7

Gurpartap Singh - June 1, 2007 - 15:14
Status:patch (code needs review)» patch (code needs work)

Page thing needs work.

#8

Gurpartap Singh - June 1, 2007 - 16:32
Status:patch (code needs work)» patch (code needs review)

It seems way to complex requiring lots of code, which should probably be going into comment.module at this issue http://drupal.org/node/6162

So untill that is fixed, we can have link to the node itself, at least.

AttachmentSize
drupal6-feature_forum_latest_post_1.patch3.48 KB

#9

Gurpartap Singh - June 14, 2007 - 01:59

Re-roll. It's a little bit of code to review..

AttachmentSize
drupal6-feature_forum_latest_post_2.patch3.51 KB

#10

webchick - June 16, 2007 - 05:39

This looks like a great usability improvement!

But IMO this code is kind of weird....

<?php
+function _forum_format($topic, $show_title = FALSE) {
   if (
$topic && !empty($topic->timestamp)) {
-    return
t('@time ago<br />by !author', array('@time' => format_interval(time() - $topic->timestamp), '!author' => theme('username', $topic)));
+    if (!
$show_title) {
+      return
t('@time ago<br />by !author', array('@time' => format_interval(time() - $topic->timestamp), '!author' => theme('username', $topic)));
+    }
+    else {
+      return
t('!title<br />@time ago<br />by !author', array('!title' => l(truncate_utf8($topic->node_title, 25, TRUE, TRUE), "node/$topic->nid"),'@time' => format_interval(time() - $topic->timestamp), '!author' => theme('username', $topic)));
+    }
?>

What you're doing is passing in display parameters (and hard-coding HTML) in an API function. What I would recommend doing instead is changing this to a theme function, with core only providing the "show_title" way, and if people want to override that, they can do so in their themes.

Also, +1 to linking to #new. I know #new has problems on pagers, but when that bug finally gets sorted out, we can just fix it in both places, imo. Linking to the node without jumping to the new comment on the 90%+ forum posts that *don't* have multiple pages is a usability detriment, because people might not realize there are new replies unless they're observing closely.

#11

webchick - June 16, 2007 - 05:41

Also, why n.title AS node_title ? title is fine. It's more consistent with how this is called elsewhere, and $thread->title is descriptive enough.

#12

Gurpartap Singh - June 21, 2007 - 05:33

What I would recommend doing instead is changing this to a theme function, with core only providing the "show_title" way, and if people want to override that, they can do so in their themes.

_forum_format() is a helper function for theme functions in the module. And we want to display titles only on forum's listing. Not on node listing inside a particular forum. So that function is called for both of those listings, and we are setting the argument to send title to true only in one of them(i.e. forum listing page say ?q=forum).

Other than theme function, is there any other suggested/alternate way?

#13

Gurpartap Singh - July 6, 2007 - 05:46

Bump

#14

Gurpartap Singh - July 10, 2007 - 18:13

Re-roll.

AttachmentSize
drupal6-feature_forum_latest_post_3.patch3.46 KB

#15

Gurpartap Singh - July 25, 2007 - 16:16

This time for new forum template files.

AttachmentSize
drupal6-feature_forum_latest_post_4.patch4.67 KB

#16

merlinofchaos - August 2, 2007 - 20:42

I think this needs another reroll.

#17

Gurpartap Singh - August 25, 2007 - 05:44

Re-roll.

AttachmentSize
drupal6-feature_forum_latest_post_5.patch4.45 KB

#18

catch - September 3, 2007 - 10:05
Status:patch (code needs review)» patch (code needs work)

So 6162 is fixed, which surely means a re-roll here.
What's the chances of this making it in as a usability improvement in D6? I guess slim, but won't up to 7.x just yet.

#19

catch - September 8, 2007 - 00:36
Version:6.x-dev» 7.x-dev

#20

webchick - September 8, 2007 - 04:08
Version:7.x-dev» 6.x-dev

I don't see any reason to bump to 7.x. This breaks no APIs, and it a usability enhancement.

#21

denney - October 4, 2007 - 03:27

Can anyone provide a simple patch for the latest 5.x version?

#22

denney - October 4, 2007 - 03:41

Nevermind, patched it myself.

#23

Pancho - February 8, 2008 - 06:51
Version:6.x-dev» 7.x-dev

Moving feature requests to the D7 queue.

#24

Liam McDermott - February 11, 2008 - 13:21

#25

SamRose - May 7, 2008 - 01:51

@denny (or anyone, really) how exactly were you able to apply this patch to 5.x? 5.x seems to be rejecting everything for me when I try to apply?

#26

Gurpartap Singh - May 11, 2008 - 17:44
Status:patch (code needs work)» patch (code needs review)

Is this approach worth committing? If there's any other, please point direct way to implement :)

AttachmentSize
drupal6-feature_forum_latest_post.patch5.07 KB

#27

zeta ζ - May 11, 2008 - 18:49

This is my modification of the patched template file;- a little less? complex, and easier to theme.

AttachmentSize
template.patch634 bytes

#28

catch - June 23, 2008 - 16:02

This still doesn't deal with the pagin issue (per node/6162). - also this is now in advanced_forum (although there's performance issues with the current implementation) http://drupal.org/node/268273

#29

catch - June 23, 2008 - 16:09
Status:patch (code needs review)» patch (code needs work)

#30

Psicomante - August 29, 2008 - 18:34

What do you think of phpbb style?

AttachmentSize
phpbb_forum_last_thread.jpg2.51 KB

#31

Michelle - September 14, 2008 - 22:05

re: #28: The performance issues have now been taken care of. Still might be worth getting this into core, though, as I override a big chunk of core to get it working.

Michelle

 
 

Drupal is a registered trademark of Dries Buytaert.