Lauri
Kainulainen
M.Sc, MA

design,
code,
experience,
art,
electronics,
interaction

KISSpics - a new addition to the libraries!

kisslibs
KISSpics is a very, very simple class that provides a webgallery of pictures and their descriptions. From a users point of view it works like this:
  • create a directory (defaults to 'pics/')
  • place pictures into the folder
  • optionally create a text file (name does not matter, but it must end with the suffix .txt). Inside the text file you can add descriptions using the notation "picture_filename: description" one per line. Example: "foo.png: a simple picture of a foo".
  • inside your code create a KISSpics object ($kp = new KISSpics();), optionally specifying the target directory in the constructor.
  • use a foreach to go through the $kp->pictures array. Inside the array there are objects with properties url (the url to the picture) and description. First description would thus be $kp->pictures[0]->description. Use your own HTML to format the gallery the way you see fit.

For an example see here