/** * * @param string $tag Default is NULL * @param int $page Default is NULL * @return void */ public function index($tag = NULL, $page = NULL) { $getData = array('query' => $tag ? $tag : Input::get('query'), 'type' => Input::get('type'), 'country' => Input::get('country'), 'make' => Input::get('make'), 'model' => Input::get('model'), 'year_min' => Input::get('year_min'), 'year_max' => Input::get('year_max'), 'price_min' => Input::get('price_min'), 'price_max' => Input::get('price_max'), 'currency' => Input::get('currency'), 'condition' => Input::get('condition'), 'color' => Input::get('color'), 'mileage_min' => Input::get('mileage_min'), 'mileage_max' => Input::get('mileage_max'), 'vehicle' => Input::get('vehicle'), 'vin' => Input::get('vin'), 'state' => Input::get('state'), 'city' => Input::get('city'), 'location' => Input::get('location'), 'order' => Input::get('order'), 'page' => $page ? $page : Input::get('page')); $getData = $this->mSearch->fixDashes($getData); $getData = $this->mSearch->fixLower($getData); $data = $this->mSearch->apiResults($getData); $data['params'] = $getData; $data['yearMin'] = $getData['year_min'] ? $getData['year_min'] : 1980; $data['yearMax'] = $getData['year_max'] ? $getData['year_max'] : (int) date('Y'); $data['priceMin'] = $getData['price_min'] ? $getData['price_min'] : 0; $data['priceMax'] = $getData['price_max'] ? $getData['price_max'] : 50000; $data['mileageMin'] = $getData['mileage_min'] ? $getData['mileage_min'] : 0; $data['mileageMax'] = $getData['mileage_max'] ? $getData['mileage_max'] : 200000; $this->mSearch->saveTags($getData['query'], $data['total']); $data['latestTags'] = $this->mSearch->getTags('latest'); $data['randomTags'] = $this->mSearch->getTags('random'); if ($tag !== NULL) { Pagination::setQueryString(FALSE); Pagination::setURL(tagLink($getData['query'])); $seoData = $this->mSearch->setSeo('tags', $getData, $data['total']); Layout::title(getSeo($seoData, 'tagsTitle')); Layout::desc(getSeo($seoData, 'tagsDesc')); Layout::heading(getSeo($seoData, 'tagsHeading')); } else { Pagination::setQueryString(TRUE); Pagination::setURL(searchLink($getData, FALSE)); $seoData = $this->mSearch->setSeo('search', $getData, $data['total']); Layout::title(getSeo($seoData, 'searchTitle')); Layout::desc(getSeo($seoData, 'searchDesc')); Layout::heading(getSeo($seoData, 'searchHeading')); } Pagination::setTotal($data['total'], Config::get('searchResultsLimit', 'limit'), Config::get('searchPaginaLimit', 'limit')); Pagination::setCurrent($getData['page']); Pagination::setNumLinks(3); Pagination::run(); $data['pagination'] = Pagination::getPagina(); Layout::view('vSearch', $data); }
function exportCards($par_groupsArray) { $arr = array(); $i = 0; $result = getQuery("SELECT * FROM skladovakarta"); while ($row = mysql_fetch_assoc($result)) { if ($row['TovarovaSkupinaId'] > 0) { foreach ($par_groupsArray as $key => $value) { if ($value['old_id'] == $row['TovarovaSkupinaId']) { $row['TovarovaSkupinaId'] = $value['new_id']; break; } } $arr[$i]['old_id'] = $row['ID']; getQuery("INSERT INTO wp_posts(post_author,post_date,post_date_gmt,post_content,post_title,post_excerpt,post_status,comment_status,ping_status,post_name,post_modified,post_modified_gmt,post_parent,menu_order,post_type) VALUES(1, NOW(), NOW(), '', '" . replaceApostrof($row['Nazov']) . "', '" . replaceApostrof($row['ShortInfo']) . "', 'publish', 'open', 'closed', '" . getSeo(replaceApostrof($row['Nazov'])) . "', NOW(), NOW(), 0, 0, 'product')"); $last_id = mysql_insert_id(); echo $last_id . '<br/>'; $arr[$i]['new_id'] = $last_id; getQuery("UPDATE wp_posts SET guid = 'http://new.goga.sk/?post_type=product&p={$last_id}' WHERE ID={$last_id}"); $myresult = getQuery("SELECT * FROM wp_term_taxonomy WHERE taxonomy='product_cat' AND term_id=" . $row['TovarovaSkupinaId']); $myrow = mysql_fetch_assoc($myresult); $tid = $myrow['term_taxonomy_id']; if ($tid > 0) { } else { $tid = 0; } mysql_free_result($myresult); getQuery("INSERT INTO wp_term_relationships(object_id,term_taxonomy_id,term_order) VALUES({$last_id}, {$tid}, 0)"); getQuery("UPDATE wp_term_taxonomy SET count=count+1 WHERE term_taxonomy_id={$tid}"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_visibility', 'visible')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_stock_status', 'instock')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_downloadable', 'no')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_virtual', 'no')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_regular_price', '" . $row['PredajnaCena'] . "')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_sale_price', '')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_featured', 'no')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_sku', '" . $row['RegistracneCislo'] . "')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_barcode', '" . $row['CiarovyKod'] . "')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_price', '" . $row['PredajnaCena'] . "')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_purchase_price', '" . $row['NakupnaCenaSDPH'] . "')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_manage_stock', 'yes')"); getQuery("INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES({$last_id}, '_backorders', 'no')"); $i++; } } mysql_free_result($result); exportImages($arr); }
//兼容以前老地址,如果使用以前老地址访问则301跳转到新的地址 if (preg_match("/^\\d*\$/", $destid)) { $py = getPinyinById($destid); if (!empty($py)) { $url = $GLOBALS['cfg_basehost'] . '/' . $py . '/'; head301($url); } else { head404(); } } $pv = new View($typeid); $destpy = $destid; //拼音赋值 $kindid = $destid = getDestIdByPy($destid); //获取目的地ID $seoarr = getSeo($kindid); //获取关键词,描述,介绍等信息. if ($seoarr['iswebsite'] == 1) { $url = $seoarr['weburl']; head301($url); } $html_file = SLINEDATA . '/dest/' . $kindid . '.html'; if (file_exists($html_file)) { if (time() - filemtime($html_file) < 3600) { include $html_file; exit; } } if (empty($kindid)) { head404(); exit;