Advertisement:

Author Topic: Modify “View the most recent posts on the forum” on Board Index page  (Read 533 times)

Offline Dave En Velo

  • Semi-Newbie
  • *
  • Posts: 23
This is the clickable option near the bottom of the home page for most SMF forums.  As far as I can see the hard-coded defaults are a maximum of 100 messages paginated at 10/page.  I understand that the maximum has been chosen for performance reasons, I don’t know the rationale for the pagination.

What I want to do is to alter the values of 100 and 10 to values of my choice.  I appreciate that there may be performance issues, but I would like to make those trade-offs myself.  In many cases I would trade performance against functionality.

In my use of SMF the ability to see more than 100 recent posts is a prime requirement.

I am running a vanilla version of 2.0.15

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Modify “View the most recent posts on the forum” on Board Index page
« Reply #1 on: November 12, 2019, 03:15:21 PM »
How many posts do you have? Recent posts is, surprisingly, one of the more expensive features of SMF that cannot be optimised for various reasons, it is capped at 10/100 for reasons of avoiding overloading your server.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Dave En Velo

  • Semi-Newbie
  • *
  • Posts: 23
Re: Modify “View the most recent posts on the forum” on Board Index page
« Reply #2 on: November 12, 2019, 04:12:47 PM »
To answer the question posed.  I would expect the number of Recent Posts to be several hundred.

The way my forum works is that users work together to solve problems and interact using the Board/Topic/Post capabilities of SMF.  The forum has bursts of activity when users need to be on top of all the activity that is going on.  If a user is offline for a few days they can easily fall behind. What they need is a catch up mechanism where they can see all the recent posts.  Something like RSS would do the job I want but I do not see that as an SMF option. 

Mine is not a typical use of SMF.  My number of users and their activity will be a fraction of most SMF implementations and the performance considerations entirely different.

So I must assume that I am trying to bend SMF too far from its original concept.  It is a pity I do not have the skills to get into SMF and remove the hopefully minor code set that is stopping SMF doing what I want.  I have looked at Recent.php but there is nothing obvious and I suspect there may also be database settings to be considered.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Modify “View the most recent posts on the forum” on Board Index page
« Reply #3 on: November 12, 2019, 04:26:07 PM »
We would normally expect users to use the 'unread posts' for them to catch up if they so wish, rather than recent posts, which will group together by topic for all the topics they haven't seen. Or they can use the 'unread replies' to find topics that they have replied to, and have since updated.

Also, RSS has been a core feature forever, it may be disabled but can be enabled - search in the admin area for 'RSS'. As you can see, it's in the footer here...

You could even explain your use case and we may be able to guide you on how to get there better than you might assume are the only possible options - I refuse to believe that the *only* and *best* way for people to keep up with a forum board is in this manner, because that would imply that you have a use case that goes against every single forum concept I've ever seen, and as a former developer of SMF, I've seen some pretty ridiculous implementations over the years.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Dave En Velo

  • Semi-Newbie
  • *
  • Posts: 23
Re: Modify “View the most recent posts on the forum” on Board Index page
« Reply #4 on: November 13, 2019, 06:52:09 AM »
Arantor, thanks for your patience on this issue.  Let's close it out now.  I am just coming up to a period of intense use of SMF and I will put your suggestions to my users.  It could well be that I am being a little to obsessive about unlimited recent posts.

I did try the RSS route last year and the presentation format was not ideal but the main issue was in the area of security.  My forum is closed and SMF is attractive in that security is good.  However, I found that when I implemented RSS in SMF I could not protect the RSS stream as well as the rest of the forum.

Once again thanks for your time.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Modify “View the most recent posts on the forum” on Board Index page
« Reply #5 on: November 13, 2019, 08:12:16 AM »
Um, RSS follows the rules of the forum, try visiting it if you are not logged in, where it only shows posts for public boards. If you have to be logged in to see the forum, RSS will be empty. If you go to RSS while logged in as admin, you get everything in it.

Presentation in RSS is intentionally sparse; it’s not meant to be read directly, it’s meant to be fed into a tool that consumes it and does the tracking of read status and things like that.
No good deed goes unpunished
All helpful urges should be circumvented

Offline Dave En Velo

  • Semi-Newbie
  • *
  • Posts: 23
Re: Modify “View the most recent posts on the forum” on Board Index page
« Reply #6 on: January 19, 2020, 08:13:40 AM »
Just an update on my recent use of SMF. 

My users decided they wanted something that showed all the posts on the forum starting with the most recent.  As discussed earlier, there is a restriction in SMF to limit View the most recent posts on the forum to 100.  This restriction is for performance reasons.   
My forum is tiny and is used by a small closed group to exchange information over a short period, so the total posts will be in the low 1,000s at most.  This is not the normal use case for SMF.  I have found that by modifying Recent.php I can adjust the 100 limit to 1,000s and effectively remove it.  So far performance is acceptable.  Below are details of the changes I made to 2.0.15.  Note my testing has been minimal, as is my understanding of php, so there may be unintended consequences.  Also I had hoped to change the pagination from 10 to 50 but this was beyond my limited php skills.
  • Find 95 limit and remove
  • Find 100 limit in 4 places and increase to 5000

Offline Dave En Velo

  • Semi-Newbie
  • *
  • Posts: 23
Another brief update.  I have managed to increase the pagination from 10 to a value of my choosing.  By a process of trial and error I have identified which values of 10 in Recent.php need to be changed.
  • replace the 5 values of "10," with "nn,"
  • replace the third value of " 10)" with " nn)"
where nn is the new pagination value.  Note this is for SMF 2.0.15.

Performance in my very small forum is blazingly fast.