FOR ARCHIVAL PURPOSES ONLY

The information in this wiki hasn't been maintained for a good while. Some of the projects described have since been deprecated.

In particular, the "Ushahidi Platform v3.x" section contains information that is often misleading. Many details about this version of Platform have changed since.

This website is an extraction of the original Ushahidi wiki into a static form. Because of that, functions like logging in, commenting or searching will not work.

For more documentation, please refer to https://docs.ushahidi.com

Skip to end of metadata
Go to start of metadata

(Ed: I'm not an expert - I'm creating these "under the hood" pages in the hope that a) better coders than me will stop by and correct them, and b) other coders like me have a better place to start on some commonly-done coding tasks)

You can store and link to images in Ushahidi 2.X.  For instance, creating a report gives you the option of storing images associated with it.  But how does this work "under the hood", and what's a good way to replicate this, say as part of a custom install.

  • The Ushahidi2.X code that saves a file (or group of files in the _FILES[$file] object attached to a GET/POST response) lives in application/helpers/upload.php, function save().
  • Other commonly-used pieces of image-handling code include resizing, e.g. this code (from application/helpers/reports.php function save_media()) that resizes a saved image with name $filename and saves it as a new image with name $newfilename, in directory upload.directory:
Image::factory($filename)
->resize(89,59,Image::HEIGHT)
->save(Kohana::config('upload.directory', TRUE).$newfilename);