Quote:
Originally posted by mrogish
It seems as if users can "bump up" threads to the top of the page by making a post and subsequently deleting it. This is bad, since it brings up threads from long ago without any warning. Once they delete it, it should go back to where it once was.
I haven't taken a look at it yet, but I am going to sit down and fix this bug and I was wondering if anyone else has:
a) encountered it
a.1) and fixed it
b) has heard of a fix
c) wants to help me fix it
|
Haven't fixed it but I can give you some theory on it if you want

In the delete post routines, you have to develop a check to see if the post is the last in the thread. This code should do it:
Code:
$thread=$DB_site->query_first("SELECT threadid FROM post WHERE postid='$postid'");
$threadid=$thread[threadid];
$islast=$DB_site->query_first("SELECT postid FROM post WHERE threadid='$threadid' ORDER BY dateline LIMIT 0,1");
if ($postid==$islast[postid]) {
if ($issecondlast=$DB_site->query_first("SELECT dateline FROM post WHERE threadid='$threadid' ORDER BY dateline LIMIT 1,1")) {
$DB_site->query("UPDATE thread SET lastpost='$issecondlast[dateline]' WHERE threadid='$threadid'");
}
}
Hey, woah - I just like wrote the hack! LOL. Of course, that's not accounting for any of the code already in there. You probably don't need all that because it's partly redundant.
[Note: That code is completely untested]
Note that I left out the DESC part from the dateline - this should get the oldest post.
Quote:
Also, the second bug seems to be that regular users can unlock their posts regardless of the setting in the control panel. Anyone else know more about this?
(You can imagine how we discovered this, mod-locked threads mysteriously float up to the top of the board, unlocked with no explanations.)
So we know who's been unlocking them (the original posters), but we can't do anything about it!!!
|
I don't think that's a bug - you might want to check your usergroup permissions.