Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: SMFHacks.com Team on January 23, 2010, 09:26:57 PM

Title: Recount Member Posts
Post by: SMFHacks.com Team on January 23, 2010, 09:26:57 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=2324)

Recount Member Posts



This mod will allow the admin to recount every members post counts back to their respective numbers. Due to a variety of mods as well as human who can manipulate members' post counts, this mod may serve many well for when they wish to reset their forums.


Thanks
Thank you for installing this mod, and don't forget to support the developer! (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W43RKPPZ2KGYE)
Title: Re: Recount Member Posts
Post by: rithera on February 14, 2010, 09:40:35 PM
Thank you!
Title: Re: Recount Member Posts
Post by: vbgamer45 on February 15, 2010, 12:24:10 AM
Glad you enjoyed it!
Title: Re: Recount Member Posts
Post by: Mace360 on March 04, 2010, 06:12:06 PM
My forum has had difficulties with this mod. It applied itself to only a handful of users, and left the vast majority with their original (altered) post count.

We had accepted post counts from a prior forum up until some time ago, and recently decided to get rid of them entirely. These "recoveries" were done over an extensive period of time, so we're confused as to how the process worked. The selection process for whose posts to remove seems haphazard at best.

Is there any way to ensure it applies universally?

edit: weee caps lock
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: vbgamer45 on March 08, 2010, 08:55:54 PM
As long as it completes all the members it should do the post counts. It  does check if the posts where made in a forum that does not count posts.

Updated for SMF 2.0 RC3!
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Mace360 on March 08, 2010, 10:22:22 PM
Quote from: vbgamer45 on March 08, 2010, 08:55:54 PM
As long as it completes all the members it should do the post counts. It  does check if the posts where made in a forum that does not count posts.

Updated for SMF 2.0 RC3!
It only did a handful, as I said. Any ideas as to why?
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: vbgamer45 on March 08, 2010, 10:26:58 PM
Did it stop and not reach 100%?
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Mace360 on March 09, 2010, 01:56:31 AM
Quote from: vbgamer45 on March 08, 2010, 10:26:58 PM
Did it stop and not reach 100%?
It goes to the "Not Done!" screen very briefly, then just ends. It's usually at 6% or so at the time of doing this.
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: vbgamer45 on March 12, 2010, 01:35:04 AM
It just ends as in the screen is stuck? Or do you get a white page? What page does it end up on?
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Bugo on March 18, 2010, 02:48:50 AM
Why in file installrc3.xml made this change?
<file name="$themedir/ManageMaintenance.template.php">
<operation>
<search position="after"><![CDATA[<div class="cat_bar">
<h3 class="catbg">', $txt['maintain_logs'], '</h3>
</div>]]></search>
<add><![CDATA[<div class="cat_bar">
<h3 class="catbg">', $txt['maintain_logs'], '</h3>


In my opinion, appropriate to be replaced by a variable $txt['maintain_recount_posts'], as in the file install.xml:
<file name="$themedir/ManageMaintenance.template.php">
<operation>
<search position="after"><![CDATA[<div class="cat_bar">
<h3 class="catbg">', $txt['maintain_logs'], '</h3>
</div>]]></search>
<add><![CDATA[<div class="cat_bar">
<h3 class="catbg">', $txt['maintain_recount_posts'], '</h3>


Sorry for bad English - I'm worried :)

In addition, Russian-language translation here:
this for languages-utf8.xml (encoded to UTF8 w\o BOM)
<file name="$languagedir/ManageMaintenance.russian-utf8.php" error="skip">
<operation>
<search position="after"><![CDATA[$txt['maintain_errors']]]></search>
<add><![CDATA[$txt['maintain_recount_posts'] = 'Пересчитать количество сообщений у всех пользователей';
$txt['maintain_recount_posts_info'] = 'Если общее количество сообщений какого-либо пользователя было изменено, запустите эту операцию. Будет восстановлено реальное количество сообщений.';]]></add>
</operation>
</file>


and this for languages.xml (encoded to ANSI):
<file name="$languagedir/ManageMaintenance.russian.php" error="skip">
<operation>
<search position="after"><![CDATA[$txt['maintain_errors']]]></search>
<add><![CDATA[$txt['maintain_recount_posts'] = 'Пересчитать количество сообщений у всех пользователей';
$txt['maintain_recount_posts_info'] = 'Если общее количество сообщений какого-либо пользователя было изменено, запустите эту операцию. Будет восстановлено реальное количество сообщений.';]]></add>
</operation>
</file>
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Mace360 on March 21, 2010, 01:07:39 AM
Quote from: vbgamer45 on March 12, 2010, 01:35:04 AM
It just ends as in the screen is stuck? Or do you get a white page? What page does it end up on?
It shows me the Not Done screen with the loading bar, then goes back to the page for maintenance.
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Robin1989 on April 30, 2010, 10:19:58 AM
same i just installed it and i have a few problems. 1 its labeled as a second empty out unimportant logs and 2 it does the first 3% then stops and goes back to the maintenance screen.
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: vbgamer45 on May 02, 2010, 10:27:04 PM
Updated the mod with a fix that should help with that issue.
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: ~DS~ on May 02, 2010, 10:38:44 PM
The header had the same title.
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: vbgamer45 on May 02, 2010, 10:55:57 PM
Fixed that too thanks. Updated posted
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Robin1989 on May 03, 2010, 05:18:27 PM
cool it fixed the title of it been wrong its now correctly labled but its still not going past 3%
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: ~DS~ on July 23, 2010, 08:10:00 PM
This doesn't work when moving database to another forum. It still have post counts from another database.

BTW...this doesn't show the green thing. :P
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: shadow82x on November 21, 2010, 07:23:41 PM
Stops at 1% for me too, on a big board. Please fix this.
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: CeFurkan on January 06, 2011, 10:25:22 PM
can not install at RC4

can you update the package
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Lars-Christian on January 17, 2011, 11:54:13 PM
Quote from: CeFurkan on January 06, 2011, 10:25:22 PM
can not install at RC4

can you update the package

Just echoing this. Any chance of a working version for RC4?
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Snape on January 18, 2011, 11:09:26 AM
It installs if you emulate version 2.0RC3.
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Wanny on April 08, 2011, 11:51:09 AM
*sigh* I have the same problem as one of the people in the 1st page... the recount was applied only to some people, leaving a lot out.

When I press the button I see the screen with the progress bar, it stays at 48% for a second, then it goes back to the maintenance screen.
No messages, no confirmation, nada
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Aleksi "Lex" Kilpinen on May 11, 2011, 05:17:33 AM
No idea why, but it does indeed look like this only goes as far as the first refresh in versions post RC3.
I tested with RC5 just now, and it did 6%, refreshed and jumped back to the maintanence section with no confirmation or anything.
Title: Re: Recount Member Posts - Updated for SMF 2.0 RC3!
Post by: Road Rash Jr. on June 26, 2011, 06:50:59 PM
vbgamer45, is this mod going to be updated for SMF 2.0 Final?
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: vbgamer45 on June 26, 2011, 08:08:02 PM
Updated for SMF 2.0
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: Jessica. on June 26, 2011, 08:10:08 PM
very useful mod. will install once I can get on my forum
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: Road Rash Jr. on June 26, 2011, 08:11:23 PM
Thanks
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: Aleksi "Lex" Kilpinen on June 27, 2011, 03:12:42 AM
Just as earlier when I tested this on my live forum, it seems to work for a while, and then just stop without any confirmation or anything... Did not work for me.  (I have a test member with manually set post count of over a thousand, and it stayed that way... )
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: vbgamer45 on June 27, 2011, 09:08:57 AM
I checked it over again I can't find anything that looks wrong I use the same code in a couple mods.
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: Aleksi "Lex" Kilpinen on June 27, 2011, 09:10:21 AM
Don't know either - Don't have time to start looking in to it, but there are many people here saying the same, and I just confirmed it did it for me too...
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: Road Rash Jr. on June 27, 2011, 09:12:55 AM
I installed it yesterday on SMF 2.0 final and it works fine for me. Mind you I don't have a lot of mods like others do that may have a conflict.
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: lukeren on September 12, 2011, 07:30:05 AM
I upgraded my 1.1.14 to a 2.0.
One member who once was an admin modified his postcount to something completely ridiculous, so I'd like to fix it.
I installed this mod, but his postcount doesn't change when I run it.
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: oOo--STAR--oOo on October 01, 2011, 01:07:15 PM
Doesn't work on my forum, SMF 2.0.1

I press to run task, gets to 8% 1st screen then returns to maintenance.
Checked members with inhuman post count, nothing changed.
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: Costner on October 05, 2011, 08:47:33 AM
Just to confirm also, ran, saind 24% paused, not done, then went straight back to the maintainence screen.
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: bfeist on October 20, 2013, 10:52:48 PM
Hi all,
I know this is an old thread, but I'm trying to recount member posts on a forum after deleting large parts of the subject matter.

I have many members who's profile shows a number of posts, who actually have no posts in the system  now. Here is an example: http://smf1.temac.ca/smf/index.php?action=profile;u=110

The stats say he has 1 post, but if you click "Show Posts", there are no results.

I've installed and run the mod several times. It doesn't seem to fix this. I have no other mods installed on a 2.0.5 installation.
Any suggestions?

Thanks,
Ben
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: bfeist on October 21, 2013, 03:04:41 PM
Quote from: bfeist on October 20, 2013, 10:52:48 PM
Hi all,
I know this is an old thread, but I'm trying to recount member posts on a forum after deleting large parts of the subject matter.

I have many members who's profile shows a number of posts, who actually have no posts in the system  now. Here is an example: http://smf1.temac.ca/smf/index.php?action=profile;u=110

The stats say he has 1 post, but if you click "Show Posts", there are no results.

I've installed and run the mod several times. It doesn't seem to fix this. I have no other mods installed on a 2.0.5 installation.
Any suggestions?

Thanks,
Ben

I managed to fix this myself. The mod as it stands, doesn't appear to work.
First I manually set the batch processing size limit to 500 instead of 100, this allowed the updates to run in a single refresh. This activated the mod (with multiple batches it doesn't appear to work at all).
Then I noticed that it was leaving untouched members who have existing post stats but have 0 posts at all in the forums (due to deleting multiple forums in my case). The entire way this mod works is to start with a list of users from the messages table. By definition, if a member has left no messages, their stats won't be reset to zero. To get around this I zeros all of the "posts" values in the smf_members table, then reran the modified mod to recount the stats for those who had posted.
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: sorensonfan41 on January 04, 2014, 04:57:06 PM
I tried this mod out for a relatively large forum (1700+ members and over 300,000 posts) a few weeks ago and the mod stopped after a certain period of time and percentage and took me back to the maintenance page.  I checked out everything and the mod didn't fix any of the members' post counts correctly.  The forum I'm referring to is using SMF 2.0.6 and I used the latest version of the mod.

Any ideas on how to fix the problem?  Seems like it's stopping to not overload the server but instead of resuming where it left off, it terminates.
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: Sorunome on June 05, 2014, 02:01:46 PM
in order to get it work I had to replace
$context['continue_get_data'] = '?action=admin;area=maintain;sa=recountposts;start=' . $_REQUEST['start'] . ';' . $context['session_var'] . '=' . $context['session_id'];
with
$context['continue_get_data'] = '?action=admin;area=maintain;sa=routine;activity=recountposts;start=' . $_REQUEST['start'] . ';' . $context['session_var'] . '=' . $context['session_id'];
in Sources/ManageMaintenance.php

Still a awesome mod, though :)
Title: Re: Recount Member Posts - Updated for SMF 2.0!
Post by: SMFHacks.com Team on June 06, 2014, 12:39:08 PM
Quote from: Sorunome on June 05, 2014, 02:01:46 PM
in order to get it work I had to replace
$context['continue_get_data'] = '?action=admin;area=maintain;sa=recountposts;start=' . $_REQUEST['start'] . ';' . $context['session_var'] . '=' . $context['session_id'];
with
$context['continue_get_data'] = '?action=admin;area=maintain;sa=routine;activity=recountposts;start=' . $_REQUEST['start'] . ';' . $context['session_var'] . '=' . $context['session_id'];
in Sources/ManageMaintenance.php

Still a awesome mod, though :)

Fixed thanks for the big tip!
Title: Re: Recount Member Posts
Post by: leftezi on November 15, 2016, 07:45:40 AM
Before i proceed to recount, i have a question:

J have some boards in my forum where posts don't count.
Will this mod take this in mind by the recounting?
Title: Re: Recount Member Posts
Post by: vbgamer45 on November 15, 2016, 08:21:16 AM
Yes it does.
Title: Re: Recount Member Posts
Post by: leftezi on November 17, 2016, 06:39:12 PM
Thank you for your answer.  :)

I have done the recount in a 16.000 members SMF 2.0.12 forum. The script was running to 100% without problems. I am not sure if it have done the job because i have focused in another problem:
One mod have changed the membergroups that are based in members post in a lot of members. So i have done the recount to fix the problem.
I was expecting that after the recount this members will return in their right membergrup but unfortunately the membergroups are untouched.
The question is: This mod takes in mind the membergroup based in posts by the recounting?
Title: Re: Recount Member Posts
Post by: vbgamer45 on November 17, 2016, 06:49:49 PM
If it is modified SMF software that does something with post groups then no it does not.
Title: Re: Recount Member Posts
Post by: Kindred on November 17, 2016, 10:25:04 PM
No...   smf does not recalculate a members post count base during group until they make a new post.
Title: Re: Recount Member Posts
Post by: Biology Forums on November 24, 2016, 03:45:44 PM
Was a 1.x version ever released?
Title: Re: Recount Member Posts
Post by: vbgamer45 on November 24, 2016, 06:11:59 PM
No
Title: Re: Recount Member Posts
Post by: Biology Forums on November 24, 2016, 07:58:30 PM
Would you mind if I got this backported?
Title: Re: Recount Member Posts
Post by: vbgamer45 on November 24, 2016, 08:02:27 PM
no
Title: Re: Recount Member Posts
Post by: Kindred on November 24, 2016, 08:13:43 PM
Why don't you just upgrade to the current version instead of continuing to use a version which is barely supported and won't work at all when you host drops the outdated, unsupported and vulnerable php version and instead of trying to keep nursing that outdated version along with custom work?
Title: Re: Recount Member Posts
Post by: FishingManMatt on October 20, 2017, 11:48:59 AM
Quote from: leftezi on November 17, 2016, 06:39:12 PM
The question is: This mod takes in mind the membergroup based in posts by the recounting?

Quote from: Kindred on November 17, 2016, 10:25:04 PM
No...   smf does not recalculate a members post count base during group until they make a new post.

Indeed.
There is also another way to update these membergroups. After using the mod one can also edit each post count based group and just save it. This will update each membergroup considering new recounted values.