Posts Tagged ‘PHP’

MAMP

Yes, MAMP is my most recent installation on the Mac OS

As many would probably agree, from time to time, it’s useful to try or run a script without logging into a “formal” server.  Being able to write a PHP script which interacts with a MySQL database is also handy.  Anyway, the real reason to install MAMP is because I’ll need to run a couple of applications that require an Apache server.  It was also happy to see a quick tutorial about a local (test) installation of Drupal using MAMP.  In fact, in the long term we’re planning to use Drupal to provide a robust front-end interface to digital collections physically stored in DSpace.   Who knows, this may be just the starting point!

After all, the University Libraries is already using Drupal for its website!

BTW: here is the direct link to download MAMP

No Comments »

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 »