function get_single_article($content, $url, $args = array()) { global $_G; extract($args); if (strlen(trim($content)) < 1) { return; } d_s('evo'); $get_type = $_GET['get_type'] ? intval($_GET['get_type']) : $get_type; $get_type = $get_type ? $get_type : 1; $milu_set = pick_common_get(); $rules_info = match_rules($url, $content, $get_type, 0); if (is_array($rules_info)) { pload('F:fastpick'); $data = rules_get_article($content, $rules_info); write_evo_errlog($data, $url, $rules_info); } else { $data = (array) cloud_match_rules($get_type, $url, $content); //从云端下载规则 这里应该做点优化,暂时没想到方法。 if (!$data['content'] && $milu_set['fp_open_auto'] == 1) { //开启智能获取 pload('C:HtmlExtractor'); pload('F:article'); $he = new HtmlExtractor($content, $url); $data = (array) $he->get_text(); $data['content'] = dz_attach_format($url, $data['content']); $arr = format_article_imgurl($url, $data['content']); $data['content'] = $arr['message']; $del_dom_rules = array('div[id*=share]', 'div[class*=page]'); foreach ($del_dom_rules as $k => $v) { $data['content'] = dom_filter_something($data['content'], $v, 2); } unset($data['evo_title_info']); } } if ($_GET['type'] == 'bbs') { $data['content'] = media_htmlbbcode($data['content'], $url); $data['content'] = img_htmlbbcode($data['content'], $url); } $data['evo_time'] = d_e(0, 'evo'); return $data; }
function _public_add_info($type = 'bbs') { $info = $this->_article_info(); if (!$info) { return; } if ($type == 'bbs') { require_once libfile('function/editor'); $info['content'] = dstripslashes($info['content']); $info['content'] = img_htmlbbcode($info['content'], $info['page_url']); $info['content'] = media_htmlbbcode($info['content'], $info['page_url']); $info['content'] = audio_htmlbbcode($info['content'], $info['page_url']); $info['content'] = htmlspecialchars_decode(html2bbcode($info['content'])); $info['content'] = dstripslashes(format_html($info['content'])); $script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >'; $script .= ' var subject = $("show_title").innerHTML; var message = $("show_content").innerHTML; $("subject").value= subject; message = message.replace(/<p>([\\s\\S]*?)<\\/p>/ig, "$1<br />"); message = message.replace(/<center>([\\s\\S]*?)<\\/center>/ig, "[align=center]$1[/align]"); $(\'e_textarea\').value = message; $("subject").focus();'; $script .= '</script>'; } else { if ($type == 'portal') { $script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >'; $script .= ' var subject = $("show_title").innerHTML; var message = $("show_content").innerHTML; $("title").value= subject; $("from").value= \'' . $this->_public_data($info['from']) . '\'; document.getElementsByName(\'fromurl\')[0].value = \'' . $this->_public_data($info['url']) . '\'; document.getElementsByName(\'author\')[0].value = \'' . $this->_public_data($info['author']) . '\'; $(\'uchome-ttHtmlEditor\').value = message; var p = window.frames[\'uchome-ifrHtmlEditor\']; var obj = p.window.frames[\'HtmlEditor\']; obj.document.body.innerHTML = message; edit_save(); $("title").focus()'; $script .= '</script>'; } else { if ($type == 'blog') { $script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >'; $script .= ' var subject = $("show_title").innerHTML; var message = $("show_content").innerHTML; $("subject").value= subject; document.getElementsByName(\'tag\')[0].value = \'' . $this->_public_data($info['article_tag']) . '\'; $(\'uchome-ttHtmlEditor\').value = message; var p = window.frames[\'uchome-ifrHtmlEditor\']; var obj = p.window.frames[\'HtmlEditor\']; obj.document.body.innerHTML = message; edit_save(); $("subject").focus()'; $script .= '</script>'; } } } return $script; }
function album_article_content($arr) { global $_G; $setarr['pic'] = $arr['pic'] == 0 ? '' : $arr['pic']; if ($arr['pic']) { $picflag = $_G['setting']['ftp']['on'] == 1 ? 2 : 1; DB::update("home_blog", array('picflag' => $picflag), array('blogid' => $arr['aid'])); } $arr['content'] = dstripslashes($arr['content']); $arr['content'] = media_htmlbbcode($arr['content'], $arr['page_url'], 'blog'); if (DISCUZ_VERSION == 'X2') { //2.0版本 $arr['content'] = addslashes($arr['content']); } //$arr['content'] = dhtmlspecialchars($arr['content']); $setarr['message'] = $arr['content']; DB::update('home_blogfield', $setarr, array('blogid' => $arr['aid'])); }