0 && is_file($cache_file) && (filemtime($cache_file) + $cache_timeout > time())) { $html = file_get_html($cache_file); //echo "get file cache"; } else { $html = file_get_html($url); //echo "get url"; if ($cache_timeout > 0) { file_put_contents($cache_file, $html); } } */ $html = file_get_html($url); if(!empty($html)){ $headlines = array(); $x=0; //--------------------Get ebay Title foreach($html->find('link[rel="canonical"]' ) as $header) { //$cc = str_replace('class="img-fluid"','',$header->innertext); if(!empty($header->href)){ $ebay_id = $header->href; }else{ $ebay_id = ""; } //echo "ebay_id=".$header->href; $x++; } $aebay_id= explode("/",$ebay_id); $ebay_id = $aebay_id[4]; $pos = strpos($url, "/itm"); // Note our use of ===. Simply == would not work as expected // because the position of 'a' was the 0th (first) character. $price_org = $price; if ($pos === false) { $pos = strpos($url, "/p"); if ($pos === false) { }else{ include("get_ebay_data2.php"); } } else { include("get_ebay_data1.php"); } $price = $price_org; $category_s = mysqli_real_escape_string($conn, $category); $price_s = mysqli_real_escape_string($conn, $price); $priceCurrency_s = mysqli_real_escape_string($conn, $priceCurrency); $shipping_s = mysqli_real_escape_string($conn, $shipping); $description_s = mysqli_real_escape_string($conn, $description); $description2_s = mysqli_real_escape_string($conn, $description2); $image_group_s = mysqli_real_escape_string($conn, $image_group); $image_s = mysqli_real_escape_string($conn, $image); if(!empty($description)){ $update_SQL = "UPDATE `ebay_prod` SET ebay_id='".$ebay_id."', category='".$category_s."' , price='".$price_s."' ,priceCurrency='".$priceCurrency_s ."', shipping='".$shipping_s."', description='".$description_s."' , description2='".$description2_s."' , image_group='".$image_group_s."' WHERE id =$id" ; if(!mysqli_query($conn, $update_SQL )){ echo("Error description: " . mysqli_error($conn)); }else{ //echo "Saved Ebay ...
"; } } } } //------------------End GET Ebay Products Detail--------------------------------------------------------------// if(empty($category1) and !empty($category)){ $acat = explode(">",$category ); if(count($acat)>0){ $update_SQL = "UPDATE `ebay_prod` SET category1='".$acat[0]."', category2='".$acat[1]."' , category3='".$acat[2]."' WHERE id =$id" ; if(!mysqli_query($conn, $update_SQL )){ //echo("Error description: " . mysqli_error($conn)); }else{ //echo "Category Save ...
"; } $category1 = $acat[0] ; $category2 = $acat[1]; $category3 = $acat[2]; } } $aimage = explode(",",$image_group ); //$productsurl = "https://www.ebay.com/itm/". $ebay_id.$ebayaff ; $ebayaff1 = "?mkcid=1&mkrid=711-53200-19255-0&siteid=0&campid=5338769544&customid=&toolid=10001&mkevt=1"; $ebayaff2 = "&mkcid=1&mkrid=711-53200-19255-0&siteid=0&campid=5338769544&customid=&toolid=10001&mkevt=1"; $pos = strpos($url, "?"); if ($pos === false) { $productsurl = $url.$ebayaff1; } else { $productsurl = $url.$ebayaff2; } //--------Random view items-------// //$recipeSQL = "SELECT * FROM beluckyzodiac WHERE RAND()<=(100/(SELECT COUNT(*) FROM beluckyzodiac )) LIMIT 12"; $SQL = "SELECT * FROM ebay_prod ORDER BY RAND(),id ASC LIMIT 12"; $Result2 = mysqli_query($conn, $SQL); $ntotal2 = mysqli_num_rows($Result2); //--------Relate product-------// //$SQL = "SELECT * FROM ebay_prod WHERE trim(title) like '%".$title."%' ORDER BY RAND(),id LIMIT 12 "; $SQL = "SELECT * FROM ebay_prod WHERE trim(category) like '%".$category2."%' or trim(category) like '%".$category3."%' ORDER BY RAND() ,lastupdate_data DESC LIMIT 12 "; $Result3 = mysqli_query($conn, $SQL); $total3 = mysqli_num_rows($Result3); if($total3<=0){ $SQL = "SELECT * FROM ebay_prod ORDER BY RAND() ,lastupdate_data DESC LIMIT 12 "; $Result3 = mysqli_query($conn, $SQL); $total3 = mysqli_num_rows($Result3); } $SQL = "SELECT * FROM ebay_prod ORDER BY lastview DESC LIMIT 12 "; $Result4 = mysqli_query($conn, $SQL); $total4 = mysqli_num_rows($Result4); $cur_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $title = str_replace("eBay","",$title); $description = str_replace("eBay","Supplier",$description); $description2 = str_replace("eBay","Supplier",$description2); $cname_addr = $header_text ; $cur_desc = ""; //$mdesc = $category." : ".mb_substr($description,0,200); $mdesc = $category." : ".$description; $tags2 = str_replace(">",",",$category); $mtag = $tags2 .",Kitchen Product"; ?> <?echo $title;?> <?echo $category ;?> | TheFoodTasting
<?echo $title;?>

Photo Related

"><?echo $title ;?>
" class="pop-overlay">

Reviews

Relate in

0){ while($row = mysqli_fetch_assoc($Result3)){ $id = trim($row["id"]); $ebay_id = trim($row["ebay_id"]); $url = trim($row["url"]); $title = trim($row["title"]); $short_desc = mb_substr($row["description2"],0,150); $description = trim($row["description"]); $category = trim($row["category"]); $category1 = trim($row["category1"]); $category2 = trim($row["category2"]); $category3 = trim($row["category3"]); $price = trim($row["price"]); $priceCurrency = trim($row["priceCurrency"]); $shipping = trim($row["shipping"]); $image = trim($row["image"]); $image_group = trim($row["image_group"]); $description2 = trim($row["description2"]); $views = trim($row["views"]); $lastview = trim($row["lastview"]); $status = trim($row["status"]); $lastupdate_data = trim($row["lastupdate_data"]); $image = str_replace("96","500",$image); $image = str_replace("200","500",$image); $img = $image; if(empty($image)){ $img = "images/no_image2.png"; } ?>

<?echo $title ;?>

You May Interested

0){ while($row = mysqli_fetch_assoc($Result4)){ $id = trim($row["id"]); $ebay_id = trim($row["ebay_id"]); $url = trim($row["url"]); $title = trim($row["title"]); $short_desc = mb_substr($row["description2"],0,150); $description = trim($row["description"]); $category = trim($row["category"]); $category1 = trim($row["category1"]); $category2 = trim($row["category2"]); $category3 = trim($row["category3"]); $price = trim($row["price"]); $priceCurrency = trim($row["priceCurrency"]); $shipping = trim($row["shipping"]); $image = trim($row["image"]); $image_group = trim($row["image_group"]); $description2 = trim($row["description2"]); $views = trim($row["views"]); $lastview = trim($row["lastview"]); $status = trim($row["status"]); $lastupdate_data = trim($row["lastupdate_data"]); $image = str_replace("96","500",$image); $image = str_replace("200","500",$image); $img = $image; if(empty($image)){ $img = "images/no_image2.png"; } ?>

<?echo $title ;?>