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; }
$lashoucitys = getlashoucity(); $cityxmlfile = MOKUAI_DIR . '/shop/1.0/Data/lashou_citys.xml'; $citys = xml2array(file_get_contents($cityxmlfile)); $city_select = '<select name="city">'; $kk = 0; foreach ($lashoucitys as $k => $v) { if ($kk == 0 && !$city) { $city = $k; } $city_select .= '<option value="' . $k . '"' . ($city == $k ? ' selected' : '') . '>' . $v['city'] . '</option>'; $kk++; } $city_select .= '</select>'; $goodsxmlfile = MOKUAI_DIR . '/shop/1.0/Data/lashou_' . $city . '.xml'; $goodss = xml2array(file_get_contents($goodsxmlfile)); $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);