ost'; } else { $posttable = "forum_post_{$thread['posttableid']}"; } $pic = DB::fetch_first("SELECT fa.attachment, fa.remote FROM ".DB::table($posttable)." fp LEFT JOIN ".DB::table('forum_attachment')." fa ON fp.tid=fa.tid AND fp.pid=fa.pid WHERE fp.tid='$tid' AND fp.first=1 AND fa.isimage IN (1, -1) LIMIT 0,1"); return $pic; } } ?>