Archive for February, 2009

tagcloud for CONTENTdm collections

After helping to upload two image collections into Flickr and exploring some of the browsing features, I was re-motivated to experiment with a tagcloud feature for CONTENTdm collections.  After exporting and parsing an XML file including the subject field, I had to write a PHP script to generate the tagcloud.  For the presentation, I checked the tagcrowd site -very helpful!

For something like this, the use and manipulation of “arrays” was the key.  Some of the array functions I used are: count(), arsort(), array_slice(), ksort(), max(), min().  Of course, my favorite one is array_slice (not because of the pizza slice), it’s a handy way of limiting the number or top results to display.  A regular tagcloud shows 10-25-50-100 elements, but maybe no more than that.  Well, for this experiment, my array had more than 1,000 elements, …but with the array_slice function, now I can easily limit the top results to any number and even set the starting point (e.g. array_slice($array1, 10, 50) means get 50 elements of the array1 starting at the 10th element).

All right, here is the link to the current test file, …that’s it for now!

No Comments »