Exemplo n.º 1
0
 public function ajaxGalleryword()
 {
     $filter = I('post.filter');
     $goodLists = S('goodLists');
     if (!$goodLists) {
         $Goods = M('index_goods');
         $goodLists = $Goods->where(array('is_show' => 1, 'status' => 1))->order('id DESC')->select();
         S('goodLists', $goodLists, 3600 * 6);
     }
     if ($goodLists) {
         $str = '';
         if (!$filter) {
             $str .= '<h2><strong>' . $goodLists[0]['pro_name'] . '</strong><br>';
             $str .= $goodLists[0]['pro_subnamee'] . '</h2>';
             $str .= '<p>' . $goodLists[0]['description'] . '</p><br>';
             $str .= '<a target="_blank" href="' . U('galleryList', array('id' => $goodLists[0]['id'])) . '" class="btn-brd-primary">详细查看</a>';
         } else {
             $filter = $filter - 1;
             $str .= '<h2><strong>' . $goodLists[$filter]['pro_name'] . '</strong><br>';
             $str .= $goodLists[$filter]['pro_subnamee'] . '</h2>';
             $str .= '<p>' . $goodLists[$filter]['description'] . '</p><br>';
             $str .= '<a target="_blank" href="' . U('galleryList', array('id' => $goodLists[$filter]['id'])) . '" class="btn-brd-primary">详细查看</a>';
         }
     }
     echo !empty($str) ? compress_html($str) : 0;
 }
Exemplo n.º 2
0
function get_template($path)
{
    $object = ['template' => ''];
    $path = VUE_PATH . "script/template/" . $path;
    if (is_file($path . ".min.html")) {
        $content = file_get_contents($path . ".min.html");
        $object['template'] = json_encode($content, JSON_UNESCAPED_UNICODE);
    } elseif (is_file($path . ".html")) {
        $content = file_get_contents($path . ".html");
        $object['template'] = json_encode(compress_html($content), JSON_UNESCAPED_UNICODE);
    } else {
        $object['template'] = json_encode("<h3 class='alert alert-danger'>模板未找到!!!</h3>", JSON_UNESCAPED_UNICODE);
    }
    if (is_file($path . ".js")) {
        $content = file_get_contents($path . ".js");
        foreach (['methods', 'paramAttributes', 'data', 'props', 'created', 'data'] as $v) {
            $match = [];
            if (preg_match("/_{$v}_[ ]*=[ ]*([\\s\\S]+?)[;]*\\/\\/_{$v}_/", $content, $match)) {
                if (isset($match[1])) {
                    $object[$v] = $match[1];
                }
            }
        }
    }
    $map = [];
    foreach ($object as $name => $v) {
        $map[] = $name . ":" . $v;
    }
    return "{" . implode($map, ",") . "}";
}
Exemplo n.º 3
0
/**
 *	KK输出视图函数,压缩了HTML
 */
function kk_show_view($view, $data = array())
{
    $ci =& get_instance();
    $ci->load->plugin('compress_html');
    //$ci->load->plugin('spaceless');
    $html = $ci->load->view($view, $data, true);
    // 输出压缩过的html
    echo compress_html($html);
    //echo $html;
}
Exemplo n.º 4
0
 public function test2()
 {
     layout(false);
     $this->dialog_title = '测试';
     $this->dialog_content = '测试内容';
     $html = $this->fetch('dialog');
     $html = compress_html($html);
     $array = array('dialog' => 'callBack(\'' . $html . '\')');
     echo json_encode($array);
 }
Exemplo n.º 5
0
 public function dialog()
 {
     layout(false);
     $this->dialog_title = '测试';
     $this->post_url = '/Manage/Modal/test';
     // $this->road_num = 'bill_name';
     $this->dialog_content = $this->fetch('Modal/dialog_content');
     $html = $this->fetch('Modal/dialog_form');
     $html = compress_html($html);
     $array = array('dialog' => 'callBack(\'' . $html . '\')', 'eval' => 'eva("a")', 'eval2' => 'eva2("ccc")');
     echo json_encode($array);
 }
Exemplo n.º 6
0
 public function ajaxNews()
 {
     $news = S('news', null);
     $news = S('news');
     if (!$news) {
         $NewsModel = M('news_contents');
         $news = $NewsModel->field('id,title,create_time,thumbnail,description')->where(array('is_show' => 1))->order('create_time DESC')->limit(4)->select();
         S('news', $news, 3600 * 6);
     }
     if ($news) {
         $str = '';
         foreach ($news as $k => $v) {
             $str .= '<div class="col-md-6" style="margin-bottom: 20px;">';
             $str .= '<div class="features"><img src="/Public/News/' . $v['thumbnail'] . '">';
             $str .= '<div class="features-in"><h3><a target="_blank" href="' . U('News/newspage', array('id' => $v['id'])) . '">' . $v['title'] . '</a></h3>';
             $str .= '<p>' . msubstr($v['description'], 0, 30, 'utf-8', true) . '</p></div></div>';
             $str .= '<div style="float: right;">' . date('Y-m-d H:i', $v['create_time']) . '</div></div>';
         }
     }
     echo !empty($str) ? compress_html($str) : 0;
 }
Exemplo n.º 7
0
 public function add_station()
 {
     /*$this->dialog_title = '添加车站';
       $this->post_url = '/Manage/Page/do_add_station';*/
     $id = I('get.id');
     //有id为更新
     if ($id) {
         $this->dialog_title = '修改车站';
         $this->id = $id;
         $this->station = M('Station')->getById($id);
         $this->post_url = '/Manage/Page/change_station';
     } else {
         $this->dialog_title = '添加车站';
         $this->post_url = '/Manage/Page/do_add_station';
     }
     $this->dialog_content = $this->fetch('Page/add_station');
     $html = $this->fetch('Modal/dialog_form');
     $html = compress_html($html);
     $array = array('dialog' => 'callBack(\'' . $html . '\')');
     echo json_encode($array);
 }
Exemplo n.º 8
0
/**
* 自动写入token到form表单,系统内部函数,不对外公开
* @param string $content 需要添加token的html字符串
* @return string 成功返回添加完成token的html字符串
*/
function callback($content)
{
    $content = str_replace("\r", '', $content);
    $content = str_replace("\n", '', $content);
    $token_key = substr(SITE_URL, 0, -1) . $_SERVER['REQUEST_URI'];
    foreach ($_REQUEST as $k => $v) {
        if ($k == TOKEN_NAME) {
            continue;
        }
        $token_key .= $k;
    }
    $token_key = md5($token_key);
    if (!isset($_SESSION[$token_key]) || !isset($_SESSION[TOKEN_NAME]) || !isset($_SESSION[$_SESSION[TOKEN_NAME]])) {
        $val = md5(microtime() . rand());
        if (!isset($_SESSION[TOKEN_NAME]) || !isset($_REQUEST[TOKEN_NAME])) {
            $_SESSION[TOKEN_NAME] = $token_key;
        }
        $_SESSION[$token_key] = $val;
    }
    $content = preg_replace('/<form(.*?)>(.*?)<\\/form>/i', '<form$1><input type="hidden" value="' . $_SESSION[$_SESSION[TOKEN_NAME]] . '" 		name="' . TOKEN_NAME . '"/>$2</form>', $content);
    chdir(dirname($_SERVER['SCRIPT_FILENAME']));
    if (!DEBUG) {
        $content = compress_html($content);
    }
    return $content;
}
Exemplo n.º 9
0
function load_tpl($tpl, $open_token = true)
{
    $tpl = trim($tpl);
    if (!file_exists($tpl)) {
        if (APP_DEBUG) {
            die('template file: ' . $tpl . ' not exists. ');
        } else {
            die('template file not exists. ');
        }
    }
    $cache_file = RUNTIME_CACHE . md5($tpl) . '.php';
    if (!file_exists($cache_file) || filemtime($cache_file) < filemtime($tpl) || $open_token) {
        $content = file_get_contents($tpl);
        $content = str_replace("\r", '', $content);
        $content = str_replace("\n", '', $content);
        $token_key = substr(SITE_URL, 0, -1) . $_SERVER['REQUEST_URI'];
        foreach ($_REQUEST as $k => $v) {
            if ($k == HIDDEN_TOKEN_NAME) {
                continue;
            }
            $token_key .= $k;
        }
        $token_key = md5($token_key);
        if ($open_token) {
            if (!isset($_SESSION[$token_key]) || !isset($_SESSION[HIDDEN_TOKEN_NAME]) || !isset($_SESSION[$_SESSION[HIDDEN_TOKEN_NAME]])) {
                $val = md5(microtime());
                if (!isset($_SESSION[HIDDEN_TOKEN_NAME]) || !isset($_REQUEST[HIDDEN_TOKEN_NAME])) {
                    $_SESSION[HIDDEN_TOKEN_NAME] = $token_key;
                }
                $_SESSION[$token_key] = $val;
            }
            $content = preg_replace('/<form(.*?)>(.*?)<\\/form>/i', '<form$1><input type="hidden" value="' . $_SESSION[$_SESSION[HIDDEN_TOKEN_NAME]] . '" name="' . HIDDEN_TOKEN_NAME . '"/>$2</form>', $content);
        }
        //parse include
        $ret = preg_match_all('/<\\{\\s*include\\s*=\\s*"(.*?)"\\}>/i', $content, $match);
        if ($ret) {
            foreach ($match[1] as $k => $v) {
                $tArr = explode('/', $v);
                $tCount = count($tArr);
                if ($tCount == 3) {
                    $content = str_ireplace($match[0][$k], '<?php require_once(load_tpl(APP_TPL."' . $tArr[0] . '".\'/\'."' . $tArr[2] . '".\'.html\')); ?>', $content);
                } elseif ($tCount == 2) {
                    $content = str_ireplace($match[0][$k], '<?php require_once(load_tpl(APP_TPL."' . $tArr[0] . '".\'/\'."' . $tArr[1] . '".\'.html\')); ?>', $content);
                }
                unset($tArr);
            }
        }
        $content = preg_replace('/<\\{\\s*\\$(.*?)\\}>/i', '<?php echo \\$${1}; ?>', $content);
        $content = preg_replace('/\\{\\s*u(.*?)\\}/i', '<?php echo U${1}; ?>', $content);
        $content = preg_replace('/<\\{\\s*if\\s*(.*?)\\s*\\}>/i', '<?php if(${1}) { ?>', $content);
        $content = preg_replace('/<\\{\\s*else\\s*if\\s*(.*?)\\s*\\}>/i', '<?php } elseif(${1}) { ?>', $content);
        $content = preg_replace('/<\\{\\s*else\\s*\\}>/i', '<?php } else { ?>', $content);
        $content = preg_replace('/<\\{\\s*\\/if\\s*\\}>/i', '<?php } ?>', $content);
        $content = preg_replace('/<\\{\\s*loop(.*?)\\s*\\}>/i', '<?php foreach${1} { ?>', $content);
        $content = preg_replace('/<\\{\\s*\\/loop\\s*\\}>/i', '<?php } ?>', $content);
        $content = preg_replace('/<\\{\\s*foreach(.*?)\\s*\\}>/i', '<?php foreach${1} { ?>', $content);
        $content = preg_replace('/<\\{\\s*\\/foreach\\s*\\}>/i', '<?php } ?>', $content);
        $content = preg_replace('/<\\{\\s*(.*?)\\}>/i', '<?php echo ${1}; ?>', $content);
        $content = compress_html($content);
        file_put_contents($cache_file, $content);
    }
    return $cache_file;
}
Exemplo n.º 10
0
function load_tpl($tpl, $open_token = true)
{
    $tpl = trim($tpl);
    if (!file_exists($tpl)) {
        if (APP_DEBUG) {
            die('template file: ' . $tpl . ' not exists. ');
        } else {
            die('template file not exists. ');
        }
    }
    $cache_file = RUNTIME_CACHE . $GLOBALS['_Module'] . DS . md5($tpl) . '.php';
    if (!file_exists($cache_file) || filemtime($cache_file) < filemtime($tpl) || $open_token) {
        $content = file_get_contents($tpl);
        $content = str_replace("\r", '', $content);
        $content = str_replace("\n", '', $content);
        $token_key = substr(SITE_URL, 0, -1) . $_SERVER['REQUEST_URI'];
        foreach ($_REQUEST as $k => $v) {
            if ($k == HIDDEN_TOKEN_NAME) {
                continue;
            }
            $token_key .= $k;
        }
        $token_key = md5($token_key);
        if ($open_token) {
            if (!isset($_SESSION[$token_key]) || !isset($_SESSION[HIDDEN_TOKEN_NAME]) || !isset($_SESSION[$_SESSION[HIDDEN_TOKEN_NAME]])) {
                $val = md5(microtime());
                if (!isset($_SESSION[HIDDEN_TOKEN_NAME]) || !isset($_REQUEST[HIDDEN_TOKEN_NAME])) {
                    $_SESSION[HIDDEN_TOKEN_NAME] = $token_key;
                }
                $_SESSION[$token_key] = $val;
            }
            $content = preg_replace('/<form(.*?)>(.*?)<\\/form>/i', '<form$1><input type="hidden" value="' . $_SESSION[$_SESSION[HIDDEN_TOKEN_NAME]] . '" name="' . HIDDEN_TOKEN_NAME . '"/>$2</form>', $content);
        }
        //parse include
        /*
        	如下
        	<{include="Index/test"}> 这里的action是Index,对应的action的方法method是test,而且模板也是test.html
        	<{include="Index/test/test_view"}> 这里的action是Index,对应的action的方法method是test,而且模板是test_view.html
        */
        $left = C('template-left_delimiter');
        $right = C('template-right_delimiter');
        $ret = preg_match_all('/' . $left . '\\s*include\\s*=\\s*"(.*?)"' . $right . '/i', $content, $match);
        if ($ret) {
            foreach ($match[1] as $k => $v) {
                $tArr = explode('/', $v);
                $tCount = count($tArr);
                if ($tCount == 3) {
                    $content = str_ireplace($match[0][$k], '<?php require_once(load_tpl(APP_TPL."' . $tArr[0] . '".\'/\'."' . $tArr[2] . '".\'.' . C('template-suffix') . '\')); ?>', $content);
                } elseif ($tCount == 2) {
                    $content = str_ireplace($match[0][$k], '<?php require_once(load_tpl(APP_TPL."' . $tArr[0] . '".\'/\'."' . $tArr[1] . '".\'.' . C('template-suffix') . '\')); ?>', $content);
                }
                unset($tArr);
            }
        }
        $content = preg_replace('/' . $left . '\\s*\\$(.*?)' . $right . '/i', '<?php echo \\$${1}; ?>', $content);
        $content = preg_replace('/' . $left . '\\s*u(.*?)' . $right . '/i', '<?php echo U${1}; ?>', $content);
        $content = preg_replace('/' . $left . '\\s*if\\s*(.*?)\\s*' . $right . '/i', '<?php if(${1}) { ?>', $content);
        $content = preg_replace('/' . $left . '\\s*else\\s*if\\s*(.*?)\\s*' . $right . '/i', '<?php } elseif(${1}) { ?>', $content);
        $content = preg_replace('/' . $left . '\\s*else\\s*' . $right . '/i', '<?php } else { ?>', $content);
        $content = preg_replace('/' . $left . '\\s*\\/if\\s*' . $right . '/i', '<?php } ?>', $content);
        $content = preg_replace('/' . $left . '\\s*loop(.*?)\\s*' . $right . '/i', '<?php foreach${1} { ?>', $content);
        $content = preg_replace('/' . $left . '\\s*\\/loop\\s*' . $right . '/i', '<?php } ?>', $content);
        $content = preg_replace('/' . $left . '\\s*foreach(.*?)\\s*' . $right . '/i', '<?php foreach${1} { ?>', $content);
        $content = preg_replace('/' . $left . '\\s*\\/foreach\\s*' . $right . '/i', '<?php } ?>', $content);
        $content = preg_replace('/' . $left . '\\s*(.*?)' . $right . '/i', '<?php echo ${1}; ?>', $content);
        $content = compress_html($content);
        file_put_contents($cache_file, '<?php defined(\'IN_FW\') or die(\'deny\'); ?> ' . $content);
    }
    return $cache_file;
}
Exemplo n.º 11
0
 function mark()
 {
     $this->headfoot();
     $this->labelload();
     $this->labellink();
     $this->base();
     $this->matrix();
     $this->H = str_replace('{maccms:sitetid}', $this->C["sitetid"], $this->H);
     $this->H = str_replace('{maccms:siteid}', $this->C["siteid"], $this->H);
     $labelRule = buildregx('{maccms:([\\S]+)\\s+(.*?)}([\\s\\S]+?){/maccms:\\1}', "");
     preg_match_all($labelRule, $this->H, $matches1);
     for ($i = 0; $i < count($matches1[0]); $i++) {
         $this->markval = $matches1[0][$i];
         $this->markname = $matches1[1][$i];
         $this->markpar = $matches1[2][$i];
         $this->markdes = $matches1[3][$i];
         $this->mark_sql();
         switch ($this->markname) {
             case "php":
                 $this->runphp();
                 break;
             case "area":
             case "lang":
             case "year":
             case "letter":
             case "tag":
                 $this->expandlist();
                 break;
             case "menu":
             case "class":
             case "art":
             case "vod":
             case "topic":
             case "link":
             case "gbook":
             case "comment":
                 $this->datalist();
                 break;
         }
     }
     unset($matches1);
     replaceTplCustom();
     if ($GLOBALS['MAC']['app']['compress'] == 1) {
         $this->H = compress_html($this->H);
     }
 }
Exemplo n.º 12
0
 public function ajaxCommentreply()
 {
     $post = I('post.');
     $post['reply_time'] = time();
     $badword = M('badwords')->getField('badword', true);
     $badword1 = array_combine($badword, array_fill(0, count($badword), '*'));
     $data['username'] = strtr($data['username'], $badword1);
     $data['contents'] = strtr($data['contents'], $badword1);
     $commentModel = M('blog_comment_replies');
     if ($commentModel->create($post)) {
         $getComId = $commentModel->add($post);
         if ($getComId) {
             $com = $commentModel->where(array('id' => $getComId))->find();
             $str = '';
             $str .= '<div class="media" style="padding-bottom:10px"><a href="javascript:;" class="pull-left">';
             $str .= '<img src="/Public/Index/Header/' . $com['header'] . '.png" alt="" class="media-object"></a>';
             $str .= '<div class="media-body" id="comment' . $com['id'] . '">';
             $str .= '<h4 class="media-heading">' . $com['username'] . '<span>' . date('Y-m-d H:i', $com['reply_time']) . '</span></h4>';
             $str .= '<div style="word-break:break-all">' . $com['contents'] . '</div></div></div>';
         }
     }
     echo !empty($str) ? compress_html($str) : 0;
 }
Exemplo n.º 13
0
function updateCacheFile()
{
    global $db;
    $arr = array();
    //全局数据缓存
    $cachevodclass = array();
    //视频分类缓存
    try {
        $cachevodtype = $db->queryarray('SELECT * FROM {pre}vod_type', 't_id');
        $i = 0;
        foreach ($cachevodtype as $v) {
            $strchild = '';
            $rc = false;
            $rs = $db->query('SELECT t_id FROM {pre}vod_type WHERE t_pid=' . $v['t_id']);
            while ($row = $db->fetch_array($rs)) {
                if ($rc) {
                    $strchild .= ',';
                }
                $strchild .= $row['t_id'];
                $rc = true;
            }
            unset($rs);
            if (isN($strchild)) {
                $strchild = $v['t_id'];
            } else {
                $strchild = $v['t_id'] . ',' . $strchild;
            }
            $cachevodtype[$v['t_id']]['childids'] = $strchild;
            //$lnk = $tpl->getLink('vod','type',$v,$row,false,1,1,false);
            //$cachevodtype[$v['t_id']]['link'] = $lnk;
            //$plnk = '';
            //if($v['t_pid']>0){
            //	$plnk = $tpl->getLink('vod','type',$cachevodtype[$v['t_pid']],$row,false,1,1,false);
            //}
            //$cachevodtype[$v['t_id']]['plink'] = $plnk;
            $i++;
        }
    } catch (Exception $e) {
        echo '更新视频分类缓存失败,请检查数据是否合法,是否包含引号、单引号、百分号、尖括号等特殊字符';
        exit;
    }
    $arr['vodtype'] = $cachevodtype;
    $arr['vodclass'] = $cachevodclass;
    //文章分类缓存
    try {
        $cachearttype = $db->queryarray('SELECT *,\'\' AS childids FROM {pre}art_type', 't_id');
        $i = 0;
        foreach ($cachearttype as $v) {
            $strchild = '';
            $rc = false;
            $rs = $db->query('SELECT t_id FROM {pre}art_type WHERE t_pid=' . $v['t_id']);
            while ($row = $db->fetch_array($rs)) {
                if ($rc) {
                    $strchild .= ',';
                }
                $strchild .= $row['t_id'];
                $rc = true;
            }
            unset($rs);
            if (isN($strchild)) {
                $strchild = $v['t_id'];
            } else {
                $strchild = $v['t_id'] . ',' . $strchild;
            }
            $cachearttype[$v['t_id']]['childids'] = $strchild;
            //$lnk = $tpl->getLink('art','type',$v,$row,false,1,1,false);
            //$cachearttype[$v['t_id']]['link'] = $lnk;
            //$plnk = '';
            //if($v['t_pid']>0){
            //	$plnk = $tpl->getLink('art','type',$cachearttype[$v['t_pid']],$row,false,1,1,false);
            //}
            //$cachearttype[$v['t_id']]['plink'] = $plnk;
            $i++;
        }
    } catch (Exception $e) {
        echo '更新文章分类缓存失败,请检查数据是否合法,是否包含引号、单引号、百分号、尖括号等特殊字符';
        exit;
    }
    $arr['arttype'] = $cachearttype;
    //视频剧情分类缓存
    try {
        $cachevodclass = $db->queryarray('SELECT * FROM {pre}vod_class', 'c_id');
    } catch (Exception $e) {
        echo '更新视频剧情分类缓存失败,请检查数据是否合法,是否包含引号、单引号、百分号、尖括号等特殊字符';
        exit;
    }
    $arr['vodclass'] = $cachevodclass;
    //视频专题缓存
    try {
        $cachevodtopic = $db->queryarray('SELECT * FROM {pre}vod_topic', 't_id');
    } catch (Exception $e) {
        echo '更新视频专题缓存失败,请检查数据是否合法,是否包含引号、单引号、百分号、尖括号等特殊字符';
        exit;
    }
    $arr['vodtopic'] = $cachevodtopic;
    //文章专题缓存
    try {
        $cachearttopic = $db->queryarray('SELECT * FROM {pre}art_topic', 't_id');
    } catch (Exception $e) {
        echo '更新文章专题缓存失败,请检查数据是否合法,是否包含引号、单引号、百分号、尖括号等特殊字符';
        exit;
    }
    $arr['arttopic'] = $cachearttopic;
    //用户组缓存
    try {
        $cacheusergroup = $db->queryarray('SELECT * FROM {pre}user_group', 'ug_id');
    } catch (Exception $e) {
        echo '更新用户组缓存失败,请检查数据是否合法,是否包含引号、单引号、百分号、尖括号等特殊字符';
        exit;
    }
    $arr['usergroup'] = $cacheusergroup;
    $arr['vodplay'] = getVodXml('vodplay.xml', 'play');
    $arr['voddown'] = getVodXml('voddown.xml', 'down');
    $arr['vodserver'] = getVodXml('vodserver.xml', 'server');
    $cacheValue = '<?php' . chr(10) . '$MAC_CACHE = ' . compress_html(var_export($arr, true)) . ';' . chr(10) . '?>';
    fwrite(fopen(MAC_ROOT . '/inc/config/cache.php', 'wb'), $cacheValue);
    foreach ($arr['vodplay'] as $k => $v) {
        $plays .= 'mac_show["' . $k . '"]="' . $v['show'] . '";';
    }
    foreach ($arr['vodserver'] as $k => $v) {
        $plays .= 'mac_show_server["' . $k . '"]="' . $v['des'] . '";';
    }
    $fp = MAC_ROOT . '/js/playerconfig.js';
    if (!file_exists($fp)) {
        $fp .= '.bak';
    }
    $fc = file_get_contents($fp);
    $jsb = getBody($fc, '//缓存开始', '//缓存结束');
    $fc = str_replace($jsb, "\r\n" . $plays . "\r\n", $fc);
    @fwrite(fopen(MAC_ROOT . '/js/playerconfig.js', 'wb'), $fc);
    echo '';
}
Exemplo n.º 14
0
function getNextPageContent($pageList, $autoSet, $content_match_type, $content_selector, $outer, $objective, $index, $page_selector, $paged, $delPageArea, $options, $charset, $baseUrl, $page1URL, $filterAtag, $downAttach, $isTest, $useP1, $useP2, $proxy, $pageURLPattern, $pageNum, $cookie)
{
    global $isFetch;
    $content = '';
    if ($pageList != null) {
        foreach ($pageList as $page) {
            $url = $page->href;
            if (trim($url) == '' || $url == null) {
                continue;
            }
            if (!strpos($url, '#038;') === false) {
                $url = str_ireplace('#038;', '', $url);
            }
            if (stripos($url, 'http') === false) {
                if (!(stripos($url, 'javascript') === false)) {
                    continue;
                }
                if (trim($url) == '#') {
                    continue;
                }
                $url = getAbsUrl($url, $baseUrl, $page1URL);
            }
            $url = html_entity_decode(trim($url));
            if (isset($isFetch[$url]) && $isFetch[$url] == 1) {
                continue;
            }
            if ($pageURLPattern != null) {
                $shouldFetchUrl = str_ireplace('(*)', $pageNum, $pageURLPattern);
                if ($shouldFetchUrl != $url) {
                    continue;
                }
                $pageNum++;
            }
            $d = file_get_html_ap(trim($url), $charset, Method, $useP1, $useP2, $proxy, $cookie);
            if ($d == null || $d == '') {
                continue;
            }
            $content = '';
            if ($autoSet) {
                $content .= autoGetContents($d, $charset);
            } else {
                $hasUTFhtml = false;
                $matchNum = count($content_selector);
                foreach ($content_match_type as $cmt) {
                    if ($cmt == 1) {
                        if ($charset != 'UTF-8' && $charset != 'utf-8') {
                            $UTFhtml = $d->save();
                            $UTFhtml = iconv($charset, 'UTF-8//IGNORE', $UTFhtml);
                            $UTFhtml = compress_html($UTFhtml, true, $d);
                        } else {
                            $UTFhtml = $d->save();
                            $UTFhtml = compress_html($UTFhtml, true, $d);
                        }
                        $hasUTFhtml = true;
                        break;
                    }
                }
                for ($i = 0; $i < $matchNum; $i++) {
                    if ($content_match_type[$i] == 0) {
                        switch ($objective[$i]) {
                            case '0':
                                $content .= getContentByCss($d, $content_selector[$i], $options, $charset, $outer[$i], $index[$i]);
                                break;
                        }
                    } else {
                        switch ($objective[$i]) {
                            case '0':
                                $content .= getContentByRule($UTFhtml, $content_selector[$i], $options, $outer[$i]);
                                break;
                        }
                    }
                }
            }
            if ($page_selector[0] == 0) {
                $pageList = $d->find($page_selector[1]);
                if ($pageList != null && $delPageArea == 1) {
                    $delPageAreaString = $pageList[0]->parent()->outertext;
                    if ($charset != 'UTF-8' && $charset != 'utf-8') {
                        $delPageAreaString = iconv($charset, 'UTF-8//IGNORE', $delPageAreaString);
                    }
                    $content = str_ireplace($delPageAreaString, '', $content);
                }
            } elseif ($page_selector[0] == 1) {
                if (!$hasUTFhtml) {
                    if ($charset != 'UTF-8' && $charset != 'utf-8') {
                        $UTFhtml = $d->save();
                        $UTFhtml = iconv($charset, 'UTF-8//IGNORE', $UTFhtml);
                        $UTFhtml = compress_html($UTFhtml);
                    } else {
                        $UTFhtml = $d->save();
                        $UTFhtml = compress_html($UTFhtml);
                    }
                }
                $pageList = getMatchContent($UTFhtml, $page_selector[1], 1);
                if ($delPageArea == 1) {
                    $content = str_ireplace($pageList, '', $content);
                }
                if ($pageList != '' && $pageList != null) {
                    $dom = str_get_html_ap($pageList);
                    $pageList = $dom->find('a');
                    $dom->clear();
                    unset($dom);
                } else {
                    $pageList = null;
                }
            }
            global $page1content;
            if ($content == $page1content) {
                $isFetch[$url] = 1;
                continue;
            }
            if ($isTest == 0) {
                if (DEL_COMMENT == 1) {
                    $content = filterComment($content);
                }
            }
            if ($paged == 1 && $content != null && $content != '') {
                $content = '<!--nextpage-->' . $content;
            }
            $isFetch[$url] = 1;
            $d->clear();
            unset($d);
            unset($UTFhtml);
            $content .= getNextPageContent($pageList, $autoSet, $content_match_type, $content_selector, $outer, $objective, $index, $page_selector, $paged, $delPageArea, $options, $charset, $baseUrl, $page1URL, $filterAtag, $downAttach, $isTest, $useP1, $useP2, $proxy, $pageURLPattern, $pageNum, $cookie);
            break;
        }
    }
    return $content;
}