ThorstenA
03-19-2010, 08:30 AM
This query displays you a list of all attachments within the actual forum so you can have this list done within another template:
icon like word, excel etc | <a href="link to the post">Filename</a>
SELECT post.userid, post.username, thread.threadid, thread.title, SUBSTRING(filename,1,LENGTH(filename)-(LENGTH(extension)+1)) AS filename, extension, post.postid
FROM attachment,thread,post
WHERE thread.forumid = " . $foruminfo['forumid'] . "
AND thread.threadid=post.threadid
AND post.postid = attachment.postid
AND extension NOT IN (\"jpg\",\"gif\",\"bmp\",\"tiff\")
ORDER BY attachment.postid DESC
icon like word, excel etc | <a href="link to the post">Filename</a>
SELECT post.userid, post.username, thread.threadid, thread.title, SUBSTRING(filename,1,LENGTH(filename)-(LENGTH(extension)+1)) AS filename, extension, post.postid
FROM attachment,thread,post
WHERE thread.forumid = " . $foruminfo['forumid'] . "
AND thread.threadid=post.threadid
AND post.postid = attachment.postid
AND extension NOT IN (\"jpg\",\"gif\",\"bmp\",\"tiff\")
ORDER BY attachment.postid DESC