This adds page links to the list of forum topics, much like phpBB and other popular software.

Example:

Before: "This thread rules!!!!"
After: "This thread rules!!!! [ 1, 2, 3, 4]"

Where 1, 2, 3, 4 are links to those pages in the topic.

Benefits:

  • Users of popular forums have less clicking to do.
  • Saves a few page loads, especially if tracker disabled.

Drawbacks:

  • Had to impliment my own pager for this.
  • Should be tested further.

Note: this version will NOT WORK with 4.6.

Comments

MrEricSir’s picture

Title: Topic pagination in forum view (with patch!) » working patch
StatusFileSize
new2.04 KB

Oops!

That's an anti-patch... or something.

The corrected version is attached to THIS post.

MrEricSir’s picture

Title: working patch » Forum.module topic list pagination

For a 4.6 version of this patch, see this thread:

http://drupal.org/node/44876

MrEricSir’s picture

Title: Forum.module topic list pagination » Patch: Forum.module - page links in topic list
StatusFileSize
new3.27 KB

New in this version of patch:

  • Optimization: Never displays more than four links
  • Style: Page flicker looks more like other forum software

Has anyone else tested this patch?

MrEricSir’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.96 KB

This version of the patch should work easily with the forum.module cvs. It's been cleaned up a little and afaik complies fully with the Drupal coding standards.

I guess the code could be made cleaner, but I've tested it thoroughly as-is and don't want to upset the delicate balance of the force. I doubt it could be made significantly more efficient anyway.

chx’s picture

Status: Reviewed & tested by the community » Needs work

thanks for the hard work, but you should let others review your patch before setting ready to commit.

Also... Drupal already have a pager system. I doubt this patch will accepted as it's essentially code doubling.

MrEricSir’s picture

You're probably right that it needs review.

But as far as I can tell there's no way to create a pager using existing functions without calling pager_query().

Maybe I'm wrong, but calling pager_query() for each topic seems excessively database intensive. That's why I felt the need for a custom pager.

chx’s picture

You are right in that currently there is other way but then you should extend pager.inc so that it can? You only need a function which would initialize some vars.

MrEricSir’s picture

Cool, I'll look into it.

Do you have any recomendations on how this should be done?

MrEricSir’s picture

Okay, I looked into it myself. Sadly this cannot be done using the existing theme_pager_link(). I'll have to modify it to accept a new parameter.

The offending line is this one:
return l($text, $_GET['q'], array(), count($query) ? implode('&', $query) : NULL);

I could just set $_GET['q'] = "node/$topic->nid"; but that would break other pagers, and it's a lousy hack in the first place.

MrEricSir’s picture

Wait... so if I change a theme fuction, wouldn't that break all existing themes?

Maybe my dirty hack was a better idea...

MrEricSir’s picture

Title: Patch: Forum.module - page links in topic list » Forum.module: topic page links
StatusFileSize
new2.22 KB

I discovered a workaround, and after some testing got it running. I'm not sure how "legal" something like this is:
$_GET['q'] = "node/$topic->nid";

This is due to the following line in theme_pager_link():
return l($text, $_GET['q'], $attributes, count($query) ? implode('&', $query) : NULL);

So to change the link, I either have to set $_GET['q'] or modify ALL the pager theme functions! Another possibility is to add some kind of global variable containing the link that only theme_pager_link() would use.

Any comments on the perferred way to implement this functionality?

chx’s picture

looks good to my eyes -- but Dries may think otherwise. However, I would $on_page = $_GET['q']; // store current url just above the $_GET['q'] statement.

Jaza’s picture

Version: x.y.z » 6.x-dev

Moving to 6.x-dev queue.

catch’s picture

Version: 6.x-dev » 7.x-dev

We've done some template hacks to get this into forum listings (and hacked views.module slightly to get the same on the tracker). Will try to post up some of that code later if it takes a different approach. For drupal 7 though.

Gurpartap Singh’s picture

Title: Forum.module: topic page links » Forum: Pager links in Forum topics list
Assigned: Unassigned » Gurpartap Singh
Status: Needs work » Needs review
StatusFileSize
new4.78 KB
new64.7 KB

Screenshot is attached to this comment. Ignore the date created thingy.. that's going into another issue.

If this gets good reviews and code improvement suggestions, I'll be taking up with more forum UI issues!!

Gurpartap Singh’s picture

StatusFileSize
new4.81 KB

This time without tabs.

dmitrig01’s picture

"+ //print '<pre>'; print_r($items); print '</pre>';"

Uh

Gurpartap Singh’s picture

StatusFileSize
new5.07 KB

I'm wondering why drupal_add_css() for forum.css in forum_init() is not adding forum.css........... In the patch I re call drupal_add_css for that. Is that a bug or I'm missing something?

Gurpartap Singh’s picture

bump

Gurpartap Singh’s picture

Hope this still applies..

michelle’s picture

Huh... Never knew this issue was here. I do this in advforum. Will take a look at this when I have a chance to see which method is better :)

Michelle

Gurpartap Singh’s picture

Nor did I ever know it was there(in advanced forums). Hehehehe.

v8powerage’s picture

StatusFileSize
new48.6 KB

I've noticed bug in this patch, after nearly year of using, because before I haven't got such a long topics.

When navigate to a second page of topic listings, all thread pagers also showing 2 page active, it's true for next pages as well of course.

Screenshot as an attachment.

catch’s picture

Status: Needs review » Needs work

Looks like it needs work.

ton_cut345’s picture

Version: 7.x-dev » 6.x-dev

how about for drupal 6???

michelle’s picture

Version: 6.x-dev » 7.x-dev

D6 is feature frozen and this isn't a bug so it won't get backported.

Michelle

mitchell’s picture

Status: Needs work » Closed (duplicate)
Gurpartap Singh’s picture

Status: Closed (duplicate) » Needs work

Views isn't in core *yet*.

jody lynn’s picture

Version: 7.x-dev » 8.x-dev

This should be using theme_pager..

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Needs work » Postponed

Forum is approved for removal. See #1898812: [policy] Deprecate forum module for removal in Drupal 11

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

It will be moved to the contributed extension once the Drupal 11 branch is open.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Project: Drupal core » Forum
Version: 11.x-dev » 1.0.1
Component: forum.module » Code
Status: Postponed » Needs work
larowlan’s picture

Version: 1.0.1 » 2.x-dev
Assigned: Gurpartap Singh » Unassigned