Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jan 2009
Posts: 92
whk
Offline
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
R
Former Developer
Former Developer
R Offline
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):

SQL Query
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
whk
Offline
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
whk
Offline
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,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
update ubbt_POSTS set USER_ID='15' where POST_ID='2120'


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
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.


[Linked Image from siemons.org]
Joined: Jan 2009
Posts: 92
whk
Offline
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,560
Likes: 78
Joined: Dec 2003
Posts: 6,560
Likes: 78
Originally Posted by Rick
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):

SQL Query
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
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
Originally Posted by whk
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 laugh

i never do wink

Joined: Jan 2009
Posts: 92
whk
Offline
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!


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
3 members (rootman, Gizmo, Nightcrawler), 562 guests, and 186 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)