News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Modify “View the most recent posts on the forum” on Board Index page

Started by Dave En Velo, November 12, 2019, 03:13:36 PM

Previous topic - Next topic

Dave En Velo

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

Arantor

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.

Dave En Velo

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.

Arantor

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.

Dave En Velo

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.

Arantor

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.

Dave En Velo

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


Dave En Velo

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.

Advertisement: