How to make "hot/interesting" posts?

The second day thinking of how to work the algorithm of interesting news. It is clear that some kind of reversed selection all posts and then ranked. The problem occurs a little further.
For example, after the next ranking we have the following list:
1, 2, 3, 4, 5, 6, 7, 8, 9
To the user these records are given for 4 pieces per page.
A user opens the page and sees:
1, 2, 3, 4
Next, run kronotskoe task and redistributes stranic. That is, after the current ranking is the following list:
1, 5, 6, 4, 3, 2, 7, 8, 9
And when the user navigates to the second page, the server will give him the records he had already seen:
3, 2, 7, 8

How to implement such dynamic tape?
August 19th 19 at 23:44
3 answers
August 19th 19 at 23:46
Link to the second page, something like '?list=ID&page=2'
Where ID is the id of the last list.

For example, on habré score on it...

UPD: so as not to score the address bar and the search engines, it is possible to store this ID in a cookie
August 19th 19 at 23:48
You can do to remove the pagination control and do just that first displays 5 pieces, then when I scrolled the wheel up to the bottom of the page displays the following (without reloading the page), the image as made news in the VC.
mm page and porcelina the results - it's basically one and the same. - Berenice_Fahey73 commented on August 19th 19 at 23:51
: not really... if pagination is happening to you reboot the page (in most cases) and, accordingly, a new DB query for example, which can sort something depending on the controller. And porcelina the results can download from the very beginning and then display as needed... or, more load on the database, nooo... for solve the problem described in the question... =)) - antoinette18 commented on August 19th 19 at 23:54
Either you can leave the pagination control. but to make then reboot content only the Central block without reloading the page... Again, the whole solution of the problem is at the front.

Or are you pulling initially from the database all that is required in the sorting, and then give out portions, no matter how postranecky or parciales supply... Either you have the page reloaded and therefore the mess in the sorting...

Then as if the only two options simple...

Or you can bother, and there is something to do with cookies, sessions, etc. - antoinette18 commented on August 19th 19 at 23:57
: pages and porcelina the results are made in order not to load the extra positions that may not be useful.
You propose to give the user all the posts? Their could be a thousand, if not more. - Berenice_Fahey73 commented on August 20th 19 at 00:00
Hot data need to fold asynchrone (say every hour) to the cache (Radish/tarantula) and give them out. Then the load on the database will be minimal. - darion.Wiegand commented on August 20th 19 at 00:03
August 19th 19 at 23:50
Right these ribbons are constructed depending on the approach.
1. When the ranking is global. In this case, each record has some grade - a calculated field that is recalculated at the event. For example, when someone makes a comment or on every seventh viewing. The logic of the calculation of the grade depends on the resource and content. Well, after rudimentary sorting. If you want, you can exclude viewed articles.
2. When the ranking depends on user preferences. In this case, the user in a background process is the calculation of the rank or tape is constructed on the fly. To create a ribbon on the fly applies a combination of graph and regular bases. Graph can quickly calculate the degree of effects of the preferences and relationships between users.

Find more questions by tags AlgorithmsPHPWeb Development