View Full Version : Prune doesn't reduce user post count
tubedogg
03-26-2001, 10:00 PM
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.
Whoa that's actually pretty good, I wonder if it's possible to do the same with the board's post count?
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?
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.
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!
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.
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
05-27-2001, 07:00 AM
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
05-27-2001, 08:17 AM
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
05-27-2001, 08:44 AM
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.
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
05-29-2001, 03:33 PM
sorry bira but I've too tried your hack and it didnt work. :(
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
06-11-2001, 10:12 AM
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($userpostco unt)) {
$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
06-13-2001, 05:42 PM
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
06-14-2001, 07:39 AM
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
06-30-2001, 06:01 PM
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
07-21-2001, 03:22 AM
Cant get this hack to work with VBBFinal??? Can someone help me
TripleH
07-21-2001, 05:08 AM
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
09-10-2001, 12:23 AM
Is there a clean set of instructions for not reducing member or board counts on delete for 2.0.3?
Thanks!!! :D
Yeah a version for 2.0.3 would be great please
Chris Stewart
10-14-2001, 03:58 AM
Could someone post the whole modded fuctions.php doc for us newbies?:D
Freddie Bingham
10-14-2001, 04:17 AM
You can not post source code.
Chris Stewart
10-14-2001, 04:20 AM
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
10-16-2001, 04:47 AM
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
10-23-2001, 10:11 PM
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
10-24-2001, 05:54 AM
I've been waiting for a definitive answer myself :(
defweb
10-27-2001, 01:58 AM
need a definitive answer for version 2.03 still
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!
11-23-2001, 09:47 AM
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($userpostco unt)) {
$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($userpostco unt)) {
//$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
01-06-2002, 06:09 PM
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
02-16-2002, 09:26 PM
Excuse the intrusion, probably in a wrong place, but nobody answered here (https://vborg.vbsupport.ru/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!
02-17-2002, 05:40 AM
you guys should really read this thread from beginning to end. Alot of your questions are answered within it.
Jawelin
02-17-2002, 08:17 AM
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
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($userpostco unt)) {
$DB_site->query("UPDATE user SET posts=posts$subtract WHERE userid='$postuserid'");
}
}
### and replace with ###
// if (is_array($userpostcount)) {
// while(list($postuserid,$subtract)=each($userpostco unt)) {
// $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
03-25-2002, 07:48 AM
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$
03-26-2002, 05:46 AM
work perfectly on 2.2.4
larryz
03-26-2002, 07:57 AM
Original Post:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=34518
jardragon901
03-28-2002, 09:25 AM
thanx neo, works great :) .
thnax neo that worked easily and fast.
Jawelin
04-04-2002, 07:22 PM
Slight different question: when I move/prune thread, HOW could automatically recount posts for all the users within that thread ?
Thanks
newvbuser
04-05-2002, 02:23 PM
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
04-08-2002, 04:21 AM
[QUOTE]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
04-08-2002, 07:17 PM
Huh? Avenger are you asking the same question also?
dotagious
04-10-2002, 01:17 AM
yup
Psychdrone
04-10-2002, 01:51 AM
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
Can I assume this only works as long as you never update your user post counter?
in v.2.2.5- i can't seem to find the
########start delete thread##### part........
i also want this cool hack! :(
ExAvIoUr
04-30-2002, 07:23 PM
hmm there is... its there man.. i m so sure its there.. :)
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
06-11-2002, 07:44 PM
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]'");
------
[QUOTE]Originally posted by Lesane
Delete post/thread = Decrease points from user but don't decrease user's posts amount, then do the following:
Lesane
06-11-2002, 08:12 PM
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.
Oh so I just don't do anything for that line u put there? :confused:
FFMania
06-18-2002, 03:32 PM
This hack...can't be installed on a clean version of 2.2.6? I can't find most of the code....:(
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 #######################
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
desi: Give me 5 minutes, I'm releasing a hack for what you want.
The General
05-11-2003, 09:18 AM
That's 5 long minutes! :D
Is there a way to retain the board count yet? Bc that would be groovy! =]
I did indeed release the hack a long time ago General ;).
https://vborg.vbsupport.ru/showthread.php?s=&threadid=45158
The General
05-11-2003, 09:22 AM
I just found it...
Cool stuff! =D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.