/** * Add new columns to the post table * * @param Array $columns - Current columns on the list post */ function lhg_db_add_new_columns($columns) { global $region; //print "REG: $region"; $shop_ids = lhg_return_shop_ids($region); //print "Shop IDs:<br>"; //print_r($shop_ids); if ($shop_ids != "") { foreach ($shop_ids as $shopid) { $sid = $shopid->id; //print_r("-- $sid <br>"); $shopname = lhg_db_get_shop_name($sid); //ToDo: currently skip Amazon if (!strpos($shopname, "mazon") > 0) { //echo "SN: $shopname"; $column_meta = array('shop-ID-' . $sid => $shopname); $columns = array_slice($columns, 0, 3, true) + $column_meta + array_slice($columns, 3, NULL, true); } } } return $columns; }
function lhg_supplier_comparison($postid) { global $region; //echo "Anbieter-Übersicht:"; //echo "<br>"; //echo "PID: $postid<br>"; //echo "REG: $region"; //what shops are relevant? //echo "REg: $region<br>"; $shopids = lhg_return_shop_ids($region); #print "SIDS:<br>"; #var_dump($shopids); #print "SIDS-ID:<br>"; #var_dump($shopids->id); // do not show amazon prices (already locally included, for now) // 4 = amazon.de $del_val = 4; $num = count($shopids); for ($i = 0; $i < $num; $i++) { $val = $shopids[$i]->id; #print "NUM: $i - $val<br>"; if ($val == $del_val) { unset($shopids[$i]->id); } } //which shop has this product? $products = lhg_get_sorted_products($shopids, $postid, false); lhg_insert_overview_table($products); }