AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Refer to the latest unread post without redirection

9 Posts
3 Users
1 Reactions
3,102 Views
Posts: 9
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@mouette)
Active Member
Joined: 5 years ago
[#16705]
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?


8 Replies
Robert
Posts: 10747
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 3 months 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');

 


7 Replies
(@mouette)
Joined: 5 years ago

Active Member
Posts: 9
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@robert thank a lot for your answer!!

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


(@mouette)
Joined: 5 years ago

Active Member
Posts: 9
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

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

Any idea please?


Robert
Admin
(@robert)
Joined: 3 months ago

Support Team
Posts: 10747
Robert
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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.


 Bono
(@bono)
Joined: 5 years ago

Active Member
Posts: 10
Robert
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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)
Joined: 5 years ago

Active Member
Posts: 9
Robert
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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
Admin
(@robert)
Joined: 3 months ago

Support Team
Posts: 10747
Robert
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@bono,

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


 Bono
(@bono)
Joined: 5 years ago

Active Member
Posts: 10
Robert
Robert
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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);
    }
    ifscroll_to !== undefined && scroll_to.length ){
        $('html, body').scrollTop(scroll_to.offset().top - 25);
    }

Share: