Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 09-18-2000 Last Update: Never Installs: 0
 
No support by the author.

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

It's something that has recently been a problem, and with the "next release" of vB seemingly becoming more and more distant, it's not something that I can afford to have pushed off any more.

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!!!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 09-18-2000, 08:07 PM
Guest
 
Posts: n/a
Default

hmm.. this would be a problem.. i haven't experienced this exactly... but i sometimes have locked threads moving around but that's cause my hard working mods picked up my own mistakes sometimes
Reply With Quote
  #3  
Old 09-18-2000, 08:40 PM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #4  
Old 09-18-2000, 08:44 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Ed Sullivan
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'");
}
}
Neat, I'll have to check that out... I figured something like that would have to be done, just wanted to see if someone else had done it before I work it out myself!

Quote:
don't think that's a bug - you might want to check your usergroup permissions.
That's what I meant about the "regardless of the controll panel settings". I have it set to "No" for members' ablity to open their closed posts, but for some reason they can still do it.
Reply With Quote
  #5  
Old 09-18-2000, 09:51 PM
Guest
 
Posts: n/a
Default

Actually it was pretty easy:

In editpost.php line 255

change:
Code:
$getlastpost=$DB_site->query_first("SELECT postid FROM post WHERE threadid=$threadid ORDER BY dateline DESC");
into this:
Code:
$getlastpost=$DB_site->query_first("SELECT postid, dateline FROM post WHERE threadid=$threadid ORDER BY dateline DESC");
In editpost line 264:

change:
Code:
      $DB_site->query("UPDATE thread SET replycount=replycount-1,lastposter='".addslashes($lastusername)."' WHERE threadid=$threadid");
to this:
Code:
      $DB_site->query("UPDATE thread SET replycount=replycount-1,lastposter='".addslashes($lastusername)."', lastpost = $getlastpost[dateline] WHERE threadid=$threadid");
And that should update the time correctly. For some reason the last poster is updated, but they just forgot the time.

[Edited by mrogish on 09-18-2000 at 06:59 PM]
Reply With Quote
  #6  
Old 09-18-2000, 11:12 PM
Guest
 
Posts: n/a
Default

mrogish:

I don't have the problem that you mentioned with users being able to reopen closed threads. With my forum it takes them to the page that requires them to log in and states that they aren't a administrator, etc.

It has to be something that you have set up in your control panel.

Thanks for the hack on the other though. I didn't even know they could do this. It works great BTW.

Parker

[Edited by Parker Clack on 09-18-2000 at 08:32 PM]
Reply With Quote
  #7  
Old 09-18-2000, 11:30 PM
Guest
 
Posts: n/a
Default

A user can always write his/her own <FORM> locally and use it to access member.php. That is one *possible* way to cause unforseen problems.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03683 seconds
  • Memory Usage 2,251KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete