Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3309)
Admin Toolbox Mod
By Spuds (http://custom.simplemachines.org/mods/index.php?action=search;author=11359)
Licenseo This Modifications Source Code is subject to the terms of the Mozilla Public License version 2.0 (the "License"). You can obtain a copy of the License at http://mozilla.org/MPL/2.0/.
IntroductionThis modification adds several new admin maintenance functions including
- Recalculates user post counts
- Merge two users in to a single ID
- Mark inactive users as read all posts
- Recount forums daily statistics
This mod is compatible with SMF 2.0 Only.
SupportPlease use the admin toolbox modification thread for support with this modification.
Changelog1.0 - 14 Jan 2012+ Initial Release
Merge 2 users !! FANTASTIC IDEA!!!
Congratulations for this mod
Hello :)
I've been curios about the daily activity (since my forum is running from 2003 or something) but after a while - I get this error:
Column count doesn't match value count at row 123
File: H:\xampp\htdocs\community\Sources\AdminToolbox.php
Line: 840
The comment on top is great though :))
// Purples may not want to look at what I'm doing here, just move along, its all good, nothing to see here :)
Indeed, nothing to see, its a bit too generic to spot immediatly what's the issue without some debug statements..
I'm not sure what you are trying to say or ask to be honest ... lost :-\
What version of SQL are you running
Do you have any existing data in the log_activity table
Does the log_activity table exist at all
What option did you choose for the data rebuild
etc ....
wow, really great mod!
If i mark inactive users as read all post then will it reduce my database size?
Quote from: Game.ruler on March 11, 2012, 02:02:05 PM
If i mark inactive users as read all post then will it reduce my database size?
yes
Quote from: Game.ruler on March 11, 2012, 02:02:05 PM
If i mark inactive users as read all post then will it reduce my database size?
Short answer is generally yes ... if you are not using / converted those tables to innodb from myisam.
Longer answer is this depends on how many users you have, if they were ever active, number of boards and topics, how big the forum is, etc etc ... Basically the function moves the multiple tracking entries from the log_topics table which stores the position that each member is in each topic ....... to 'single' entries in the log_board and log_mark_read tables. So one table will go down in size, two other may increase (but that increase is less than the reduction of the other).
An Awesome mod ever...It helped me a lot :)
Thanx for the reply guys.
I've 5,000 users but nearly 4,000 of them are inactive now. So i think it will reduce much database size na
Would love this if I could get it to work :)
Keeps throwing up an error during Step 4 of merging two accounts. Instead of showing the progress screen I get this error:
Database Error
Duplicate entry '27665-996' for key 1
File: /htdocs/forum/Sources/AdminToolbox.php
Line: 1127
Using the latest coding, downloaded an hour ago. Any suggestions? I'm going over the file now, but I haven't done any coding in a while and I'm pretty rusty.
Great mod, thanks :)
But it has small problem ;)
It counts messages in boards where the counting of posts is disabled.
In which function
Well that is odd ...
The query specifically only loads boards that has post count enable and makes sure it does not count anything in the recycle board for those that have that enabled.
I just did a quick test on my test forum and it did not count any user posts in a board with post count off .... so not sure why its not working for you. I'll do some more poking around but ATM there is nothing obvious. Was it adding posts or not subtracting posts? MySQL? PHP version? main board or a child board? Just looking for clues.
Thanks a lot,
I'll check the mode some times yet and describe in this topic
User has:
Summary 70 messages
==================
1st board - 4 pcs (child board, count off)
2nd board - 5 pcs (child board, count off)
3rd board - 61 pcs (child board, count off)
After recounting, I see the quantity 32 messages in the his profile
PHP Version 5.3.10-pl0-gentoo
SQL 5.1.61-log
???
Updated:
Possibly... If user doesn't have any posts in the board with count, counter doesn't change.
Early, the counter in these boards was enable, then I disabled counter.
I'm trying to understand what you are doing ...
So a user had 70 posts in 3 boards ... you went in and disabled the post count in those boards and it dropped to 32 and you were expecting it to be zero? Are you sure they only had 70 posts in total to begin with? ... You can try show users posts and see or do it via phpmyadmin.
One thing to try .... in AdminToolbox.php, at around line 175
SELECT m.id_member, COUNT(m.id_member) AS posts
SELECT /*!40001 SQL_NO_CACHE */ m.id_member, COUNT(m.id_member) AS posts
just in case its some cache problem going on with mysql.
sorry for my english. :-[
Yes, user has only 70 posts. (Maybe i disabled counter when he had 32 posts)
I've tried to move one post to boards where counter is enabled and after recounting quantity of posts was changed to 1.
If all posts of user are placed in boards where counter is disabled, the counter of posts doesn't changed after recounting.
Try on your forum: move all posts of test-user to board where posts don't count and re-count them.
I think the quantity of posts won't change.
Sorry, I'm can't try replace the code now. I'll try it tomorow. I don't have full access to the forum now :(
OK ... I think I understand now!
Hummmm ... need to think about how to properly detect that case. I do have some processing after the main recount to zero members who have no posts (in countable boards) but it must be getting tripped up by this case of only posts in non countable boards. The cache thing above is not going to help (but it will not hurt either)
I'lll see what I can do over the next couple of days.
Quote from: Spuds on March 30, 2012, 09:41:27 PM
I'lll see what I can do over the next couple of days.
Do you have any news? ;)
Quote from: whatevah on March 25, 2012, 11:31:25 PM
Would love this if I could get it to work :)
Keeps throwing up an error during Step 4 of merging two accounts. Instead of showing the progress screen I get this error:
Database Error
Duplicate entry '27665-996' for key 1
File: /htdocs/forum/Sources/AdminToolbox.php
Line: 1127
Using the latest coding, downloaded an hour ago. Any suggestions? I'm going over the file now, but I haven't done any coding in a while and I'm pretty rusty.
I've seen this problem too. Ended up finishing the merge by hand. Not THAT big of an issue, but certainly less than ideal.
-T.
QuoteDatabase Error
Duplicate entry '27665-996' for key 1
I believe the duplicate index collision is caused when you are merging two users, and both of them have received the same PM ... it can't move it over since its already there. I've put in some extra checks to look for this condition.
Quotetry on your forum: move all posts of test-user to board where posts don't count and re-count them.
I think the quantity of posts won't change.
I took a user with all of the posts in a board, i changed that board settings to not count posts and the total went to zero as expected. I turned the post count back on and the total when back to the correct number of posts. tried it as no post counting child boards of a regular board as well ... Still unable to reproduce the reported issue.
updated the package.
Found this mod interesting but while "Rebuilding Daily Stats", the following error returned:
QuoteDatabase Error
Column count doesn't match value count at row 1
File: /home/ssssklsls/public_html/Sources/AdminToolbox.php
Line: 899