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

Reply
 
Thread Tools
Doublepost = Not counted in user's post count Details »»
Doublepost = Not counted in user's post count
Version: , by Austin Dea Austin Dea is offline
Developer Last Online: Oct 2005 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-22-2002 Last Update: Never Installs: 0
 
No support by the author.

We all know that sometimes there is a need to post a couple times in a row, whether it be multiple attachments, posting updates, etc. This hack will make it so that the double/triple/whatever post is not added to the user's post count, but still shown and updated in the forum and thread count. I kow at some boards there is a lot of competition in post counts, and although doubleposting is not looked highly upon in most forums, this would ensure that the user isn't getting any benefit out of it. Plus people could use it for bumping topics, etc, etc, etc. This hack will also make it so if that doublepost is deleted, it will not subtract from the user's postcount. Since it was never added in the first place, it shouldn't be a problem .

---------------------------------------------------------------------
NOTE: I did use (with permission) the query and if statement from Xenon's Prevent Doubleposting hack.
---------------------------------------------------------------------

This is a simple hack which only involves 2 file edits (editpost.php and newreply.php). And it does work with the QRB =P. If you have any questions, etc, post them here.


DOESN'T WORK.

Show Your Support

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

Comments
  #12  
Old 08-23-2002, 10:36 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So, Then, is this the whole code that will make the hack work right?

Code:
Doublepost = Not counted Hack

File edits: 2 (editpost.php, newreply.php)

#################################################
Step 1
#################################################
--------------------------
In editpost.php, find:
--------------------------

deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);

--------------------------
Replace it with:
--------------------------

// doublepost = no count hack
      $lastpost = $DB_site->query_first("SELECT * FROM post WHERE threadid = '$threadid' AND postid<$postid ORDER BY postid DESC");
      if($lastpost[userid]!=$bbuserinfo[userid] || (time()-$lastpost[dateline])>3600 || ($attachmentid and !$foruminfo[moderateattach])) {
          deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);
      } else {
          deletepost($postid,$countposts=0,$threadinfo[threadid]);
             }
// end doublepost = no count hack 

--------------------------
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#################################################
Step 2
#################################################
--------------------------
In newreply.php, find:
--------------------------

".iif ($foruminfo[countposts],"posts=posts+1,","")."

--------------------------
Replace it with
--------------------------
// doublepost = no count hack 
".iif ($foruminfo[countposts],"posts=posts+'".iif($threadinfo[lastposter] == "$bbuserinfo[username]",'0','1')."',","")."
// end doublepost = nocount hack

--------------------------
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Upload the two files and you're done.  Enjoy =P.
Reply With Quote
  #13  
Old 08-23-2002, 10:38 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i won't use it now boofo, it's not really tested...

i can think of two more bugs in it i try to found out now
Reply With Quote
  #14  
Old 08-23-2002, 10:43 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok this is one of another bug in editpost.php, i post just the correct code :

PHP Code:
// doublepost = no count hack
      
$lastpost $DB_site->query_first("SELECT * FROM post WHERE threadid = '$threadid' AND postid<$postid ORDER BY postid DESC");
      if(
$lastpost[userid]!=$bbuserinfo[userid] || ($postinfo[dateline]-$lastpost[dateline])>3600 || $postinfo[attachmentid]) {
          
deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);
      } else {
          
deletepost($postid,$countposts=0,$threadinfo[threadid]);
             }
// end doublepost = no count hack 

ok i think with this editpost.php should work perfect now...
Reply With Quote
  #15  
Old 08-23-2002, 10:44 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, when you have something to test, let me know and I will try it out.
Reply With Quote
  #16  
Old 08-23-2002, 10:46 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And the newreply part is ok?
Reply With Quote
  #17  
Old 08-23-2002, 10:50 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can try the delete function when having a lot of doubleposts

nope, the newreply part is just ok, when you don't use attachments, and regard every doublepost from a user as a real doublepost. (There is no timespan in it that marks a post as real doublepost as it should...)
Reply With Quote
  #18  
Old 08-23-2002, 10:54 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you mean the newreply part from Austin Deas code or the newpreply part from g-force2k2?
Reply With Quote
  #19  
Old 08-23-2002, 10:56 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have 2 instances of this code in the editpost.php. Do I replace both of them?

Code:
deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);
Reply With Quote
  #20  
Old 08-23-2002, 11:16 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

??
i just have one instance....

i mean g-forces part has this problems, austins didn't work at all as i know ^^
Reply With Quote
  #21  
Old 08-23-2002, 11:22 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the code I have that has 2 instances of it in the editpost.php.

Code:
if ($action=="deletepost") {

// +++++++ Start Checking Delete Post Permissions [ Start ] +++++++
  $perms=getpermissions();
    if(!$perms[candeleteposts]) {
      eval("standarderror(\"".gettemplate("error_cantdeleteposts")."\");");
      exit;
    }
// +++++++ Start Checking Delete Post Permissions [ End ] +++++++

  if ($deletepost=="yes") {
    //get first post in thread
    $getfirst=$DB_site->query_first("SELECT postid,dateline FROM post WHERE threadid='$threadid' ORDER BY dateline LIMIT 1");
    if ($getfirst[postid]==$postid) {
      // delete thread
      if ($getperms[candeletethread]) {
        deletethread($threadinfo[threadid],$foruminfo[countposts]);
        updateforumcount($threadinfo[forumid]);
        eval("standardredirect(\"".gettemplate("redirect_deletethread")."\",\"forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]\");");
      } else {
        show_nopermission();
      }
    } else {
      //delete just this post
      $foruminfo=getforuminfo($threadinfo[forumid]);
      deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);

      updatethreadcount($threadinfo[threadid]);
      updateforumcount($threadinfo[forumid]);

     eval("standardredirect(\"".gettemplate("redirect_deletepost")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadinfo[threadid]\");");
    }
  } else {
    eval("standardredirect(\"".gettemplate("redirect_nodelete")."\",\"showthread.php?s=$session[sessionhash]&postid=$postid#post$postid\");");
  }
}
if ($action=="deletethispost") {
  $firstpost=$DB_site->query_first("SELECT postid,dateline FROM post WHERE threadid='$threadid' ORDER BY dateline LIMIT 1");
  if ($postid==$firstpost[postid]) {
    if ($getperms[candeletethread]) {
      deletethread($threadinfo[threadid],$foruminfo[countposts]);
      updateforumcount($threadinfo[forumid]);

      $url="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]";
      eval("standardredirect(\"".gettemplate("redirect_deletethread")."\",\"$url\");");
    } else {
      show_nopermission();
    }

  } else {
    $foruminfo=getforuminfo($threadinfo[forumid]);
    deletepost($postid,$foruminfo[countposts],$threadinfo[threadid]);

    updatethreadcount($threadinfo[threadid]);
    updateforumcount($threadinfo[forumid]);

    $url="showthread.php?s=$session[sessionhash]&threadid=$threadinfo[threadid]";
    eval("standardredirect(\"".gettemplate("redirect_deletepost")."\",\"$url\");");
  }
}
?>
What should I use for the newreply then? If it does have attachments in it, will it work?
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 04:48 AM.


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.04578 seconds
  • Memory Usage 2,340KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete