function attach_find_by_pid($pid) { $attachlist = attach__find(array('pid' => $pid), array(), 1, 1000); if ($attachlist) { foreach ($attachlist as &$attach) { attach_format($attach); } } return $attachlist; }
function format_reply($reply_data) { if (!$this->base_url) { $this->base_url = $this->now_url; } foreach ($reply_data as $k => $v) { //附件 $v = dz_attach_format($this->base_url, $v); if ($this->p_arr['is_download_file'] == 1) { $v = attach_format($this->base_url, $v); } $v = media_format($v, $this->base_url); // $format_arr = format_article_imgurl($this->base_url, $v); //处理图片路径 $reply_data[$k] = $format_arr['message']; } $reply_filter_html = $this->p_arr['reply_filter_html']; if ($this->p_arr['is_download_file'] == 1) { $a_key = array_search('0', $reply_filter_html); if (!$a_key) { unset($reply_filter_html[$a_key]); } //如果要下载附件,不要去除a标签 } $format_args = array('is_fiter' => $this->p_arr['is_fiter_reply'], 'show_type' => 'reply', 'test' => 2, 'result_data' => $reply_data, 'replace_rules' => $this->p_arr['reply_replace_rules'], 'filter_html' => $reply_filter_html, 'filter_data' => $this->p_arr['reply_filter_rules']); $reply_data = filter_article($format_args); return $reply_data; }