UBB.Dev
Posted By: JoshPet [6.3] Update B_ParentUser for older posts - 04/21/2003 10:59 AM
Mod Name / Version - Update B_ParentUser for older posts
Description - The B_ParentUser field is a new field added back for 6.3 which holds the user number of the person you are replying to. It's how the "Re: Username" is displayed in flat mode. While this was a standard feature in UBB.Threads prior to version 6.2, it was removed, and now has been added back. This leaves all your old posts without a clue as to who they are in reply to.
This script runs down through all your posts, grabs the user number of the person who you are replying to and fills in B_ParentUser so that the "Re: Username" will display for all posts.
Pre-requisites - UBB.Threads 6.3
Author - JoshPet - www.joshuapettit.com
Credits - my idea / my creation
Files Altered - none
Database Altered - no
New Files - updateposts.php
Any other info - This is alot of queries on the database. Use at your own Risk - BACKUP your Database First!!!. This worked for me with about 50,000 posts, but if you had alot of posts, it may time out. Although I don't believe it could do any harm if it times out. It just won't update all the posts.

Instructions - Copy into your threads directory and run in your browser.

Attached File
76540-updateposts.php.zip  (28 downloads)
Posted By: Ian_W Re: [6.3] Update B_ParentUser for older posts - 04/21/2003 11:29 AM
Thanks Josh, we will use at our own Rish

BTW - is there anyway to do a similar thing with the last post column in the postlist page?
[]Credits - my idea / my creation[/]
Posted By: JoshPet Re: [6.3] Update B_ParentUser for older posts - 04/21/2003 4:28 PM
Good Idea. Probably could tweak it to do that.

Dave - Glad you like it.
Posted By: JoshPet Re: [6.3] Update B_ParentUser for older posts - 04/21/2003 6:13 PM
[]Ian_W said:
Thanks Josh, we will use at our own Rish

BTW - is there anyway to do a similar thing with the last post column in the postlist page? [/]

Did the same thing to update Last Poster here.

Posted By: Ian_W Re: [6.3] Update B_ParentUser for older posts - 04/22/2003 2:01 AM
Cool - got to keep you on your toes
Works like a charm.
Posted By: AKD96 Re: [6.3] Update B_ParentUser for older posts - 04/22/2003 2:19 AM
Timed out on my board. No biggie though.
Posted By: JoshPet Re: [6.3] Update B_ParentUser for older posts - 04/22/2003 2:23 AM
ADK - I forgot to add.. if it didn't finish... it's coded to only deal with posts without a value.... so you shoudl be able to safely run it again.... until all the posts are filled in.
Should be harmless.

On large boards with a low time limit (or safe mode on) you might need to run it a couple of times.
Posted By: AKD96 Re: [6.3] Update B_ParentUser for older posts - 04/22/2003 2:39 AM
Ok. Thanks!

AKD
© UBB.Developers