We currently get the "next" and "previous" topics of a forum topic by means of a rather expensive query (3rd most expensive in accumulated drupal.org stats). I think it would make sense to store this structure in a table so you don't need to run this expensive query. Merlin pointed out, that the result of the query is dependent on the forum_order variable. I don't think this is a problem, we only need to re-create the table if that variable is set to another value.

the table could have the following structure:

tid | nid1 | nid 2

tid is neccessary because a node can be in more than one forum.

nid1 would be the next topic of nid2, to get both next and previous topic we'd need to join the table on itself. As an alternative we could store both previous and next topic directly.

Comments

moshe weitzman’s picture

maybe ... i would just as soon get rid of those links. i don't think they are used much in practice.

killes@www.drop.org’s picture

I wouldn't mind to remove it, but then the people who want Drupal's forums to be more "like other forums" will complain bitterly. Then again, they could probably put it into their "make drupal forums like other forums".module.

sime’s picture

+1 to remove. I have actually tried to using the previous/next on forum topics, but it really is counter-intuitive when the subject matter can vary so much.

michelle’s picture

+1 on getting rid of them from me also. That's the first thing I thought of when I read this issue when it was posted but I wasn't brave enough to be first to say it. LOL. I find those links more annoying than anything. I keep thinking they're somehow related to the post I'm reading (like a more info link section) and have to remind myself what they actually are.

Michelle

pwolanin’s picture

I think killes' move towards caching this information might be a better approach: http://drupal.org/node/72617

especially when combined with moving the generating functions out of the theme function. I think to insure some efficiency (such as the suggested caching) with this ordering it should remain part of core, especially since it's easy to remove at the theme level.

I thought about this before (http://drupal.org/node/70578) and while it was also my initial reflex I don't think having the ordering in a table is necesarily a good idea, since the table will have to be written frequently.

liam mcdermott’s picture

Version: x.y.z » 7.x-dev
Gurpartap Singh’s picture

+1 to remove topic navigation links from forum posts. It's also a obstacle when you are making your forum look more like phpBB or vBulletin. I'm sure I never used those links.

minesota’s picture

Please keep it. Many people need it. And they may not be knowing even if this is
silently removed.

michelle’s picture

@minesota - If they don't notice it's gone, then they must not need it too badly. People can always add it in if they need it. And, yes, the reverse is also true but, as killes pointed out, it's an expensive query. So it makes more sense for people to add it if they really want it.

Michelle

minesota’s picture

@Michelle - many people will not be going to see this discussion, and then they will clamor for it.
And I guess killes is suggesting a way to keep it yet minimizing "expensiveness" of the query.
+1 to keep those links.

Gurpartap Singh’s picture

Change the topic of this issue with the currect debate?

Flying Drupalist’s picture

I agree with removing. Is there someway to remove the links in a theme without having to wait for D7? I've display to none, but that just feels very wasteful.

michelle’s picture

Title: Make topic ordering more sensible » Drop next/prev topic links or change the query to a dedicated table

@Miraploy - This is how it's done in advanced forum:

function advanced_forum_theme_registry_alter(&$theme_registry) {
  // Kill the next/previous forum topic navigation links.
  foreach ($theme_registry['forum_topic_navigation']['preprocess functions'] as $key => $value) {
    if ($value = 'template_preprocess_forum_topic_navigation') {
      unset($theme_registry['forum_topic_navigation']['preprocess functions'][$key]);
    }
  }
}

@Gurpartap - Changed title

@minesota - As I said, it can always be added back. Changing it to a less expensive process would work as well if someone is willing to roll the patch for it.

Michelle

Flying Drupalist’s picture

Michelle, would you adapt that for vanilla forum please?

michelle’s picture

@Miraploy - I haven't used Vanilla and know nothing about how it handles this sort of thing.

Michelle

moshe weitzman’s picture

Noone who wants to save the links has proposed a solution to generate them in an efficient manner. @pwolanin linked to an ancient, dead issue about caching. thats not so practical IMO. Out they go, for now. They can come back when someone implements them with acceptable performance. Right now, they are a stain on Drupal's credibility.

jody lynn’s picture

Status: Active » Closed (fixed)