PDA

View Full Version : Need help with a few functions


sunilvarma
12 Jul 2007, 12:08
Hi

I am planning to create a new hack (my first) and I need some information before I start.

1) How do I check if the first post of a thread has an attachment?

2) Can I know if that attachment is an image file?

3) How do I get the location of that image?

Please guide me with this stuff...

Thanks
Sunil Varma

Eikinskjaldi
12 Jul 2007, 12:39
Hi

I am planning to create a new hack (my first) and I need some information before I start.

1) How do I check if the first post of a thread has an attachment?
2) Can I know if that attachment is an image file?
3) How do I get the location of that image?

Please guide me with this stuff...

Thanks
Sunil Varma

1)


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


if it comes back with a value > 0 then it has at least one attachement.

2)


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


extension is jpg or gif or pdf or whatever

3) if you are storing your images in the db you will find them as data in filedata field of the attachment table. If on disk they live in forum/attachements/u/s/e/r/i/d