The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
attachment query
Hey.. I got a bit of a problem
Im ok at php but my mysql knowledge is a bit shoddy.. my question is what would be the coorect way to query the attachments, to show say the last 10 by forum id? Ive been looking thru attachment.php but im a bit stuck and my last few attempts have returned invalid mysql queries |
#2
|
||||
|
||||
hmm, attachments aren't stored with the forumid, because it would make some problems
you can try that way: [sql] SELECT attachment.attachmentid FROM attachment LEFT JOIN post USING(postid) LEFT JOIN thread USING(threadid) WHERE thread.forumid = X ORDER by attachment.dateline DESC LIMIT 10[/sql] |
#3
|
||||
|
||||
thnx xenon i will try this out
|
#4
|
||||
|
||||
PHP Code:
Quote:
|
#5
|
||||
|
||||
hmm, i think it's my fault
replace USING(postid) with USING(attachmentid) |
#6
|
||||
|
||||
ok that worked great my next question is, what should i echo to get the results (soz im needing so much help, i can code most of this but this part is a bit complex)
|
#7
|
||||
|
||||
hmm i think a linkt to attachment.php with attachment id would fit in perfectly
but i don'T exactly see what you want |
#8
|
||||
|
||||
well im trying to get it so that it will output an image of each attachement, i.e in the case of images the actual image, and if its a file it will show a default image, ( i know how to do that ) its just getting it to show the last x amount of images in actaul jpg or gif format etc on a page that im having a few probs with..
like the query to get them and what needs to be echo`d |
#9
|
||||
|
||||
bump
|
#10
|
||||
|
||||
look at that part of the postbit to see how to put out an attachment, i'm sure you can work something out of it
just get the needed values out of the attachmenttable PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|