-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting posts to rewind post counter #8
Comments
This should be optional |
Wouldn't this be not-to-difficult to implement? If I were to implement it, it compromise of:
In the case that multiple posts were deleted, you could probably implement this recursively fn fixPostID(postID) {
num = postID;
if (!postExists(postID - 1)) {
fixPostID(--postID);
}
return;
} |
Would this be an efficient implementation? <?php
function fixPostID($id) {
$previousExists = query("EXISTS (SELECT * FROM posts WHERE id = ($id - 1))");
if (!$previousExists) {
return fixPostID(--$id);
}
return $id;
}
?> |
I just realized that it looks like the mod_rss.tmp file stores the post number for the next post. Perhaps on each delete we can decrement that number? What do y'all think about that idea? I may give it a try this weekend and see if it works depending on how much free time I have |
I don't know much, but would that work if a new post is made before the deletion? This shouldn't happen:
|
Currently, each post increase the post counter, even if they are deleted and no posts are made after that
To explain with an example, if post no. 10 is registered but deleted before a post no.11 is made, the next post wouldn't replace post no.10 (as I would like it to) but continue from post no. 11. This wasn't always the case with Kokonotsuba
It would be better if it was rewinding the counter back when posts are deleted without any new is made. Heyuri especially has a severe issue of spammers who try to steal GETs, we could save them if we could count back post numbers too.
The text was updated successfully, but these errors were encountered: