The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Last Post Minute Query
Logician, is there an easy way to pull out the last poster in your query for the last post minute hack? If I can do it through there, I can cut another query and have it give me the right result all at the same time.
|
#2
|
||||
|
||||
I believe if changing the query to this should help:
SELECT post.dateline AS lastpostminute, thread.threadid, user.username FROM post, thread LEFT JOIN user ON user.userid = post.userid WHERE thread.forumid = $forumid AND thread.threadid = post.threadid ORDER BY post.dateline DESC LIMIT 1 Then you can use variable $lastpostminDB[username] |
#3
|
||||
|
||||
LOL I just did this about 5 minutes ago. Here is the code I used and it seems to work.
PHP Code:
Will this code work or am I just lucky right now and it will mess up later? |
#4
|
||||
|
||||
I say go with my code (if it is working, I didn't test it!). For some reason getting the username from thread/post tables sometimes not works. This is why I put the left join query in my code to get it from the user table.
|
#5
|
||||
|
||||
Thank you, sir. I'll go test it now and report back.
|
#6
|
||||
|
||||
Ok, tested and got no errors. How do I call the userid for the link to the user's profile now? I have been trying everything and can't find anything to work.
|
#7
|
||||
|
||||
SELECT post.dateline AS lastpostminute, thread.threadid, user.username, user.userid
FROM post, thread LEFT JOIN user ON user.userid = post.userid WHERE thread.forumid = $forumid AND thread.threadid = post.threadid ORDER BY post.dateline DESC LIMIT 1 |
#8
|
||||
|
||||
Thank you, again, sir. I guess I still don't have the hang of these queries, yet.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|