The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Export threads from a single user / Query modification
Hi all,
I need a bit support. A good friend of mine died and he actively posted in my forum and started several threads. So I would like to export all threads my friend started including the first post he wrote. I'd like to use this as a kind of memorial for all of his friends. The following query does a good job to get all of his postings, but I only want to export the threads including the first post. Could anyone help me how to modify the query? Code:
SELECT post.postid, post.threadid, thread.title, post.username, FROM_UNIXTIME(post.dateline) as date, post.pagetext from post, thread WHERE post.threadid = thread.threadid AND post.username = 'XXXXXXXXXX' ORDER BY date; Michael |
#2
|
||||
|
||||
Try changing:
Code:
post.threadid = thread.threadid Code:
post.postid = thread.firstpostid |
Благодарность от: | ||
tischtelefon2 |
#3
|
|||
|
|||
Thanks so much, Mark. Thanks so much.
--------------- Added [DATE]1484640652[/DATE] at [TIME]1484640652[/TIME] --------------- Mark, I hope it's okay that I ask another question. How do I need to modify the query if I want to extract all threads my friend started including all other postings(I mean replies) of theses threads? So I export the complete thread? Thanks so much. Michael |
Благодарность от: | ||
MarkFL |
#4
|
|||
|
|||
I think would be easier if you do another query to only get the secondary posts.
If you agree with me you can try something like this: 1 - Store threadid and firstpostid into variables. 2 - Query. Code:
SELECT * FROM post WHERE threadid = YourFriendThreadID and postid <> FirstPostID |
#5
|
||||
|
||||
Quote:
Code:
SELECT post.* FROM post AS post WHERE post.threadid IN (SELECT thread.threadid FROM thread AS thread WHERE thread.postusername = 'XXXXX') |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|