コード例 #1
0
ファイル: function.php プロジェクト: dalinhuang/17xue8
function getdeallink($city, $updatetype = false)
{
    global $_G;
    require_once libfile('class/xml');
    $goodsxmlfile = MOKUAI_DIR . '/shop/1.0/Data/lashou_' . $city . '.xml';
    $goodss = xml2array(file_get_contents($goodsxmlfile));
    if (!file_exists($goodsxmlfile) || $updatetype) {
        for ($i = 1; $i < getlashoupage($city) + 1; $i++) {
            $goodss = getpagelink($city, $i, $updatetype);
        }
        file_put_contents($goodsxmlfile, diconv(array2xml($goodss, 1), "UTF-8", $_G['charset'] . "//IGNORE"));
    }
    return $goodss;
}
コード例 #2
0
$goodspages = getlashoupage($city);
$citypage = $citypage ? $citypage : 1;
$load_page0 = explode('&city=', $this_page);
$load_page = $_G['siteurl'] . ADMINSCRIPT . "?action=" . $load_page0[0];
$page = max(1, $_G['page']);
$prepage = 20;
if ($subop == 'list') {
    if (getgpc('caiji')) {
        if (!$citys[$city]['temppage']) {
            $citys[$city]['temppage'] = $citypage;
            file_put_contents($cityxmlfile, diconv(array2xml($citys, 1), "UTF-8", $_G['charset'] . "//IGNORE"));
        }
        if ($citys[$city]['temppage'] != $goodspages) {
            $citys[$city]['temppage'] = $citypage;
            file_put_contents($cityxmlfile, diconv(array2xml($citys, 1), "UTF-8", $_G['charset'] . "//IGNORE"));
            $goodss = getpagelink($city, $citypage);
            file_put_contents($goodsxmlfile, diconv(array2xml($goodss, 1), "UTF-8", $_G['charset'] . "//IGNORE"));
            cpmsg(lang('plugin/yiqixueba', 'goods_caiji_page') . $lashoucitys[$city]['city'] . '&nbsp;&nbsp;' . $citypage . '&nbsp;&nbsp;(' . $citypage . '/' . $goodspages . ')', $load_page . "&city=" . $city . "&citypage=" . ($citypage + 1) . '&caiji=yes', 'loading', array('volume' => $volume));
        } else {
            $curid = '';
            $num = 0;
            foreach ($goodss as $k => $v) {
                if (!$v['caiji']) {
                    $curid = $k;
                    $num++;
                }
            }
            if ($curid) {
                $curxmlfile = round((count($goodss) - $num) / 300);
                $goodss[$curid]['caiji'] = 1;
                $goodss[$curid]['curxmlfile'] = $curxmlfile;