XF 2.3 Getting the actual attachment url through a sql query?

Mave

Active member
I'm grabbing my posts through a sql query, however pictures (that are attachments) result in:

Code:
[ATTACH type="full"]529[/ATTACH]

What I want is the actual url, for example for the code above, it would need to be:

Code:
jbrcjw5pq0q81_jpg-jpg.529

My current sql query is:

SQL:
    SELECT t.*, p.* FROM `xf_thread` t
    left outer join xf_post p on t.thread_id = p.thread_id
    left outer join xf_thread_prefix x on x.prefix_id = t.prefix_id
    WHERE
    (      t.reply_count > 1
       and p.post_id <> t.first_post_id
       and t.thread_id IN (39865,31108,41372,23593,30497,44202,42726,2010, 36611, 43563, 30797, 23594, 44226)
       and p.user_id = 1
          )
     OR
     (
             p.post_id = t.first_post_id
         and t.prefix_id IN(3,6,7,5)
     )

    ORDER BY p.post_id DESC LIMIT 20';

Can anyone help me achieve this?
Thank you.
 
Top Bottom