vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Post trimming does not decrease post count... v2.2.0 (https://vborg.vbsupport.ru/showthread.php?t=32321)

SharkY-GA 11-11-2001 02:41 AM

I know tubedog made it for 2.0.x but could someone do this for v2.2.x?

tubedogs:
https://vborg.vbsupport.ru/showthrea...threadid=12420

I just cant find it...

almightyone 11-15-2001 02:22 AM

^bump^

Barret 11-15-2001 02:12 PM

I don`t think anyone knows how to do this yet.
If you ask me, this should have been an option on the board "Vbb" to
delete posts with prune or not to.
Unfortunately, it was not. :(

squawell 11-15-2001 02:34 PM

ok~~i already do it!!

find admin/functions
PHP Code:

$posts=$DB_site->query("SELECT userid,attachmentid,postid FROM post WHERE threadid='$threadid'");
    while (
$post=$DB_site->fetch_array($posts)) {
      if (
$countposts) {
        if (!isset(
$userpostcount["$post[userid]"])) {
         
$userpostcount["$post[userid]"] = -1;
        } else {
         
$userpostcount["$post[userid]"]--;
       }
     } 

to this
PHP Code:

$posts=$DB_site->query("SELECT userid,attachmentid,postid FROM post WHERE threadid='$threadid'");
    while (
$post=$DB_site->fetch_array($posts)) {
     
// if ($countposts) {
       // if (!isset($userpostcount["$post[userid]"])) {
         // $userpostcount["$post[userid]"] = -1;
        //} else {
         // $userpostcount["$post[userid]"]--;
        //}
      //} 

i already test on vbb220 and it's work!!

Barret 11-17-2001 12:00 AM

Well thank you so very much man!
That did the trick for sure!
Great work and thanks again!!

squawell 11-17-2001 01:16 AM

Quote:

Originally posted by Barret
Well thank you so very much man!
That did the trick for sure!
Great work and thanks again!!

ur welcome~

i'm happy it work to u

almightyone 11-17-2001 02:37 AM

well i juts did this hack and it doesnt reduce on thread deletion but if i delete an individual post in a thread it drops count i posted a thread then a reply i deleted the reply it lowered by 1 i deleted the thread it didnt :confused:

squawell 11-17-2001 04:16 AM

that should be two parts~~

i only fixed one part make it can work on 203 and 220

another part u find out early post u'll find

SharkY-GA 11-17-2001 10:19 AM

Quote:

Originally posted by almightyone
well i juts did this hack and it doesnt reduce on thread deletion but if i delete an individual post in a thread it drops count i posted a thread then a reply i deleted the reply it lowered by 1 i deleted the thread it didnt :confused:
This is because their seperate peices of code... I have this done... I will post it tommorow...

CoolaShacka 12-06-2001 12:18 PM

Quote:

Originally posted by SharkY-GA (11-17-01 01:19 PM)
This is because their seperate peices of code... I have this done... I will post it tommorow...

*gg* ;)

KuraFire 12-06-2001 06:25 PM

I thought the prune posts option that comes with vB itself did the trick already??

JTMON 12-06-2001 09:50 PM

Up until 2.2.0 you could do a mass prune and it wouldn't drop the postcount. Now it does, as does deletion of single posts/threads

KuraFire 12-07-2001 12:05 PM

Quote:

Originally posted by JTMON
Up until 2.2.0 you could do a mass prune and it wouldn't drop the postcount. Now it does, as does deletion of single posts/threads

That is quite sucky. Why did they change that?? Mass Prune should *always* not drop postcounts!

It was fine the way it worked, now why change it then??? :confused:

:(

JTMON 12-07-2001 08:59 PM

Quote:

Originally posted by KuraFire



That is quite sucky. Why did they change that?? Mass Prune should *always* not drop postcounts!

It was fine the way it worked, now why change it then??? :confused:

:(

My thoughts exactly. So now, you have to use a Non Jelsoft supported HACK to accomplish this :rolleyes:

Rose 01-05-2002 02:47 AM

So, does anyone have a complete hack for this that will work for v 2.2.1? OR is that what Squawell posted up top?

squawell 01-05-2002 04:42 AM

this can do well with 221 look below:

open admin/functions.php find:
PHP Code:

// ###################### Start delete thread #######################
function deletethread($threadid,$countposts=1) {
  global 
$DB_site;

  
// decrement users post counts
  
if ($threadinfo=getthreadinfo($threadid)) {
    
$postids="";
    
$attachmentids="";

    
$posts=$DB_site->query("SELECT userid,attachmentid,postid FROM post WHERE threadid='$threadid'");
    while (
$post=$DB_site->fetch_array($posts)) {
      if (
$countposts) {
        if (!isset(
$userpostcount["$post[userid]"])) {
          
$userpostcount["$post[userid]"] = -1;
        } else {
          
$userpostcount["$post[userid]"]--;
        }
     } 

replace with this:
PHP Code:

// ###################### Start delete thread #######################
function deletethread($threadid,$countposts=1) {
  global 
$DB_site;

  
// decrement users post counts
  
if ($threadinfo=getthreadinfo($threadid)) {
    
$postids="";
    
$attachmentids="";

    
$posts=$DB_site->query("SELECT userid,attachmentid,postid FROM post WHERE threadid='$threadid'");
    while (
$post=$DB_site->fetch_array($posts)) {
    
//  if ($countposts) {
      //  if (!isset($userpostcount["$post[userid]"])) {
        //  $userpostcount["$post[userid]"] = -1;
        //} else {
          //$userpostcount["$post[userid]"]--;
       // }
     // } 

and find this:
PHP Code:

// ###################### Start delete post #######################
function deletepost($postid,$countposts=1,$threadid=0) {
  global 
$DB_site;

  
// decrement user post count
  
if ($postinfo=getpostinfo($postid)) {
    if (
$countposts) {
     
$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
    } 

replace with this:
PHP Code:

// ###################### Start delete post #######################
function deletepost($postid,$countposts=1,$threadid=0) {
  global 
$DB_site;

  
// decrement user post count
  
if ($postinfo=getpostinfo($postid)) {
  
//  if ($countposts) {
    //  $DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
    //} 

i do this in my forum and it's work~~

Rose 01-05-2002 01:48 PM

Quote:

Originally posted by squawell
this can do well with 221 look below:
... ... ... ... ... ... ... ... ... ... ... ... ... ...
i do this in my forum and it's work~~


Thank you, Squawell! I will install this right away. :)

squawell 01-05-2002 02:32 PM

Rose ur welcome ~~ :D :D :D

Rose 01-05-2002 07:21 PM

Umm, that didn't seem to work. I got errors when I tried to access my board, then the cp. But, I may have had server interference at the same time so I'll try again tomorrow. :s Evil servers!

Psychdrone 01-20-2002 02:31 AM

damn I tried this and it dosn't work??

I really need this too!!

:(


All times are GMT. The time now is 08:34 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.01962 seconds
  • Memory Usage 1,786KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete