query("SELECT * FROM " . PREFIX . "_forum_files WHERE topic_id = '$tid' and file_attach = '1'");
while ($row = $db->get_row($get_attachment))
{
if ($row['file_type'] == "image")
{
$img_full = $config['http_home_url'].'uploads/forum/images/'.$row['onserver'];
$attachment = "";
}
elseif ($row['file_type'] == "thumb")
{
$img_full = $config['http_home_url'].'uploads/forum/images/'.$row['onserver'];
$img_thumb = $config['http_home_url'].'uploads/forum/thumbs/'.$row['onserver'];
$hs_expand = "onClick=\"return hs.expand(this)\"";
$attachment = "";
}
else
{
$attachment_down = $a_forum_url."act=attachment&id=".$row['file_id'];
$attachment = "{$row['file_name']} ({$row['dcount']} | ".mksize($row['file_size']).")";
//$onserver_url = "{$config['http_home_url']}uploads/forum/files/{$row['onserver']}";
}
if (!$ajax_edit_attach){
$tpl->result['posts'] = str_replace('[attachment='.$row['file_id'].']', $attachment, $tpl->result['posts']);
//$tpl->result['posts'] = preg_replace("#\[attachment={$row['file_id']}:(.*)\]#i", $onserver_url, $tpl->result['posts']);
}
else{
$post_text = str_replace('[attachment='.$row['file_id'].']', $attachment, $post_text);
//$post_text = preg_replace("#\[attachment={$row['file_id']}:(.*)\]#i", $onserver_url, $post_text);
}
}
?>