Exemple #1
0
    sbyou_Net_createdir($entry);
    $dir = $entry . '/list_' . $id3 . '.html';
}
//栏目列表页
if ($id1 == 'catalog_list') {
    SByou_net_mysql2disk();
    if (!$id3 || $id3 > $make_pages || !$time_up) {
        exit;
    }
    $url = $BOOK_URL . 'catalog_list.php?id=' . $entry . '&pages=' . $id2 . '&page=' . $id3;
    sbyou_Net_createdir($entry);
    $dir = $entry . '/list_' . $id3 . '.html';
}
//栏目首页
if (!$dir) {
    SByou_net_mysql2disk();
    if (!$time_up) {
        exit;
    }
    $SByou_Net = $dsql->GetOne("select id from dede_arctype where typedir='{$entry}' limit 1");
    $exist = $SByou_Net['id'];
    if ($exist) {
        $url = $BOOK_URL . 'plus/list.php?tid=' . $entry;
    } else {
        exit;
    }
    sbyou_Net_createdir($entry);
    $dir = $entry . '/index.html';
}
//提取内容
$ch = curl_init();
Exemple #2
0
function SByou_NET_cache($dir)
{
    if (!file_exists($dir)) {
        sbyou_Net_createdir($dir);
        return false;
    }
    //���ݱ��ػ�
    SByou_net_mysql2disk();
    //����С˵����
    SByou_net_booksize();
    //�жϹ���
    $filemtime = filemtime($dir);
    //��ǰʱ��
    $time = time();
    if ($filemtime + 1 > $time) {
        return false;
    }
    //��ɾ��Ŀ¼�µ��ļ���
    $dh = opendir($dir);
    while ($file = readdir($dh)) {
        if ($file != "." && $file != "..") {
            $fullpath = $dir . "/" . $file;
            if (!is_dir($fullpath)) {
                unlink($fullpath);
            } else {
                deldir($fullpath);
            }
        }
    }
    closedir($dh);
    //ɾ����ǰ�ļ��У�
    if (rmdir($dir)) {
        sbyou_Net_createdir($dir);
        return true;
    } else {
        return false;
    }
}