PDA

View Full Version : Prune doesn't reduce user post count


tubedogg
27 Mar 2001, 05:45
Someone mentioned this in the other forum (I think it was Castel). It's hardly a hack, as it consists of commenting out 3 lines, but here's how to do it:

In functions.php (in the /admin directory) find
// ###################### Start delete thread #######################
It should be around line 1450, somewhere in there. Now, a few lines below that, find
if ($countposts) {
$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$post[userid]'");
}
and replace it with
// if ($countposts) {
// $DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$post[userid]'");
// }

Then, a few lines below that, find
// ###################### Start delete post #######################
A few lines below that, find
if ($countposts) {
$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
}
and replace it with
// if ($countposts) {
// $DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");
// }

Now when you prune (or a post is deleted) the users' post count won't decrease.

27 Mar 2001, 06:40
Whoa that's actually pretty good, I wonder if it's possible to do the same with the board's post count?

27 Mar 2001, 08:36
Oh btw I have another question, does the counter still work when you delete a thread? I mean if you delete a thread will it reduce that user's post count?

27 Mar 2001, 08:40
With this hack, any time a post is deleted (be it via Pruning or by the user himself or the moderator of the forum, and whether you are deleting an individual post or a whole thread), the user's post count is *not* affected. So this makes his count truly a full count of the total number of posts he has made since registering. The reason it works this way is all the different ways to delete a post - pruning, moderator deleting, user deleting, thread being deleted - rely on these two functions to work. Once you remove the reduce count functionality from these two places, no matter how a post is deleted, the user's count stays the same.

27 Mar 2001, 08:58
I see, the only drawback would be if a user spammed the board intentionaly to raise his or her post count, and then deleted his threads.

I guess if you don't allow users to delete their threads, but only to edit them you kinda solve this problem!
Nice hack indeed man!

29 Mar 2001, 18:28
I guess I'm the only person that likes it the way it is now. I like the fact that when a post is deleted, the post count goes down.

Messages are only deleted on my board for one main reason: The user accidentally double-posted. When I see a double post, I delete one. It makes things look nicer. And I don't think someone should get positive credit for a mistake, even if a genuine, simple mistake.

Now we have a very progressive moderating attitude on my board. We will allow a lot of stuff to go by, as long as people are not attacking each other, etc. But when situations do come up, I prefer to edit or censor, rather than deleting the message. By editing the message, and putting an explanation in the edited message, the person who posted the offending message will see right away that what he did was not acceptable, and will have an explanation. This is preferable, in my opinion, that the person coming back and seeing his message missing, and not knowing what is going on.

So deleting a post is not normally done on my board, and only as a very last resort. So if something is deleted, it was because it was very, very bad, and once again, I do not feel someone should continue to get positive credit, to keep credit for that post, if it was so bad that it had to be deleted.

Now I have things set so nobody can delete their own messages or threads, so we do not have a situation of innocent people getting their counts lowered because someone deleted the first post.

30 Mar 2001, 08:38
You might want to read what I wrote here at the bottom:

http://vbulletin.com/forum/showthread.php?s=&threadid=12189

This entire hack is redundent.

Instead of so many code lines, you can achieve exactly the same result by changing in functions.php:


function deletethread($threadid,$countposts=1)


to


function deletethread($threadid,$countposts=0)


(this will ensure that post count does not get decreased when a thread is deleted)

and if you want post count not to change when specific posts are deleted as well, then in function.php change:


function deletepost($postid,$countposts=1,$threadid=0)


to


function deletepost($postid,$countposts=0,$threadid=0)

Streicher
27 May 2001, 08:00
hmm, bira's version of the hack does not work in vB 2.0 final and tubedogg`s first replacement is not anywhere in the funcions.php of the final release.

Can you help me?


Edit: forgotten the word "not" :rolleyes:

JamesUS
27 May 2001, 09:17
bira's version of the hack does work in vB 2.0 final


If bira's hack works what do you need help with? :)

Streicher
27 May 2001, 09:44
Originally posted by JamesUS


If bira's hack works what do you need help with? :)

Ups :rolleyes:

I have forgotten the little word "not". Bira's version of the hack does not work, too.

bira
29 May 2001, 02:07
If you change $countposts=1 to $countposts=0 then there is no way on earth that the post count will change for the user when you delete.


it WILL change if you run "update counters", because that operation is a simple COUNT query of the database. So, if you don't want your users' post count to ever change, then change $countpost to equal 0, and never run "update counters" :D

BluSmurf
29 May 2001, 16:33
sorry bira but I've too tried your hack and it didnt work. :(

bira
29 May 2001, 20:00
this isn't my "hack" and I don't support it, nor use it myself so I'm sorry if this comes off rude, but I don't really care :D ;)

Christian
11 Jun 2001, 11:12
Does anyone know which lines to modify in 2.0?

Here are the functions:


// ###################### 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]"]--;
}
}
$postids.=$post['postid'].",";
$attachmentids.=$post['attachmentid'].",";
}

if (is_array($userpostcount)) {
while(list($postuserid,$subtract)=each($userpostcount)) {
$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");
}
}

if ($attachmentids!="") {
$DB_site->query("DELETE FROM attachment WHERE attachmentid IN ($attachmentids"."0)");
}
if ($postids!="") {
$DB_site->query("DELETE FROM searchindex WHERE postid IN ($postids"."0)");
$DB_site->query("DELETE FROM post WHERE postid IN ($postids"."0)");
}
if ($threadinfo['pollid']!=0) {
$DB_site->query("DELETE FROM poll WHERE pollid='$threadinfo[pollid]'");
$DB_site->query("DELETE FROM pollvote WHERE pollid='$threadinfo[pollid]'");
}
$DB_site->query("DELETE FROM thread WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM thread WHERE open=10 AND pollid='$threadid'"); // delete redirects
$DB_site->query("DELETE FROM threadrate WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM subscribethread WHERE threadid='$threadid'");
}
}

// ###################### 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]'");
}
if ($postinfo['attachmentid']) {
$DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
$DB_site->query("UPDATE thread SET attach = attach - 1 WHERE threadid = '$threadid'");
}

$DB_site->query("DELETE FROM searchindex WHERE postid=$postid");
$DB_site->query("DELETE FROM post WHERE postid='$postid'");
}
}


Thanks in advance

Blue2000
13 Jun 2001, 18:42
here Christian i done this and it worked fine for me


// if ($countposts) {
// if (!isset($userpostcount["$post[userid]"])) {
// $userpostcount["$post[userid]"] = -1;
// } else {
// $userpostcount["$post[userid]"]--;
// }
// }

MichaelG
14 Jun 2001, 08:39
I still get errors, does any1 know which functions to modify?

Thnx i a

Michael

OK, found out myself:
In functions.php search for:

// ###################### 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]"])) {
+++OLD+++ $userpostcount["$post[userid]"] = -1; +++OLD+++
$userpostcount["$post[userid]"]--;
} else {
$userpostcount["$post[userid]"]--;
}

So all you have to do is change $userpostcount["$post[userid]"] = -1; to $userpostcount["$post[userid]"]--;

This was for deleting threads, deleting posts works as shown by tubedogg
Hope I could help some1 with that...

Cya
Michael

Dolamite
30 Jun 2001, 19:01
i get these errors when following the above directions..... i have 2.0.1



Parse error: parse error, expecting `T_VARIABLE' or `'$'' in MY LOCATION (EDITED OUT)functions.php on line 1554

Warning: Cannot add header information - headers already sent by (output started at MY LOCATION (EDITED OUT)functions.php:1554) in MY LOCATION (EDITED OUT)functions.php on line 1183

Fatal error: Call to undefined function: makelogincode() in MY LOCATION (EDITED OUT)global.php on line 299

Warning: Unable to call doshutdown() - function does not exist in Unknown on line 0

weezle
21 Jul 2001, 04:22
Cant get this hack to work with VBBFinal??? Can someone help me

TripleH
21 Jul 2001, 06:08
Ok. I got the threads one to work now because of the new hack posted..

whenever i try to use tubedogg's hack about the deleted posts one, it always gives me errors...

Something wrong??

Christine
10 Sep 2001, 01:23
Is there a clean set of instructions for not reducing member or board counts on delete for 2.0.3?

Thanks!!! :D

padd
09 Oct 2001, 10:44
Yeah a version for 2.0.3 would be great please

Chris Stewart
14 Oct 2001, 04:58
Could someone post the whole modded fuctions.php doc for us newbies?:D

Freddie Bingham
14 Oct 2001, 05:17
You can not post source code.

Chris Stewart
14 Oct 2001, 05:20
Could you email me the page or send it over PM or something? All my info is in my profile. I would do it myself but for some reason my whole fuctions.php (and others) file is all thrown together. It's not laid out all nice and neat.

Email is Fool1515@mediaone.net

Heineken77
16 Oct 2001, 05:47
Originally posted by bira
If you change $countposts=1 to $countposts=0 then there is no way on earth that the post count will change

LMFAO .. sorry ... but I found this VERY amusing ;) ehehheehehe

Thanks bro :)

almighty one
23 Oct 2001, 23:11
come on someone must have worked this out please post how i hate to revert my functions template back to older version to use this

Heineken77
24 Oct 2001, 06:54
I've been waiting for a definitive answer myself :(

defweb
27 Oct 2001, 02:58
need a definitive answer for version 2.03 still

Matt
08 Nov 2001, 01:34
HELP!!!!!!!

I tried this and it totally mucked my boards post counts up. Can someone please say what I need to do for the latest version of Vbulletin???

ToraTora!
23 Nov 2001, 10:47
First of all, there are many ways of doing this hack, and tubedogs hack, for no decrease in the posting numbers is the best way that I can think of. There are other ways, but to be honest, the way I combined my idea, with tubedog's works just fine.

I will not support this for anybody, because i realize this hack has already received its share of complaints, so keep in mind these simple rules, before taking my advice.

1) Tubedog had origionally created this hack. I'm just adding on to it.

2) all changes, are user responsibility. Backup your functions.php file, and if there are errors, than either figure them out on your own, or go back to your old backed up script, because support is something that I truely tried to provide early on in this game, however, most people are here on a take it and run basis, so I provide this information, on the same premise.

3) Do not Pm me, aol me, icq me, yahoo me, or email me concerning the price of cheese on this hack. respond to this thread if you would like any type of support, which as earlier written, sparse if any.

4) Its a simple hack, so for God's sake read what is written, and all will be ok. :)

Here are the changes.

you will find these script lines in your functions.php script(functions.php is found in your admin folder)

Find on line 1837, (or around there) to start in the correct area of the needed changes:

// ###################### Start delete thread #######################

a few lines down, on line 1866, (or around there), you will find this line:

if (is_array($userpostcount)) {
while(list($postuserid,$subtract)=each($userpostcount)) {
$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");
}
}


you can do one of two things.

1) completely take the script out, which is what i did

2) comment out the script such as below.


//if (is_array($userpostcount)) {
// while(list($postuserid,$subtract)=each($userpostcount)) {
//$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");
// }
//}


either way, the script will not execute.




Secondly, Thanks to Tubedog, make these modifications.
(the line numbers, and some variables may of changed, but the basic principle remains).

Find on line 1886 (or around there) this line, to start in the correct area of the needed changes:

// ###################### Start delete post #######################

than, a little bit further down, on line 1892 (or around there) find:



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


and than comment it out as shown below.



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





NOTE!!!: i did not comment out:if ($postinfo=getpostinfo($postid)) {

If you comment this line out, you will receive this error:


Parse error: parse error in /home/blah/public_html/blah/blah/admin/functions.php on line 1907



so do NOT comment out the line described above.





:)

WebMasterAJ
06 Jan 2002, 19:09
Bringing this hack back, I am using 2.2.0 and when I install the hack, and go to Prune... I tell it to prune 50 days (had the board since Sept) and it comes up with nothing. It doesn't display one post...

However, when I delete threads/posts individually, users keep their post count... so it works on an "individual basis"...

Any ideas?

Thanks...

Andrew Tatum

Jawelin
16 Feb 2002, 22:26
Excuse the intrusion, probably in a wrong place, but nobody answered here (http://www.vbulletin.org/forum/showthread.php?s=&threadid=35078)

I have the opposite problem: when a mod moves a post/thread from a forum with $countposts=1 to another with $countposts=0 (for example the RecycleBin or a chit-chat area which doesn't count against the membership awards given by post-counter), that number is not decreased.
Infact in postings.php, action move, nowhere is any instruction to decrease the counter (or check if necessary) like it is in the delete thread/post sections.
I don't agree with this policy, but that isn't the problem: infact, if I do a complete post recount, unpredictably this user count remains the same, even that user post is ONLY into the $countposts=0 forum....

What's up ?
Thanks

P.S.: I would like very much to bugfix the 'move' code to do this check, but can't figure how...

ToraTora!
17 Feb 2002, 06:40
you guys should really read this thread from beginning to end. Alot of your questions are answered within it.

Jawelin
17 Feb 2002, 09:17
Originally posted by ToraTora!
you guys should really read this thread from beginning to end. Alot of your questions are answered within it. Are you sure ? Have you carefully read mine ? :china:
Thnx

Neo
25 Mar 2002, 08:40
Yes this is updated.. I remeber the old one that was made *memories*.. but the code has changed. So here it is in living color.

I thought this would be usefull since a few people have asked about it.

##### In admin/function.php find ( around line 1967) #####

if (is_array($userpostcount)) {
while(list($postuserid,$subtract)=each($userpostcount)) {
$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");
}
}

### and replace with ###

// if (is_array($userpostcount)) {
// while(list($postuserid,$subtract)=each($userpostcount)) {
// $DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");
// }
// }

##########

##### now shortly under it find ( around line 1996 ) #####

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

### and replace with ###

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

##########

Enjoy.

Jawelin
25 Mar 2002, 08:48
Just an add: WHAT ABOUT moved threads ?
I saw the post count of each user isn't updated when I move a thread from a forum (with countposts=1) to another (with countposts=0) ... ???

I also put a message in bugfix section of vb.com, but it doesn't seem being recognized as a bug... :(

How could I recount posts -ONLY- for each members affected by a particular thread ?

Thanks

ZiRu$
26 Mar 2002, 06:46
work perfectly on 2.2.4

larryz
26 Mar 2002, 08:57
Original Post:

http://www.vbulletin.org/forum/showthread.php?s=&threadid=34518

jardragon901
28 Mar 2002, 10:25
thanx neo, works great :) .

Zedd
04 Apr 2002, 20:03
thnax neo that worked easily and fast.

Jawelin
04 Apr 2002, 20:22
Slight different question: when I move/prune thread, HOW could automatically recount posts for all the users within that thread ?

Thanks

newvbuser
05 Apr 2002, 15:23
Hi Neo does your hack you posted in this last page work with version 2.2.5 ?

I really would like to use this hack.

dotagious
08 Apr 2002, 05:21
Originally posted by newvbuser
Hi Neo does your hack you posted in this last page work with version 2.2.5 ?

I really would like to use this hack.

newvbuser
08 Apr 2002, 20:17
Huh? Avenger are you asking the same question also?

dotagious
10 Apr 2002, 02:17
yup

Psychdrone
10 Apr 2002, 02:51
Neo would be a genious if he could figure out how to also make it so when you update counters it wouldn't delete the users posts

but I don't think he could do THAT

Zedd
16 Apr 2002, 01:42
Can I assume this only works as long as you never update your user post counter?

mak
28 Apr 2002, 18:54
in v.2.2.5- i can't seem to find the

########start delete thread##### part........

i also want this cool hack! :(

ExAvIoUr
30 Apr 2002, 20:23
hmm there is... its there man.. i m so sure its there.. :)

N9ne
11 Jun 2002, 19:33
Hey can anyone make this hack work with 2.2.6 running the Store hack? I'm about to install the store hack, but i'm stuck on the part where it says this;

------
------------------
find(around line 1897):
------------------

$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");

------------------
change it to:
------------------

$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$storemin=$storeadmin[newthread];
$DB_site->query("UPDATE user SET posts=posts$subtract,storep=storep-'$storemin' WHERE userid='$postuserid'");

------------------
find(around line 1930):
------------------

$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");

------------------
Change it to:
------------------

$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$storem=$storeadmin[newreply];
$DB_site->query("UPDATE user SET posts=posts-1,storep=storep-'$storem' WHERE userid='$postinfo[userid]'");
------

That's in functions.php

The problem here is that i've commented out what ToraTora! has said to do.

I don't know any PHP and not this advanced either. So if anyone could re-write those two steps from the Store Hack taking mind that i've commented out what ToraTora! said to do and I still don't want post counts to be reduced during a prune....

If anyone can do that, which i'm sure is Very simple for someone who knows PHP, I will be very grateful :)

Lesane
11 Jun 2002, 20:44
Originally posted by Tha Rock
Hey can anyone make this hack work with 2.2.6 running the Store hack? I'm about to install the store hack, but i'm stuck on the part where it says this;

------
------------------
find(around line 1897):
------------------

$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");

------------------
change it to:
------------------

$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$storemin=$storeadmin[newthread];
$DB_site->query("UPDATE user SET posts=posts$subtract,storep=storep-'$storemin' WHERE userid='$postuserid'");

------------------
find(around line 1930):
------------------

$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");

------------------
Change it to:
------------------

$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$storem=$storeadmin[newreply];
$DB_site->query("UPDATE user SET posts=posts-1,storep=storep-'$storem' WHERE userid='$postinfo[userid]'");
------

That's in functions.php

The problem here is that i've commented out what ToraTora! has said to do.

I don't know any PHP and not this advanced either. So if anyone could re-write those two steps from the Store Hack taking mind that i've commented out what ToraTora! said to do and I still don't want post counts to be reduced during a prune....

If anyone can do that, which i'm sure is Very simple for someone who knows PHP, I will be very grateful :)

Delete post/thread = Decrease points from user but don't decrease user's posts amount, then do the following:


------------------------
find(around line 1897):
------------------

$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");

------------------
change it to:
------------------

$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$storemin=$storeadmin[newthread];
$DB_site->query("UPDATE user SET storep=storep-'$storemin' WHERE userid='$postuserid'");

------------------
find(around line 1930):
------------------

$DB_site->query("UPDATE user SET posts=posts-1 WHERE userid='$postinfo[userid]'");

------------------
Change it to:
------------------

$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$storem=$storeadmin[newreply];
$DB_site->query("UPDATE user SET storep=storep-'$storem' WHERE userid='$postinfo[userid]'");
------

N9ne
11 Jun 2002, 20:54
Originally posted by Lesane

Delete post/thread = Decrease points from user but don't decrease user's posts amount, then do the following:



What lines/code is that?

Lesane
11 Jun 2002, 21:12
hehe, that's no line of code. When you delete a post/thread then the user's post amount won't be decreased but the user's points amount does will be decreased with that code that i posted above.

N9ne
11 Jun 2002, 21:21
Oh so I just don't do anything for that line u put there? :confused:

FFMania
18 Jun 2002, 16:32
This hack...can't be installed on a clean version of 2.2.6? I can't find most of the code....:(

N9ne
22 Jul 2002, 14:07
Ok i'm back with another problem, i've installed about 35 hacks on my forum, so functions.php has changed A LOT. I just noticed that I haven't done this hack! :-/

But my code has changed, I'll paste it here, please can someone show me what to do so whenver a post is deleted, a thread is deleted, or a forum pruned, post counts do NOT go down, infact I never want postcounts to go down.

// ###################### 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]"]--;
}
}
$postids.=$post['postid'].",";
if ($post['attachmentid'] != 0) {
$attachmentids .= $post['attachmentid'].",";
}
unindexpost($post['postid']);
}

if ($attachmentids != '' ) {
// make sure you don't remove attachments that are already in use!
$checkattachments=$DB_site->query("SELECT DISTINCT attachmentid FROM post WHERE attachmentid IN ($attachmentids"."0) AND threadid<>'$threadid'");
$omitattachmentids="";
while ($omitattach=$DB_site->fetch_array($checkattachments)) {
$omitattachmentids.=$omitattach['attachmentid'].",";
}
$DB_site->query("DELETE FROM attachment WHERE attachmentid IN ($attachmentids"."0) AND NOT attachmentid IN ($omitattachmentids"."0)");
}

$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$storemin=$storeadmin[newthread];
$DB_site->query("UPDATE user SET storep=storep-'$storemin' WHERE userid='$postuserid'");


if ($postids!="") {
$DB_site->query("DELETE FROM post WHERE postid IN ($postids"."0)");
}
if ($threadinfo['pollid']!=0) {
$DB_site->query("DELETE FROM poll WHERE pollid='$threadinfo[pollid]'");
$DB_site->query("DELETE FROM pollvote WHERE pollid='$threadinfo[pollid]'");
}
$DB_site->query("DELETE FROM thread WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM thread WHERE open=10 AND pollid='$threadid'"); // delete redirects
$DB_site->query("DELETE FROM threadrate WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM subscribethread WHERE threadid='$threadid'");
}
}

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

// decrement user post count
if ($postinfo=getpostinfo($postid)) {
$storeadmin = $DB_site->query_first("SELECT * FROM storeadmin");
$storem=$storeadmin[newreply];
$DB_site->query("UPDATE user SET storep=storep-'$storem' WHERE userid='$postinfo[userid]'");

if ($postinfo['attachmentid']) {
// make sure you don't remove attachments still in use
$otherattachs=$DB_site->query("SELECT attachmentid FROM post WHERE attachmentid=$postinfo[attachmentid] AND threadid<>'$postinfo[threadid]'");
if ($DB_site->num_rows($otherattachs)==0) {
$DB_site->query("DELETE FROM attachment WHERE attachmentid=$postinfo[attachmentid]");
$DB_site->query("UPDATE thread SET attach = attach - 1 WHERE threadid = '$threadid'");
}
}

$DB_site->query("DELETE FROM post WHERE postid='$postid'");
}
}

// ###################### Start make login code #######################

desi
29 Oct 2002, 11:42
i got a question guys ... i have the hack working but it only accounts for user posts and not the board posts is there anyway to retain the boards count also ?

its would be really good if thats possible :)

cheers

N9ne
29 Oct 2002, 15:33
desi: Give me 5 minutes, I'm releasing a hack for what you want.

The General
11 May 2003, 10:18
That's 5 long minutes! :D

Is there a way to retain the board count yet? Bc that would be groovy! =]

N9ne
11 May 2003, 10:21
I did indeed release the hack a long time ago General ;).

http://www.vbulletin.org/forum/showthread.php?s=&threadid=45158

The General
11 May 2003, 10:22
I just found it...

Cool stuff! =D