コード例 #1
0
ファイル: function.fastpick.php プロジェクト: edmundwong/V604
function fast_pick()
{
    global $_G;
    d_s('f_g');
    d_s('g_t');
    pload('F:spider');
    $url = $_GET['url'];
    $content = get_contents($url, array('cache' => -1));
    $get_time = d_e(0, 'g_t');
    $type = $_GET['type'] ? $_GET['type'] : 'bbs';
    $milu_set = pick_common_get();
    $data = (array) get_single_article($content, $url);
    if ($milu_set['fp_word_replace_open'] == 1 && !VIP) {
        //开启同义词替换
        $words = get_replace_words();
        if ($data['title']) {
            $data['title'] = strtr($data['title'], $words);
        }
        if ($data['content']) {
            $data['content'] = strtr($data['content'], $words);
        }
    }
    if ($milu_set['fp_article_from'] == 1) {
        //开启来源
        $data['fromurl'] = $url;
        if ($type == 'bbs' && $data['content']) {
            $data['content'] .= "[p=30, 2, left]" . milu_lang('article_from') . ':' . $url . "[/p]";
        }
    }
    $data['get_text_time'] = $get_time;
    $data['all_get_time'] = d_e(0, 'f_g');
    $data = $data ? $data : array();
    $data = js_base64_encode($data);
    $re = json_encode($data);
    return $re;
}
コード例 #2
0
ファイル: function.pick.php プロジェクト: edmundwong/V604
function show_rules_set($show = 1, $args = array())
{
    global $_G;
    pload('F:rules');
    $rules_hash = $_GET['rules_hash'] ? $_GET['rules_hash'] : $args['rules_hash'];
    $info = get_rules_info($rules_hash);
    if (DISCUZ_VERSION != 'X2') {
        $info = dstripslashes($info);
    }
    $url_var = unserialize($info['url_var']);
    //$info = dhtmlspecialchars($info);
    if (!$url_var) {
        return;
    }
    foreach ($url_var as $k => $v) {
        $html .= show_var_html($k, $v, $args['rules_set'][$k]);
    }
    if (!$show) {
        return $html;
    }
    $arr['page_get_type'] = $info['page_get_type'];
    $arr['page_link_rules'] = $info['page_link_rules'];
    $arr['page_url_test'] = $info['page_url_test'];
    $arr['html'] = $html;
    $arr = js_base64_encode($arr);
    echo json_encode($arr);
    //exit();
}