Please or Register to create posts and topics.

User Import: Mark topics as followed

Hiho,

I will have to import a bunch of users to a wordpress site and will do so by csv import. Tricky enough,
but now for the tricky tricky part:

I need to have these users imported in a way that all of these are subscibed to on or two forums
(or topics). Is this possible? If so: Which field do I need to import with which content in which table
of the database? Thanks a lot for a hint.

Best regards
nici-

Hello @nici

What you have to do is to calling the following function(s) for each user and passing the ID of the forum/topic to it:

// For topics ...
add_user_meta(get_current_user_id(), 'asgarosforum_subscription_topic', $topic_id);

// For forums ...
add_user_meta(get_current_user_id(), 'asgarosforum_subscription_forum', $forum_id);

 

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

I import the users by csv-import directly into the datebase. So I may set the field directly – so I could insert “asgarosforum_subscription_forum” with “2” into the database directly, wouldn’t I?

Best regards
nici-

Hello @nici

If 2 is the ID of the forum, then you can use this value for the field in the database. 🙂

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!