|
||||||
Views:
12,234,705 |
![]() ![]() |
04-02-25 09:43 AM |
||||
Guest: Register | Login |
Main - Posts by |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 702/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Turns out that the method used by AB2.5 yields wrong results (one year off) if the user is old enough.
'Old enough' is typically 100 years or more so it doesn't really matter, though. I came up with a different method for calculating the member's age. It works fine for all ages, and as a bonus, it doesn't have the requirement of the code that is implemented currently.
This assumes that the user birthday is stored as 'MM-DD-YYYY' or 'MM-DD' when the year is omitted. ____________________ Kuribo64 - melonDS want some revolution in your coffee? |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 703/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 706/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 707/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 708/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 709/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 713/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Pagination in Acmlmboard is done with the typical 'LIMIT X,Y' statement. There's an issue with that and long threads, though.
Let's say the user requests page 200 of a thread. His posts per page setting is 20. Your query will look like this: SELECT (tons of shit) FROM posts p LEFT JOIN (several other tables) WHERE t.id=1337 LIMIT 4000,20 Which basically means that MySQL will fetch 4020 rows and discard most of them. I coded a simple solution to reduce that overhead.
This retrieves the IDs of the posts that are going to be visible. It still has the aforementioned problem, but MySQL will read from the posts table's primary index (as opposed to reading from multiple tables), so it's much less severe. Once you got the result of that, you feed it to the query that fetches all the remaining data. SELECT (tons of shit) FROM posts p LEFT JOIN (several other tables) WHERE p.id IN ($result) Another solution would consist into giving posts per-thread incrementing numbers, and base pagination on that. But this has its number of problems, especially if you find yourself wanting to merge/split threads or delete a spammer's posts. And it only works for displaying a regular thread. ____________________ Kuribo64 - melonDS want some revolution in your coffee? |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 714/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
:3
Had that dream a while ago about me going in vacation somewhere with my parents for Summer. There was a conflict because my sister wasn't there, and we thought she wasn't coming with us (that's what actually happened last Summer). But at the time of leaving home, she came back home and she was willing to come with us. Then there was that pier platform thing I was on, that was covered in sand, like some weird artificial beach. There was a radio station talking about how hot climate was and supposedly it was caused by global warming, but actually it was cold. So much even that it snowed a little. Didn't seem that off to me despite happening in July. Wee dream logic. Then we were in our backyard, and for some reason it was flooded. We were bathing as if it was the sea. ____________________ Kuribo64 - melonDS want some revolution in your coffee? |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 715/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 716/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Instant redirects wouldn't have this issue at all ![]() Other than that, I suspect that sprites are added to the page somewhere in pageheader(), before the current page has the time to signal that it's a redirect page. You'd need to add a flag to pageheader() or somewhere else before that. ____________________ Kuribo64 - melonDS want some revolution in your coffee? |
Arisotura |
| ||
Developer
pancakes Level: 84 ![]() ![]() ![]() ![]() Posts: 719/1870 EXP: 5623322 Next: 38630 Since: 01-05-12 From: France Last post: 169 days Last view: 169 days |
Main - Posts by |
Acmlmboard v2.5.6 (06/11/2024) © 2005-2025 Acmlm, Emuz, et al. |
MySQL - queries: 129, rows: 485/515, time: 1.584 seconds. |