Website Build:

Website Build:

Last year I blogged about a logo concept for a website called Well the concept has finally been made into a live website,

Special features of this particular build are that it is built on the excellent HTML5 framework Twitter Bootstrap, meaning I can get a full mobile experience from the site without having to code & update separate templates. The site uses an Affiliate Window feed. I did find it tricky using the feed as it wasn’t categorised correctly by the merchant. This meant I had to use some creative methods to categorise shirts myself.

In addition AW feeds tend to be quite large in terms of filesize and using PHP to extract the compressed feeds resulted in time-outs on lowly shared hosting. Thankfully linux command wget came to the rescue with a simple command to download and extract the feed in one simple cron job. Take a look at the site and tell me what you think in the comments section below

Oliver Partridge

Building websites since 2000, I have a wealth of experience in eMarketing, SEO, e-mail marketing and social media marketing. Google+ and Twitter


  1. aarch says:

    Hey Oliver,
    I saw your progress about parsing Affiliate Feeds. Now, I am trying some CMSs (Symphony, WordPress) like you did before. I am planning to run an affiliate shop. I am not sure which CMS to start with. Parsing differently formatted xml feeds is being really tricky. Every feed has a different structure, I really need flexible solution where I would be able to set replace functions etc. Do you have any suggestions?

    • admin says:

      There was a script called affilistore or something like that (might be, it took a feed and structured the data to some extent. You’ll need a CMS which allows you to plugin custom PHP/MySQL code of your own. I use CMS Made Simple, as it is easy to get going with without having to learn some framework. You could use WordPress as well, depends on your experience with it. Good Luck!

  2. aarch says:

    hey, thanks for the detailed answer. I will definitely check them now.

    • admin says:

      Below is the code I used for parsing Paid on Results XML feeds. I added some image manipulation routines at the end so the images fit into the themeforest theme I used for the site.

      < ?php if (!ini_get('max_execution_time')) { ini_set('max_execution_time', 2600); } function toAscii($str) { $clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $str); $clean = strtolower(trim($clean, '-')); $clean = preg_replace("/[\/_|+ -]+/", '-', $clean); return $clean; } $url = ',ProductName,ProductPrice,SummaryDescription,ProductDescription,AffiliateURL,ImageURL120by120,ImageURL400by400,ProductAddedDate,Category,MerchantName'; $file = '/home/XXXXXXXX/paidonresults-feed.xml'; $current = file_get_contents($url); file_put_contents($file, $current); sleep(5); mysql_connect("localhost", "XXXXXXXX_cms", "XXXXXXXX") or die(mysql_error()); mysql_select_db("XXXXXXXX_cms") or die(mysql_error()); $sql = "TRUNCATE TABLE `XXXXXXXX`"; mysql_query($sql) or die(mysql_error()); $xml = simplexml_load_file("/home/XXXXXXXX/paidonresults-feed.xml"); foreach($xml->product as $product){

      $ProductID = $product->ProductID;
      $ProductName = trim($product->ProductName);
      $ProductName = addslashes($ProductName);
      $ProductPrice = $product->ProductPrice;
      $SummaryDescription = addslashes($product->SummaryDescription);
      $ProductDescription = addslashes($product->ProductDescription);
      $AffiliateURL = $product->AffiliateURL;
      $ImageURL120by120 = $product->ImageURL120by120;
      $ImageURL400by400 = $product->ImageURL400by400;
      $ProductAddedDate = $product->ProductAddedDate;
      $prettyURL = toAscii($ProductName);

      $Category = $product->Category;
      list($Category1, $Category2) = explode(">", $Category);

      $Category1 = trim(addslashes($Category1));
      $Category2 = addslashes(trim($Category2));

      $MerchantName = $product->MerchantName;

      /* Skip any png files */
      $mystring1 = 'png';
      $pos1 = stripos($ImageURL400by400, $mystring1);

      if ($pos1 === false) {
      // Original image
      $filename = $ImageURL400by400;
      $newfile = '/home/XXXXXXXX/public_html/uploads/images/product/thumbs/' . $ProductID . '.jpg';
      // Get dimensions of the original image
      list($current_width, $current_height) = getimagesize($filename);

      // The x and y coordinates on the original image where we
      // will begin cropping the image
      $left = 60;
      $top = 0;

      // This will be the final size of the image (e.g. how many pixels
      // left and down we will be going)
      $crop_width = 240;
      $crop_height = 400;

      // Resample the image
      $canvas = imagecreatetruecolor($crop_width, $crop_height);
      $current_image = imagecreatefromjpeg($filename);
      imagecopy($canvas, $current_image, 0, 0, $left, $top, $current_width, $current_height);
      imagejpeg($canvas, $newfile, 75);
      // Free up memory

      $thumbfile = '/uploads/images/product/thumbs/' . $ProductID . '.jpg';

      $query = "INSERT INTO XXXXXXXX (ProductID, ProductName, ProductPrice, SummaryDescription, ProductDescription, AffiliateURL, ImageURL120by120, ImageURL400by400, ImageLarge, ProductAddedDate, Category1, Category2, MerchantName, prettyURL) VALUES ('$ProductID', '$ProductName', '$ProductPrice', '$SummaryDescription', '$ProductDescription', '$AffiliateURL', '$ImageURL120by120', '$thumbfile', '$ImageURL400by400', '$ProductAddedDate', '$Category1', '$Category2', '$MerchantName', '$prettyURL')";

      mysql_query($query) or die(mysql_error());



Leave a Reply

  • Add a second menu to WordPressAdd a second menu to WordPress

    Add a second menu to WordPress

    Website Design & Development Wordpress

    WordPress 3.0 and above introduced the menu editor, which gave users a means to customize the automatically generated menu. Whilst this kind of functionality brings

  • Google Ecommerce Tracking in Opencart

    Website Design & Development

    This will be a quick tutorial on adding Google Analytics Ecommerce tracking to opencart shops 1. Add the following to a new template file in

  • WordPress posts on non-wordpress pages

    Website Design & Development Wordpress

    This is a brief how-to on getting posts from WordPress, specifically the last x amount of posts into a site that is either static or