Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
setting users post count?
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 5, 2017 - 10:01 am

I tried doing a search for this but I am wondering if there is a way to set users post counts?Either through the interface or through the database?

 

I ask because I already set up simple press and I have everything that I want set up but I noticed that your converter tool will only work with a fresh install (converting from ip.board). I believe I can import a list of users into wordpress which should work to get my users set up but my users would like their post counts to remain the same. 

 

Thoughts?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 5, 2017 - 11:17 am

Forum Admin > Toolbox > Housekeeping. There is a task on that panel to recalc all users post counts. Is that what you need?

andy-signature.png
YELLOW
SWORDFISH
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 5, 2017 - 1:36 pm

No not exactly. Since my users will not have any posts I just want to set their post count to what it was on our old forums and have it continue on from there. So either I will have to set them manually or update whatever table that data is stored on. I guess I need to know what table that is and if there is a risk of corrupting anything by setting them manually.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 5, 2017 - 3:24 pm

Ah sorry - I misunderstood. It has been one of those days!

A users forum post count is maintained in the sfmembers table in the column simply named 'posts'. The table will require your set WP table prefix of course.

If you have a table with the data including user_id and post count then it could be updatred with a simple SQL query.

andy-signature.png
YELLOW
SWORDFISH
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 6, 2017 - 4:40 pm

Ok one last question. 

 

I know I can import users to the wp users table. Is there any reason that I can't import users into the WP_SFMEMBERS table? I would want to import to the display_name and posts field. Is there any reason that importing just these two fields to the WP_SFMEMBERS table would cause issues? Are all other fields that are required set to default values? 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 6, 2017 - 4:54 pm

Not realistically possible I am afraid.

Firstly the forum's sfmembers table is intrinsically linked to the WP users and usermeta tables plus some of the columns in sfmembers do need code to fill them. There is a function that can be called to perform this task but it has to be called for each new sfmember row creation - most usually triggered by a new user creation in WP users.

andy-signature.png
YELLOW
SWORDFISH
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 6, 2017 - 5:31 pm

hmmm ok well how well does your import tool work? I hate that I have to redo all the permissioning as that was a big pain for me. But if that gets my users in with their post counts intact then that's what I will have to do.

 

I can copy the additional css and the child theme folder to make it a bit less painful but wish I didn't have to go back to a fresh install to import the data.  

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 7, 2017 - 4:33 am

I wouldn't want to do that either.

So this data came from a different forum. If you have the database still why not extract just the post count data and import that separately? Do you have tools to run queries on your database? And do you know the table and column where the users posts are stored?

andy-signature.png
YELLOW
SWORDFISH
Avatar
mike olson
Member
sp_UserOfflineSmall Offline
Mar 7, 2017 - 11:12 pm

Yellow Swordfish said
I wouldn't want to do that either.

So this data came from a different forum. If you have the database still why not extract just the post count data and import that separately? Do you have tools to run queries on your database? And do you know the table and column where the users posts are stored?  

yes I still have the database. The problem is that the the users do not exist in the database. 

 

I went ahead and built a tool that will query the old database and the new wp_sfmembers table and then update the posts field to merge the two counts together. I will just have them check in with me as the log in and then I will run that tool and update them as they start to check in. I have 709 users right now so it is just going to be a bit of work but it won't all be at once. 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 8, 2017 - 2:52 am

sorry, late to the game, but if the users are not in the database, then they wont be associated with existing posts... so in addition to creating the user post count, do you need/want to associate them with their old posts?

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10118
Posts: 79603