get_results($sql, ARRAY_A); header("Content-Type: application/xml; charset=UTF-8"); header('Content-Disposition: inline; filename="E-Commerce_Product_List.rss"'); $output = "\n\r"; $output .= "\n\r"; $output .= " ".get_option('siteurl')."/wp-admin/admin.php?page=".WPSC_DIR_NAME."/display-log.php\n\r"; $output .= " This is the WP E-Commerce Product List RSS feed\n\r"; $output .= " WP E-Commerce Plugin\n\r"; $output .= " \n\r"; foreach ($product_list as $product) { $purchase_link = wpsc_product_url($product['id']); $output .= " \n\r"; if ($google_checkout_note) { $output .= " Google Checkout\n\r"; } $output .= " <![CDATA[".stripslashes($product['name'])."]]>\n\r"; $output .= " $purchase_link\n\r"; $output .= " \n\r"; $output .= " ".date("r")."\n\r"; $output .= " $purchase_link\n\r"; if ($product['thumbnail_image'] != null) { $image_file_name = $product['thumbnail_image']; $image_path = WP_CONTENT_DIR."/uploads"."/wpsc/product_images/thumbnails/{$image_file_name}"; $image_link = WP_CONTENT_URL."/uploads"."/wpsc/product_images/thumbnails/".rawurlencode($image_file_name); } else { $image_file_name = $product['image']; $image_path = WP_CONTENT_DIR."/uploads"."/wpsc/product_images/{$image_file_name}"; $image_link = WP_CONTENT_URL."/uploads"."/wpsc/product_images/".rawurlencode($image_file_name); } //$image_path = WP_CONTENT_DIR."/uploads"."/wpsc/product_images/thumbnails/{$image_file_name}"; if (is_file($image_path) && (filesize($image_path) > 0)) { $image_data = @getimagesize($image_path); // $image_link = WP_CONTENT_URL."/uploads"."/wpsc/product_images/thumbnails/".urlencode($image_file_name); if ($_GET['xmlformat'] == 'google') { $output .= " $image_link\n\r"; } else { $output .= " \n\r"; } } if ($_GET['xmlformat'] == 'google') { $output .= " ".$product['price']."\n\r"; //$output .= " new\n\r"; $meta_sql = "SELECT meta_key, meta_value FROM `".WPSC_TABLE_PRODUCTMETA."` pm WHERE `pm`.`product_id` = '".$product['id']."' AND `pm`.`meta_key` LIKE 'g:%'"; $google_elements = $wpdb->get_results($meta_sql, ARRAY_A); $google_elements = apply_filters('wpsc_google_elements', array('product_id'=>$product['id'],'elements'=>$google_elements)); $google_elements = $google_elements['elements']; $done_condition = FALSE; if (count($google_elements)) { foreach ($google_elements as $gelement) { $output .= " <".$gelement['meta_key'].">"; $output .= ""; $output .= "\n\r"; if ($gelement['meta_key'] == 'g:condition') $done_condition = TRUE; } } if (!$done_condition) $output .= " new\n\r"; } else { $output .= " ".$product['price']."\n\r"; } $output .= " \n\r"; } $output .= " \n\r"; $output .= ""; echo $output; exit(); } ?>