return $reps; } else { return true; } } $run_environment = 'prod'; // either 'dev' or 'prod' $max_records = 4; // only used for testing if ($run_environment == 'dev') { error_reporting(E_ALL); require 'scraperwiki.php'; } require 'scraperwiki/simple_html_dom.php'; $url = "http://www.floridaleagueofcities.com/directory.aspx"; $city_list = get_city_list($url); // $alldata = $city_list; $count = 1; foreach ($city_list as $link) { $url = $link['source']; $city = $link['name']; if ($run_environment == 'prod') { get_city_data($city, $url); } else { $alldata[] = get_city_data($city, $url); } $count++; if ($run_environment == 'dev' && $count > $max_records) { break; } }
return $official; } $run_environment = 'prod'; // either 'dev' or 'prod' $max_records = 4; // only used for testing if ($run_environment == 'dev') { error_reporting(E_ALL); require 'scraperwiki.php'; } require 'scraperwiki/simple_html_dom.php'; $post_url = "http://members.tml.org/source/Members/TML_DirectoryProcess.cfm"; //http://members.tml.org/source/members/TML_Directory.cfm //set POST variables $fields = array('population' => '', 'CS' => '', 'FIRST_NAME' => '', 'LAST_NAME' => '', 'x' => 23, 'y' => 6); $city_list = get_city_list(get_post_response($post_url, $fields)); // $alldata = $city_list; $count = 1; foreach ($city_list as $url) { if ($run_environment == 'prod') { get_city_data($url); } else { $alldata[] = get_city_data($url); } $count++; if ($run_environment == 'dev' && $count > $max_records) { break; } } // if testing if ($run_environment == 'dev') {
$county_id = empty($_COOKIE['region_3']) ? 0 : intval($_COOKIE['region_3']); $district_id = empty($_COOKIE['region_4']) ? 0 : intval($_COOKIE['region_4']); $catch_id = empty($_COOKIE['cat_2']) ? 0 : intval($_COOKIE['cat_2']); $cache_id = $city_id . '-' . $county_id . '-' . $district_id . '-' . $cat_id . '-' . $_SESSION['user_rank'] . '-' . $_CFG['lang']; $cache_id = sprintf('%X', crc32($cache_id)); $show = empty($_REQUEST['show']) ? 'goods' : trim($_REQUEST['show']); if ($_REQUEST['act'] == 'list') { if (!$smarty->is_cached('goods.dwt', $cache_id)) { /* 默认显示方式 */ $default_display_type = $_CFG['show_order_type'] == '0' ? 'list' : ($_CFG['show_order_type'] == '1' ? 'grid' : 'text'); $default_sort_order_method = $_CFG['sort_order_method'] == '0' ? 'DESC' : 'ASC'; $default_sort_order_type = $_CFG['sort_order_type'] == '0' ? 'goods_id' : ($_CFG['sort_order_type'] == '1' ? 'sort_order' : 'last_update'); $smarty->assign('list_default_sort', $default_sort_order_type); $search_info = array('cat_id' => $cat_id, 'catch_id' => $catch_id, 'city_id' => $city_id, 'county_id' => $county_id, 'district_id' => $district_id, 'list_default_sort' => $default_sort_order_type); $smarty->assign('search_info', $search_info); $zimu_city = get_city_list(); $smarty->assign('nowcityname', $GLOBALS['db']->getOne("select region_name from " . $GLOBALS['ecs']->table("region") . " where region_id=" . $city_id)); $smarty->assign('zimu_city', $zimu_city); $county_list = get_county_list($city_id); $smarty->assign('county_list', $county_list); $position = assign_ur_here(0, $_LANG['advanced_search']); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $district = get_district_list($county_id); $smarty->assign('district', $district); $category = get_virtual_category(); $category_chr = get_virtual_category_chr($cat_id); $smarty->assign('category_chr', $category_chr); $smarty->assign('category', $category);
// 入驻商商品列表不显示添加新商品 $action_link = $_REQUEST['act'] == 'list' ? add_link($code) : array('href' => 'virtual_goods.php?act=list', 'text' => $_LANG['01_goods_list']); $smarty->assign('action_link', $action_link); } /* 模板赋值 */ $goods_ur = array('' => $_LANG['01_goods_list'], 'virtual_card' => $_LANG['50_virtual_card_list']); $ur_here = $_REQUEST['act'] == 'list' ? $goods_ur[$code] : $_LANG['11_goods_trash']; $smarty->assign('ur_here', $ur_here); $smarty->assign('code', $code); $smarty->assign('cat_list', cat_list(0, $cat_id)); $smarty->assign('brand_list', get_brand_list()); $smarty->assign('intro_list', get_intro_list()); $smarty->assign('lang', $_LANG); $smarty->assign('list_type', $_REQUEST['act'] == 'list' ? 'goods' : 'trash'); $smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1); $city = get_city_list(); $smarty->assign('city', $city); $suppliers_list = suppliers_list_info(' is_check = 1 '); $suppliers_list_count = count($suppliers_list); $smarty->assign('suppliers_list', $suppliers_list_count == 0 ? 0 : $suppliers_list); // 取供货商列表 $goods_list = goods_list($_REQUEST['act'] == 'list' ? 0 : 1, $_REQUEST['act'] == 'list' ? $code == '' ? 1 : 0 : -1); $smarty->assign('goods_list', $goods_list['goods']); $smarty->assign('filter', $goods_list['filter']); $smarty->assign('record_count', $goods_list['record_count']); $smarty->assign('page_count', $goods_list['page_count']); $smarty->assign('full_page', 1); /* 排序标记 */ $sort_flag = sort_flag($goods_list['filter']); $smarty->assign($sort_flag['tag'], $sort_flag['img']); /* 获取商品类型存在规格的类型 */
admin_priv('m_cit'); $act = empty($_REQUEST['act']) ? 'list' : $_REQUEST['act']; if ($act == 'list') { $list = get_city_list(); $sql = "select city_name,city_code from order_city group by city_group"; $city_group = $db_read->getAll($sql); $smarty->assign('city_group', $city_group); $smarty->assign('city_list', $list['city_list']); $smarty->assign('record_count', $list['record_count']); $smarty->assign('page_count', $list['page_count']); $smarty->assign('ur_here', '城市管理'); $smarty->assign('action_link', array('text' => '添加城市', 'href' => 'city.php?act=addcity')); $smarty->assign('full_page', 1); $smarty->display('city.html'); } elseif ($act == 'query') { $list = get_city_list(); $smarty->assign('city_list', $list['city_list']); $smarty->assign('record_count', $list['record_count']); $smarty->assign('page_count', $list['page_count']); $smarty->assign('filter', $list['filter']); make_json_result($smarty->fetch('city.html')); } elseif ($act == 'addcity') { $sql = "select city_name,city_code from order_city group by city_group"; $city_group = $db_read->getAll($sql); $smarty->assign('city_group', $city_group); $smarty->assign('actions', 'saveadd'); $smarty->assign('ur_here', '添加城市'); $smarty->assign('action_link', array('text' => '城市列表', 'href' => 'city.php')); $smarty->display('city_add.html'); } elseif ($act == 'saveadd') { $city_name = trim($_REQUEST['city_name']);