Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 Oct 2009, 05:58
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Smile Freezing postcounts during board cleanup

Hi guys.

I'm planning to do a cleanup of our forum, however I am hoping there is a way I can 'freeze' the postcounts of all members in the meanwhile... in other words, so they have the same post amounts afterwards, even after mass topics have been deleted from the forum.

Basically just want to do a big cleanup without it affecting any post counts at all! Otherwise, with over 1,000 members, it would take too long to restore them manually afterwards.

Can anybody please point me in the right direction for a mod which would help with this, or even might be interested in helping me with their own hack/mod for it?

Thanks in advance
__________________
http://www.theparentsanctuary.net - Australian Parents forum
Reply With Quote
  #2  
Old 22 Oct 2009, 15:12
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
I have never seen a mod to do this. What you might be able to do is create a new field in the user table and copy the post count to that new field. Then do your maintenance. Then copy the field back to the post counts field.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #3  
Old 23 Oct 2009, 06:02
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Hi Lynne,

Thanks for your advice. Would this method work effectively for a board with a lot of members ie. can it be done in one hit, via an SQL query or the like? It would it have to be done manually per user (ie. one-by-one)?

I'm hoping the first is an option, with the amount of members we have it may take too long to do otherwise.

Cheers
__________________
http://www.theparentsanctuary.net - Australian Parents forum
Reply With Quote
  #4  
Old 23 Oct 2009, 07:45
dartho dartho is offline
 
Join Date: Sep 2005
I'm pretty sure you can delete to your hearts content and post numbers won't go down so long as you don't perform a "Update Post Counts" in the maintenance section of the admincp.

[But you should probably perform a database backup first! 1. "just in case" and 2. so you have those soon to be deleted posts save for posterity should you need to go back to them.]
Reply With Quote
  #5  
Old 23 Oct 2009, 08:45
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
This is a somewhat common request which is virtually impossible to achieve, as there are a million + 1 places where the postcount gets updated.

Even if you did backup and restore the postcount, it would get updated to the real numbers the next time you run the maintenance function.

My best advice would be: Don't delete content - or don't care about post counters.
Reply With Quote
  #6  
Old 27 Oct 2009, 03:32
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Originally Posted by Andreas View Post
My best advice would be: Don't delete content - or don't care about post counters.
Unfortunately our database is getting very large, I'm looking to delete older content to free up some space and shrink things down. Otherwise for a non-profit forum, its gonna get too expensive for me to host.

We also have an established post count 'program' where members see it as a big achievement to reach certain post milestones (in fact we have a section specifically where members post about them, and get medals/trophies for it) and we also have postcount restricted areas on our forum too. So we can't really do without the post counters option.

I guess I'll have to keep searching in the meanwhile for a way to do this.

Originally Posted by dartho View Post
I'm pretty sure you can delete to your hearts content and post numbers won't go down so long as you don't perform a "Update Post Counts" in the maintenance section of the admincp.

[But you should probably perform a database backup first! 1. "just in case" and 2. so you have those soon to be deleted posts save for posterity should you need to go back to them.]
Thanks Dartho, I'll do some testing and see if it works
__________________
http://www.theparentsanctuary.net - Australian Parents forum
Reply With Quote
  #7  
Old 27 Oct 2009, 03:48
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Originally Posted by GamerGirl27 View Post
Hi Lynne,

Thanks for your advice. Would this method work effectively for a board with a lot of members ie. can it be done in one hit, via an SQL query or the like? It would it have to be done manually per user (ie. one-by-one)?
I was thinking you could just create a new field, like posts2, and then write a query to copy the content from posts to posts2. then, after you were done deleting posts you could just copy it back.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #8  
Old 27 Oct 2009, 03:49
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
If not, SQL for the win:

Run these before:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Run these after:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add your prefixes if necessary.
__________________
Sr Software Developer / Tech Lead
Reply With Quote
  #9  
Old 27 Oct 2009, 03:56
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
^^ Adrian wrote out what I was thinking.
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #10  
Old 24 Nov 2009, 23:36
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Thanks so much for that, the queries are perfect for what I want to do

I do have one more small request though... would there be a similar one for reinstating post/topic counts for the forum stats?

Ie. Members: 1,087, Threads: 25,591, Posts: 420,667

Or where would I edit this afterwards to reflect the counts prior to the changes being made?

Thanks again SirAdrian, you've been a great help sofar!!

PS. Thought I had better note as well in regards to your suggestion Dartho - I did a test and unfortunately postcounts are affected with topic/post deletion, even without touching the maintenance section of the AdminCP! Just to let you know I wasn't sure of this beforehand, either.
__________________
http://www.theparentsanctuary.net - Australian Parents forum
Reply With Quote
  #11  
Old 28 Nov 2009, 00:45
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Nobody can help me with the last bit?
__________________
http://www.theparentsanctuary.net - Australian Parents forum
Reply With Quote
  #12  
Old 28 Nov 2009, 02:37
dartho dartho is offline
 
Join Date: Sep 2005
Create a new plugin:
Product: vBulletin
Hook Location: forumhome_complete
Name: Restore ForumHome Stats
Execution Order: 5
Plugin PHP Code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Modify the following as required.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #13  
Old 28 Nov 2009, 09:45
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Hi Dartho,

Thanks for your help. I followed your instructions and set the following, which were the stats for our forum prior to the board cleanup...

$num_deleted_threads=25,627;
$num_deleted_posts=421,341;
$num_deleted_users=1,087;
Have activated the plugin, but the stats haven't changed at all - they reflect the aftermath still. Have I done it correctly?
__________________
http://www.theparentsanctuary.net - Australian Parents forum
Reply With Quote
  #14  
Old 28 Nov 2009, 10:00
dartho dartho is offline
 
Join Date: Sep 2005
no commas!

BTW - don't put in the totals, put in teh number you deleted.

eg. if now (after the clean up) you have 5000 threads and previously you had 25627, then $num_deleted_threads=20627; etc ...
Reply With Quote
  #15  
Old 28 Nov 2009, 10:31
RedTrinity's Avatar
RedTrinity RedTrinity is offline
 
Join Date: Mar 2008
Originally Posted by dartho View Post
no commas!

BTW - don't put in the totals, put in teh number you deleted.

eg. if now (after the clean up) you have 5000 threads and previously you had 25627, then $num_deleted_threads=20627; etc ...
Oh bugger, I have no idea how many I deleted LOL... I suppose that means I'm gonna have to do the math now, going by the current totals

I'll give it a shot now and see how I go, thanks again

ETA: Ok, I altered the amounts to reflect the deletions:

$num_deleted_threads=15548;
$num_deleted_posts=247368;
$num_deleted_users=0;
Made sure the plugin is active, still no change though Do i need to update the counters or anything like that?
__________________
http://www.theparentsanctuary.net - Australian Parents forum
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 20:32.

Layout Options | Width: Wide Color: