User ID
Quote from Gbr on January 21, 2018, 6:54 pmHi,
I erased a user, then readded him, unfortunately all his old comments are now under an “erased user” name.
How can I add back his old ID to get his name back for his old posts ?
Thx. in advance for your support,
G
Hi,
I erased a user, then readded him, unfortunately all his old comments are now under an “erased user” name.
How can I add back his old ID to get his name back for his old posts ?
Thx. in advance for your support,
G
Quote from Asgaros on January 21, 2018, 6:59 pmHello Gbr,
basically you cant do this directly because your database automatically takes care, that a new user doesnt get an ID which was already used before. Otherwise content could be assigned to a user which was never created by him. But thats what you want to do.
So you have to use a tool like phpMyAdmin and directly edit the database. You can have a look in the wp_forum_posts-table. There should be a field called author_id. What you have to do now is to manually change the number there of the posts which have the ID of the old user-account with the ID of its new user-account.
Hello Gbr,
basically you cant do this directly because your database automatically takes care, that a new user doesnt get an ID which was already used before. Otherwise content could be assigned to a user which was never created by him. But thats what you want to do.
So you have to use a tool like phpMyAdmin and directly edit the database. You can have a look in the wp_forum_posts-table. There should be a field called author_id. What you have to do now is to manually change the number there of the posts which have the ID of the old user-account with the ID of its new user-account.
Quote from Gbr on January 21, 2018, 7:05 pmThat’s what I call a quick support ! 🙂
Thx. a lot, I will follow your advice and change the author ID via the posts-table.
That’s what I call a quick support ! 🙂
Thx. a lot, I will follow your advice and change the author ID via the posts-table.
Quote from Gbr on January 21, 2018, 7:23 pmFollowed your advice and everything worked like a charm. Thx. !
Another quick question : where can I modify the notifications content ? (I dont want the text of the post to appear in the notification emails.)
Followed your advice and everything worked like a charm. Thx. !
Another quick question : where can I modify the notifications content ? (I dont want the text of the post to appear in the notification emails.)
Quote from Asgaros on January 22, 2018, 11:22 amYou can use the following filters and change the output with your custom implementation:
- asgarosforum_filter_notify_topic_subscribers_message (new post-notification)
- used parameters: $notification_message, $topic_name, $answer_text, $answer_link, $author_name
- asgarosforum_filter_notify_global_topic_subscribers_message (new topic-notification)
- used parameters: $notification_message, $topic_name, $topic_text, $topic_link, $author_name
Here you can find a tutorial on how to use filters:
https://developer.wordpress.org/plugins/hooks/filters/
You can use the following filters and change the output with your custom implementation:
- asgarosforum_filter_notify_topic_subscribers_message (new post-notification)
- used parameters: $notification_message, $topic_name, $answer_text, $answer_link, $author_name
- asgarosforum_filter_notify_global_topic_subscribers_message (new topic-notification)
- used parameters: $notification_message, $topic_name, $topic_text, $topic_link, $author_name
Here you can find a tutorial on how to use filters:
Quote from Gbr on January 22, 2018, 7:04 pmThx. Before making any mistake : should I modify these filters in the wp-content/plugins/asgaros-forum/includes/forum-notifications.php file ?
Thx. Before making any mistake : should I modify these filters in the wp-content/plugins/asgaros-forum/includes/forum-notifications.php file ?
Quote from Asgaros on January 23, 2018, 6:44 pmPlease have a look at the following answer:
Please have a look at the following answer: