The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#12
|
||||
|
||||
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" |
#13
|
|||
|
|||
sorry bira but I've too tried your hack and it didnt work.
|
#14
|
||||
|
||||
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
|
#15
|
|||
|
|||
Does anyone know which lines to modify in 2.0?
Here are the functions: 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'].","; $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'"); } } |
#16
|
|||
|
|||
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]"]--; // } // } |
#17
|
|||
|
|||
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 |
#18
|
||||
|
||||
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 |
#19
|
|||
|
|||
Cant get this hack to work with VBBFinal??? Can someone help me
|
#20
|
|||
|
|||
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?? |
#21
|
||||
|
||||
Is there a clean set of instructions for not reducing member or board counts on delete for 2.0.3?
Thanks!!! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|