/** * this function loads the thumbnail image for the challenge identity */ public function actionIcon() { $challenge = get_entity($this->url_vars[1]); $size = $this->url_vars[2]; $image_name = 'contest/' . $challenge->guid . '/icon' . ($size ? $size : 'small') . '.jpg'; $content = IzapBase::getFile(array('source' => $image_name, 'owner_guid' => $challenge->owner_guid)); if (empty($content)) { $content = file_get_contents(elgg_get_plugins_path() . GLOBAL_IZAP_ELGG_BRIDGE . '/_graphics/no-image-' . $size . '.jpg'); } $header_array = array(); $header_array['content_type'] = 'image/jpeg'; $header_array['file_name'] = elgg_get_friendly_title($challenge->title); IzapBase::cacheHeaders($header_array); echo $content; }