You are here

public function sweaver_plugin_images::sweaver_get_image in Sweaver 6

Same name and namespace in other branches
  1. 7 plugins/sweaver_plugin_images/sweaver_plugin_images.inc \sweaver_plugin_images::sweaver_get_image()

Helper function to get image.

Parameters

$fid: The file id.

Return value

False or image object.

2 calls to sweaver_plugin_images::sweaver_get_image()
sweaver_plugin_images::sweaver_images_backend_form in plugins/sweaver_plugin_images/sweaver_plugin_images.inc
Images form.
sweaver_plugin_images::sweaver_images_confirm_form_delete in plugins/sweaver_plugin_images/sweaver_plugin_images.inc
Image delete form.

File

plugins/sweaver_plugin_images/sweaver_plugin_images.inc, line 356
Images plugin.

Class

sweaver_plugin_images
@file Images plugin.

Code

public function sweaver_get_image($fid) {
  if (!empty($fid)) {
    $query = 'SELECT ti.fid, ti.description, f.filepath FROM {sweaver_image} ti
                INNER JOIN {files} f on f.fid = ti.fid WHERE f.fid = %d';
    $image = db_fetch_object(db_query($query, $fid));
    if ($image->fid) {
      return $image;
    }
  }
  return FALSE;
}