"; echo '

Product Catalog

'; if ($aliasCount > 0) { $firstAlias = reset($affiliateAliases); $productCount = number_format(get_option('aw_affiliatewire_quick_ignition_productsCount'),0); $productsArray = maybe_unserialize(get_option('aw_affiliatewire_quick_ignition_products')); $products = $productsArray[$firstAlias]; } else { $productCount = 0; } if ($productCount == 0) { echo '

'; echo ''; echo '
No Products
'; } else { ksort($products); echo '

'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; foreach ($products as $merchantName => $merchant) { foreach ($merchant as $offerID => $offer) { $offerDetails = new SimpleXMLElement($offer); if (strtotime($offerDetails->dateAdded) > $productUpdate) { echo ''; } else { echo ''; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } } echo '
ActionProduct DateCompanyProduct NameCategoryPricesLanguageCommission
'; echo '
'; echo ''.aw_affiliatewire_quick_ignition_create_select('aw_alias',$affiliateAliases,$firstAlias); echo ''; echo ''; echo '
'; echo '
'; echo '
';//.$offerDetails->dateAdded; echo '
'.date('Y/m/d',strtotime($offerDetails->dateAdded)); if (strtotime($offerDetails->dateAdded) > $productUpdate) { echo '
New Product'; } echo '
';//.$offerDetails->dateAdded; echo $merchantName; echo ' '; echo $offerDetails->name; echo '
['.$offerID.']'; echo '
'; echo ''; echo '
 
'.$offerDetails->details.'
'.$offerDetails->category.'
    '; $prices = (array)$offerDetails->prices; foreach ($prices as $currency => $price) { echo "
  • ".$price." ".$currency."
  • "; } echo '
'.str_replace(',','
',$offerDetails->languages).'
'.$offerDetails->commission.'
'; echo ''; } echo ''; $baseurl = plugin_dir_url( __FILE__ ).'images/'; echo ' '; function aw_createPost($affiliateAlias, $merchantID, $productID) { global $wpdb; $products = maybe_unserialize(get_option('aw_affiliatewire_quick_ignition_products')); $xmlString = $products[$affiliateAlias][$merchantID][$productID]; $item = new SimpleXMLElement($xmlString); $postType = 'draft'; $product_name = (string)$item->name; $product_description = (string)$item->customerDescription; $download_link = (string)$item->downloadUrl; $purchase_page = (string)$item->registrationUrl; $product_box = (string)$item->assets->boxShot->url; $postDetails = $post = array( 'comment_status' => 'open', //[ 'closed' | 'open' ] // 'closed' means no comments. 'ping_status' => 'open', //[ 'closed' | ] // 'closed' means pingbacks or trackbacks turned off 'post_status' => $postType, //'future', //[ 'draft' | 'publish' | 'pending'| 'future' | 'private' ] //Set the status of the new post. 'post_type' => 'post', //[ 'post' | 'page' | 'link' | 'nav_menu_item' | custom post type ] //You may want to insert a regular post, page, link, a menu item or some custom post type 'post_title' => $product_name, //[ ] //The title of your post. 'post_content' => $body, // [ ] //The full text of the post. ); $postID = wp_insert_post( $postDetails ); if ($postID > 0) { update_post_meta($postID, 'aw_affiliatewire_quick_ignition_Product_Name_value', $product_name); update_post_meta($postID, 'aw_affiliatewire_quick_ignition_Product_Description_value', $product_description); update_post_meta($postID, 'aw_affiliatewire_quick_ignition_Direct_Download_value', $download_link); update_post_meta($postID, 'aw_affiliatewire_quick_ignition_Purchase_Page_value', $purchase_page); update_post_meta($postID, 'aw_affiliatewire_quick_ignition_Product_Box_value', $product_box); update_post_meta($postID, 'aw_affiliatewire_quick_ignition_Affiliate_Alias_value', $affiliateAlias); if (!headers_sent()) { $editurl = site_url().'/wp-admin/post.php?post='.$postID.'&action=edit'; header("Location:".$editurl); die; } echo ''; echo 'In about 30 seconds you will be redirected to the NEW George Warner Home Page. If redirection does not work please click on the following link:'; echo ''.$editurl.''; exit; } } ?>