The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#52
|
||||
|
||||
Quote:
PHP Code:
|
#53
|
|||
|
|||
[QUOTE]Originally posted by Lesane
Delete post/thread = Decrease points from user but don't decrease user's posts amount, then do the following: |
#54
|
||||
|
||||
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.
|
#55
|
|||
|
|||
Oh so I just don't do anything for that line u put there?
|
#56
|
|||
|
|||
This hack...can't be installed on a clean version of 2.2.6? I can't find most of the code....
|
#57
|
|||
|
|||
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. 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]"]--; } } $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 ####################### |
#58
|
|||
|
|||
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 |
#59
|
|||
|
|||
desi: Give me 5 minutes, I'm releasing a hack for what you want.
|
#60
|
||||
|
||||
That's 5 long minutes!
Is there a way to retain the board count yet? Bc that would be groovy! =] |
#61
|
|||
|
|||
I did indeed release the hack a long time ago General .
https://vborg.vbsupport.ru/showthrea...threadid=45158 |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|