function getremotefile($file) { global $_G; @set_time_limit(0); if (!@readfile($_G['setting']['ftp']['attachurl'] . 'portal/' . $file)) { $ftp = new discuz_ftp(); if (!($_G['setting']['ftp']['connid'] = $ftp->connect())) { return FALSE; } $tmpfile = @tempnam($_G['setting']['attachdir'], ''); if ($ftp->ftp_get($_G['setting']['ftp']['connid'], $tmpfile, $file, FTP_BINARY)) { @readfile($tmpfile); @unlink($tmpfile); } else { @unlink($tmpfile); return FALSE; } } return TRUE; }