|
Joined: Jan 2009
Posts: 92
Journeyman
|
Journeyman
Joined: Jan 2009
Posts: 92 |
We have a board that started a long time ago with UBB 5.44b and over the years was upgraded to UBB Threads 7.5.4.2. Early on with 5.44b we allowed Anonymous users to post until spam became a problem. When we upgraded the board and required registration, we deleted all the spam.
We now have a number of posts that are listed as anonymous, but want to change them to reflect the appropriate users who now have accounts that posted them. Is there a way either someone with admin or moderator privileges can do that?
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
The only way to accomplish that would be with SQL commands, so it would be pretty tedious as you'd have to do them one at a time. You'd need the userid and the postid and then you'd run a SQL command like (replacing userid and postid with the actual numbers):
update ubbt_POSTS set USER_ID='userid' where POST_ID='postid'
|
|
|
|
Joined: Jan 2008
Posts: 514
addict
|
addict
Joined: Jan 2008
Posts: 514 |
Now if I could figure out the ownerkey I could resurrect a post from one of our users who died a few years ago but was a huge impact on our community.
|
|
|
|
Joined: Jan 2009
Posts: 92
Journeyman
|
Journeyman
Joined: Jan 2009
Posts: 92 |
Thanks Rick - Sounds like a project sometime to do a SQL query, find all the Anon posts, then mark up who posted them and map to the userid. I guess it could be edited as a blanket sql script to execute so we can update the posts.
This might be a feature you'd want to consider for V8. I know it is possible for an admin to change the poster in phpBB3.
|
|
|
|
Joined: Jan 2009
Posts: 92
Journeyman
|
Journeyman
Joined: Jan 2009
Posts: 92 |
Ok - I'm not a SQL guru. I extracted the data and created a spreadsheet that generated the SQL statements. I can execute each line individually. When I try to do more than one line it gives me a SQL Syntax error #1064. How do I paste in multiple lines to execute all at once so I don't get the error? I've tried line feed, comma and semicolon between the commands, but nothing works. Here is the sample data for 3 lines (of about 900)
update ubbt_POSTS set USER_ID=15 where POST_ID=2120 update ubbt_POSTS set USER_ID=24 where POST_ID=325 update ubbt_POSTS set USER_ID=24 where POST_ID=395
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
update ubbt_POSTS set USER_ID='15' where POST_ID='2120'
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
Joined: Aug 2006
Posts: 1,358 |
Did you execute the queries from the control panel or from phpmyadmin?
If you used control panel, try using phpmyadmin, and seperate the queries using semicolon.
|
|
|
|
Joined: Jan 2009
Posts: 92
Journeyman
|
Journeyman
Joined: Jan 2009
Posts: 92 |
I did it in the control panel. I can try in the phpmyadmin when I get back tonight. It took the single line command ok without the quotes. In phpmyadmin, should the values be in single quotes?
|
|
|
|
Joined: Dec 2003
Posts: 6,562 Likes: 78
|
Joined: Dec 2003
Posts: 6,562 Likes: 78 |
The only way to accomplish that would be with SQL commands, so it would be pretty tedious as you'd have to do them one at a time. You'd need the userid and the postid and then you'd run a SQL command like (replacing userid and postid with the actual numbers):
update ubbt_POSTS set USER_ID='userid' where POST_ID='postid'
Notice Rick's comment.it would be pretty tedious as you'd have to do them one at a time.
Blue Man Group There is no such thing as stupid questions. Just stupid answers
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
I did it in the control panel. I can try in the phpmyadmin when I get back tonight. It took the single line command ok without the quotes. In phpmyadmin, should the values be in single quotes? you only need to quote string stuff... but you CAN quote numerics, if you really just want to or are compelled to i never do
|
|
|
|
Joined: Jan 2009
Posts: 92
Journeyman
|
Journeyman
Joined: Jan 2009
Posts: 92 |
That worked (quote & ; delimiter in phpmyadmin). I updated the post count afterwards and all looks good. Thanks for the help!
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
1 members (Nightcrawler),
737
guests, and
131
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|