Most Popular Pictures
This entry was posted on 3/23/2007 1:48 PM and is filed under website.
There is now a "Most popular" link on the home page in the Pictures section. As expected, it sends the user to a page showing the 10 most popular pictures that users have viewed.
When I first got the page working, I noticed that most of the pictures were used in one of my tours, namely the Shreveport Union Station tour. I didn't want this "Most Popular" page to show just pictures from that tour, or any of the other tours for that matter, since those really aren't standalone "pictures", per se. So I had to filter out any picture that was part of a tour. The results are not surprising, with the old abandoned switcher in Galveston taking top honors.
This new feature takes into account the Page Views function, released just yesterday. How did I get the counts for each of the pictures if I wasn't keeping track of them until yesterday? My web hosting provider maintains traffic statistics for my website (which has been mentioned on this blog before), and one page of interest shows which pages have been visited and how many times. I looked for all the "picture.asp" references and gathered them along with their respective page counts and access timestamps. I then imported them into a text file, and created a little C# script that read each line, broke it down into its elements (such as query string, page count, etc), then created SQL queries based on that data which would update the ViewCount field in the Pictures table for each picture viewed. Just about an hour's worth of work went into it, and now I have accurate, up-to-date page views for every picture on the site.