The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Thread/Post Title Query Help
I recently changed this option to YES:
AdminCP -> vBulletin Options -> Message Posting and Editing Options -> Automatically Quote Post / Thread Title So, now I'd like to get all the old posts updated. Any ideas on a query I can run that will automatically update all post titles to "Re: [thread title]" if the post title is blank? |
#2
|
|||
|
|||
It wouldnt be a simple query (most 2 queries per thread at least)
1) Query every thread to get the title for each thread 2) Write the post title of each post in each threadid to the thread title if its empty. |
#3
|
||||
|
||||
I'm pretty sure it can be done with a single query, using joins and an embedded select. I just haven't played around with it much yet. Just wondering if anyone else had anything similar.
EDIT: Got it worked out. *** WARNING: USE AT YOUR OWN RISK. MAKE A BACKUP OF YOUR DATABASE FIRST. MAYBE TWO TO BE SAFE. NOT RESPONSIBLE. *** This worked for me to update all the old post titles to "Re: [thread title]" if they were currently blank. If you have a lot of posts this can take a while to execute. I have about 365k posts and it took about 10 minutes. The query: Code:
UPDATE post SET post.title = concat("Re: ",(SELECT thread.title FROM thread WHERE thread.threadid = post.threadid)) WHERE post.title = "" |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|