php

Jan
08

PHP and Detecting Colors

Tags: drupal, php

For the the past year and a half, I've been working to build up a couple of sites, including BagIdiot.com and ShoeIdiot.com.  These sites are both twists on product comparison engines, one focused on bag (handbags, luggage etc) and the other on...  yeah, shoes.

I've written before about the pieces and parts I used to put them together, including drupal running under apache.  Recently I've added a new feature that shows the color(s) of the products and includes those colors in the search index.  This feature was put together by modifying some handy code I was able to find on the web, including:

Extracting the most common colors was easy enough and the php package above meant that I didn't have to code it.  All you do is open the image and look at it pixel by pixel to figure out the color.  The code I implemented from phpclasses.org made this trivial but then I ended up with a list of hex color code and how many times that color was used in the image.  Now I needed to turn those hex codes into English that is meaningful to users and that is where the code from github came in.  That code is a phpized version of a nice javascript that you can see here only it wasn't quite done.  I made a few changes to stick the hex color codes and associated names into a DB table. Continue Reading »

Add a comment Read More including 0 comments

Feb
08

Scaling Drupal (on the cheap)

Tags: drupal, apache, solr, mysql, php

Our young company uses drupal to support our most important web sites including this one.  Our biggest site is Shoe Idiot which has about 800,000 unique URLs because its database includes over 650,000 different shoes.  That is the biggest site but all of our sites are product focused and therefore have big fat databases.

Each of our drupal sites has its own database but shares a common code base.  Some of the sites use some unique modules so they have their own modules directory located in their site specific directory structure, but most of the code is shared across all of the sites which includes: Continue Reading »

Add a comment Read More including 1 comments

Powered by Drupal, an open source content management system