#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
How-to and Troubles...
Refer to the latest...
 
Share:
Share
Tweet
Share
Notifications
Clear all

Script [Solved] Refer to the latest unread post without redirection

    Last Post
RSS

mouette
Posts: 9
 mouette
Topic starter
May 11, 2021 8:36 am
(@mouette)
Active Member
Joined: 1 year ago
Posted by: @robert

And don't care about the page ID. It doesn't need page ID, it'll redirect and open correct post in correct page with post-id only. Just make sure the red marked options are enabled and try to click the links of topics. You'll see that all works fine, and it goes to correct post with the correct page (even if the page number doesn't exist in the URL).

Hi, 

I see that the redirection of the page is the native functionality to go to the last unread post.

Unfortunately, this redirection can be really slow sometimes, users are really not satisfied with this feature, and I understand them.

Is there an evolution planned on this point so that the link goes directly to the right page of a topic?

It is not possible to calculate from the recent.php page where the post will be located according to the number of posts per page and the date of the post?

Topic Tags
jump to first unread unread posts
8 Replies
Robert
Posts: 9091
Robert - Twitter
 Robert
Admin
May 11, 2021 1:00 pm
(@robert)
Support Team
Joined: 6 years ago

The redirection only works if the topic has more than one pages of replies. However, you can switch to the direct link generation with this hook code. Put it in the functions.php file of your current active WordPress theme or install the Code Snippets plugin and insert the code as a new code snippet. Then go to Dashboard > Forums > Dashboard admin page and click the [Delete all caches] button.

add_filter('wpforo_build_direct_unread_post_url', '__return_true');

 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

7 Replies
mouette
 mouette
(@mouette)
Joined: 1 year ago

Active Member
Posts: 9
May 12, 2021 7:47 pm
Reply toRobertRobert

@robert thank a lot for your answer!!

Honestly I don't understand why this is not by default in the forum???

mouette
 mouette
(@mouette)
Joined: 1 year ago

Active Member
Posts: 9
May 17, 2021 7:30 am
Reply toRobertRobert

@robert  bad news, it seems that this solution doesn't work with IOS 

Any idea please?

Robert
 Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9091
Robert - Twitter
May 20, 2021 5:29 pm
Reply tomouettemouette
Robert

@mouette,

The solution is not depended on OS, that has zero relation to your iOS.

So I don't have other advice here. If it works then it should work on all OS's, just make sure your login status is the same, and you don't have cache. This is all.

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Bono
 Bono
(@bono)
Joined: 1 year ago

Active Member
Posts: 10
June 10, 2021 4:12 pm
Reply toRobertRobert
mouette
Robert

@robert Hello

after adding the code in your first reply, we don't have any problem with Chrome (PC and Mobile)

But, we have somes troubles on Firefox and iOs, when a topic is divided in pages, the rediction is on the top of the last page, but not on the last post wanted

Do you have any idea about this trouble ? any other feedbacks ?

Thanksss in advance for your help

mouette
 mouette
(@mouette)
Joined: 1 year ago

Active Member
Posts: 9
June 10, 2021 7:47 pm
Reply toRobertRobert
mouette
Robert

@robert I think it is an issue link to the navigator, not to the OS

The issue is there with Opera too.

Since there is a redirection from the top of the page to the last unread message, I think there is an issue with a JS function which is not available for some browser, don't you?

Robert
 Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9091
Robert - Twitter
June 11, 2021 5:21 am
Reply toRobertRobert
mouette
Robert

@bono,

I'd look at this issue if you provide with some video showing the issue.

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Bono
 Bono
(@bono)
Joined: 1 year ago

Active Member
Posts: 10
June 11, 2021 3:18 pm
Reply toRobertRobert
Robert
mouette
Robert

@robert Thanks for your answer, We found and fixed the problem

I give you the part of code below in wpf-assets\js\front-end.js :

The first line in bold, the fix (with just before the code in comments which was not working), and the second one in bold the code which was not reached

 

$wpf(document).ready(function($) {
    var wpforo_wrap = $('#wpforo-wrap');

    var scroll_to;
    //var exreg = new RegExp('\/' + wpforo.template_slugs['postid'] + '\/(\\d+)\/?$', 'i');
    //var match = location.pathname.match(exreg);
    var match = location.hash.match(/^#post-(\d+)$/);
    if(match){
        scroll_to = $('#post-' + match[1]);
    }else{
        //scroll_to = $("#m_, .wpforo-members-content, .wpforo-search-content", wpforo_wrap);
    }
    if( scroll_to !== undefined && scroll_to.length ){
        $('html, body').scrollTop(scroll_to.offset().top - 25);
    }
Robert liked
  All forum topics
  Previous Topic
Next Topic  
Related Topics
  • Unread topics
    2 months ago
  • Topic links should jump to the first post, not the latest
    7 months ago
  • How does "Unread Posts" work?
    8 months ago
  • Color not changing in new post/reply/unread post
    2 years ago
  • Removing "Unread Posts" link from top of Forum
    3 years ago
Topic Tags:  jump to first unread (4), unread posts (12),

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages wpforo-advanced-attachments-128x128 wpforo-embeds-128x128 wpForo User Custom Fields addon wpForo – Blog Cross Posting addon wpForo Ads Manager wpForo – WooCommerce Memberships Integration wpForo Emoticons wpForo – Tenor GIFs Integration
View all Addons »

Recent Topics

  • Why doesn't Google index pages?

    By Onurkansan, 5 hours ago

  • Attachments not showing on forums posts after migration

    By Formicid, 2 days ago

  • New Feature About Plugin Customization and Integration

    By z14165899, 3 days ago

  • WordPress Email sending function wp_mail() doesn't work!

    By feassistant, 3 days ago

  • Import users from IPBoard

    By jesusdlg, 4 days ago

  • Intruder signing in to wpforo without approval

    By plaurits, 4 days ago

Topic Tags

  • css52
  • translation50
  • plugin conflict48
  • seo47
  • new features45
  • buddypress43
  • avatar41
  • moderation40
  • ultimate member40
  • login40
  • forum40
  • registration37
  • threaded layout35
  • cache34
  • spam33
  • editor33
  • menu33
  • shortcode32
  • forum accesses30
  • widget29
View all tags (2195)

Recent Posts

  • RE:

    By Anonymous, 53 years ago

  • RE: Why doesn't Google index pages?

    I did not use any caching plugin. I canceled the cache ...

    By Onurkansan, 2 hours ago

  • RE: Member Reputation with Likes?

    @mpanichi, in wpForo 2.0 you can set Points for One T...

    By Chris, 1 day ago

  • RE: Hide user roles from Members list

    Hi @mpanichi Edit the needed usergroup and disable/un...

    By Chris, 1 day ago

  • RE: Description for each topic?

    @chris That's really too bad. I was ready to send you ...

    By Christine, 2 days ago

  • RE: There are versions of wpforo functions that return string?

    Amazing 👍

    By Marco Panichi, 2 days ago

  • RE: About Plugin Customization and Integration

    Hi @z14165899, Please send your request to sales[at]g...

    By Chris, 2 days ago

Share:
Share
Tweet
Share
  Forum Statistics
21 Forums
9,943 Topics
50.3 K Posts
3 Online
48.7 K Members

Latest Post: Why doesn't Google index pages? Our newest member: roseannecordell Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2022 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation