News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Admin Toolbox

Started by Spuds, March 06, 2012, 10:49:56 AM

Previous topic - Next topic

Spuds

Link to Mod



Admin Toolbox Mod
By Spuds



License
o 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/.

Introduction
This 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.

Support
Please use the admin toolbox modification thread for support with this modification.

Changelog
1.0 - 14 Jan 2012
+ Initial Release

4Kstore

Merge 2 users !! FANTASTIC IDEA!!!
Congratulations  for this mod

¡¡NEW MOD: Sparkles User Names!!!

viulian

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..

Spuds

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 ....

distante


Game.ruler

If i mark inactive users as read all post then will it reduce my database size?

distante

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

Spuds

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).


Nitesh Kunnath

An Awesome mod ever...It helped me a lot :)

Game.ruler

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

whatevah

#10
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.

Sapozhnik

#11
Great mod, thanks :)
But it has small problem ;)
It counts messages in boards where the counting of posts is disabled.

Spuds


Sapozhnik


Spuds

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.

Sapozhnik

Thanks a lot,
I'll check the mode some times yet and describe in this topic

Sapozhnik

#16
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.

Spuds

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

Code (find) Select
SELECT m.id_member, COUNT(m.id_member) AS posts

Code (replace) Select
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.

Sapozhnik

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 :(

Spuds

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.

Advertisement: