Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: supernova777 on August 05, 2017, 10:55:07 PM

Title: modifying RECENT posts
Post by: supernova777 on August 05, 2017, 10:55:07 PM
id like to modify my recent posts to show more then 10 posts per scrollable page
as it is - it paginates to 10 pages... with 10 posts per page..
id like to modify it to show MORE recent posts than 100.. over a smaller amount of pages

ie: maybe the most recent 250 post in 5 pages of 50 results each

is this possible?>
Title: Re: modifying RECENT posts
Post by: supernova777 on August 05, 2017, 10:55:45 PM
http://www.oldschooldaw.com/forums/index.php?action=recent;
Title: Re: modifying RECENT posts
Post by: br360 on August 05, 2017, 11:03:44 PM
You can do this by going into Admin>>Configuration>>Current Theme

Scroll down and look for Number of recent posts to display on board index:

Change that number to whatever you want
Title: Re: modifying RECENT posts
Post by: br360 on August 05, 2017, 11:15:55 PM
Actually, I misread what you were trying to accomplish. Take a look at this link instead ;)

https://www.simplemachines.org/community/index.php?topic=250894.msg1627457#msg1627457
Title: Re: modifying RECENT posts
Post by: supernova777 on August 06, 2017, 12:01:57 AM
http://www.oldschooldaw.com/forums/index.php/board,128.0.html

also another question i have is there any way to parse the titles of these for the (198x) string and make them list the titles in order chronologically????
Title: Re: modifying RECENT posts
Post by: supernova777 on August 06, 2017, 10:09:49 AM
i can edit everything fine on the recent.php source file but it doesnt work past 100 posts still
something is stopping it from working
i can change the number of posts displayed per page
but it always stops at 100 results and if i click the page that would start at 100 it just shows the last page before that
ie:
http://www.oldschooldaw.com/forums/index.php?action=recent;start=100
try to click "11" and it will go back to "10" because i cant get it to go past 100 posts...
Title: Re: modifying RECENT posts
Post by: supernova777 on August 06, 2017, 05:02:44 PM
please can someone help me tackle this?
Title: Re: modifying RECENT posts
Post by: Illori on August 06, 2017, 05:04:58 PM
please dont bump within 24 hours, we are all volunteers and we will respond if and when we know the answer.
Title: Re: modifying RECENT posts
Post by: supernova777 on August 06, 2017, 05:31:49 PM
ok but to be clear:
id like to modify my request
i would be happy to keep it at 10 results per page
if i could make the number of pages be higher than 10
ie: the latest 400 posts results paginated
rather than the latest 100 posts results paginated
Title: Re: modifying RECENT posts
Post by: Kindred on August 06, 2017, 06:49:42 PM
I don't think that you understand what you are asking for.

The "recent posts" request is one of the most "expensive" database requests (in terms of server processing power)
This has been PURPOSEFULLY limited to avoid overloading servers... and having people's accounts suspended by hosts for overuse of shared system resources.
Title: Re: modifying RECENT posts
Post by: supernova777 on August 06, 2017, 07:11:12 PM
ok i didnt know that to be honest -- i just wanted to be able to review all the latests posts PAST the lastest 100
so i can view recent activity like one would view an RSS FEED of content
Title: Re: modifying RECENT posts
Post by: supernova777 on August 06, 2017, 07:12:19 PM
even if it was only doubled from 100 to 200 - this would be ideal for me
but (so far) i cant figure out how to change the number of results
im trying to read the code right now

Title: Re: modifying RECENT posts
Post by: supernova777 on August 06, 2017, 08:57:18 PM
cant anyone direct my attention to the statements or line numbers i need to edit to change how many results to fetch??
i cant figure out how its picking only 100 results.. i want to double the results ammount so i can review my latest 200 posts instead of 100 (20 pages of results not 10)
its 1300 lines of code
im trying to take it all in but someone here must know better than i
Title: Re: modifying RECENT posts
Post by: Kindred on August 06, 2017, 09:18:35 PM
It is being limited in the database query itself...  and the change thatbyou want is still not recommended
Title: Re: modifying RECENT posts
Post by: supernova777 on August 06, 2017, 09:43:08 PM
it doesnt seem to be slow on my host at all presently
Title: Re: modifying RECENT posts
Post by: Illori on August 07, 2017, 05:02:56 AM
Quote from: supernova777 on August 06, 2017, 09:43:08 PM
it doesnt seem to be slow on my host at all presently


that does not mean it will not cause issues in the future. also by answering for you will answer for everyone and may lead to issues for others.
Title: Re: modifying RECENT posts
Post by: supernova777 on August 07, 2017, 01:08:00 PM
guys
i appreciate you looking out for me but..
this logically makes no sense?
because the script only requests 10 results per page or whatever
so regardless of whether it lets me request 10 results for 10 pages
or 10 results for 20 pages
theres no change in load except that the user would be able to CHOOSE to view
older content going backwards..

it's still not going to load more then 10 results per page
so i fail to see how this is a danger to server processing

im not blindly arguing to be right here,
if u have a logical point to make to illustrate the
increased load you are saying these changes propose..
please explain? because i fail to understand your reasoning
in determining this outcome

anyway in the end
ive solved my problem by commenting this line out:
/*if (isset($_REQUEST['start']) && $_REQUEST['start'] > 95)
      $_REQUEST['start'] = 95; */

thanks everyone
Title: Re: modifying RECENT posts
Post by: Kindred on August 07, 2017, 04:21:15 PM
no... the script does not make only 10 requests per page.
It requests all 100, then parses them to check if the user has access to see those posts
THEN it paginates and displays...

so, by asking for 200, you have now DOUBLED the load.
Title: Re: modifying RECENT posts
Post by: Arantor on August 07, 2017, 06:30:25 PM
Plus, older content is less likely to be in current server memory, meaning it has to be loaded, and displaces content.
Title: Re: modifying RECENT posts
Post by: supernova777 on December 10, 2018, 09:29:17 AM
Quote from: Kindred on August 07, 2017, 04:21:15 PM
no... the script does not make only 10 requests per page.
It requests all 100, then parses them to check if the user has access to see those posts
THEN it paginates and displays...

so, by asking for 200, you have now DOUBLED the load.

im sorry but theres no way thats how it works.. because i have more then doubled it.. and it continues to work fast with zero delay with me having bumped it from 100 to 6000.. take a look:
http://www.oldschooldaw.com/forums/index.php?action=recent;

its only processing 10 posts at a time. not hundreds or thousands -- otherwise there would be a significant lag or delay between pages.. press left + right arrow keys to jump from page to page left or right. its fast. im sorry but you must be incorrect.
Title: Re: modifying RECENT posts
Post by: Arantor on December 10, 2018, 09:34:09 AM
Actually it is processing all the posts, because it has to verify what exists then tie it to board to verify access.

Once it gets to 10 it can stop, but trust me, this is what it does under the hood. The time increase isn't linear.
Title: Re: modifying RECENT posts
Post by: Kindred on December 10, 2018, 11:51:49 AM
I am not incorrect...   as Arantor explains.

What you have done is NOT recommended.
Title: Re: modifying RECENT posts
Post by: Dave En Velo on December 18, 2018, 10:58:52 AM
Just to offer some support to supernova777.  I have a use case where I would rather trade performance for functionality.  I deploy SMF using a Bitnami image on Google Cloud to a private group of fixed limited numbers.  SMF gives me just what I want, although I would like to increase the View the most recent posts on the forum limit from 100.

So from my perspective a configurable limit (with a recommended value of 100) would be better than the current fixed value, I could even set it lower if I wanted to restrict the performance impact.

I accept that this is a minority requirement and so perhaps not appropriate as a future enhance, especially as supernova777 has described a code change that is not too onerous for the average user.
Title: Re: modifying RECENT posts
Post by: Dave En Velo on December 18, 2018, 11:17:06 AM
A follow-up to my previous Post.  The supernova777 fix would be simple to apply if the name of the script being modified was specified, I cannot figure it out.  Thanks in advance.
Title: Re: modifying RECENT posts
Post by: supernova777 on May 17, 2020, 04:26:12 PM
i did end up figuring out how to do what i wanted it to do.. being able to navigate back to 600+ posts or more
i forget what i did now tho its been over a year lol
Title: Re: modifying RECENT posts
Post by: Dave En Velo on January 24, 2021, 12:10:55 PM
Just in case anyone else is going down this same rabbit hole I did eventually manage to work out the code changes, fairly trivial in the end.  See https://www.simplemachines.org/community/index.php?topic=570484.msg4037323#msg4037323 (https://www.simplemachines.org/community/index.php?topic=570484.msg4037323#msg4037323)
Title: Re: modifying RECENT posts
Post by: Kindred on January 24, 2021, 03:49:18 PM
it is still not something we would recommend.