function _textimage_preset_load in Textimage 5.2
Same name and namespace in other branches
- 5 textimage.module \_textimage_preset_load()
- 6.2 textimage.module \_textimage_preset_load()
- 7.2 textimage.module \_textimage_preset_load()
load a preset by id or name.
Parameters
preset: preset id or name.
8 calls to _textimage_preset_load()
- textimage_build_image in ./
textimage.module - textimage_image_from_preset in ./
textimage.module - Loads the Textimage preset and generates the GD image resource.
- textimage_js_background in ./
textimage.module - textimage_preset_delete_confirm in ./
textimage_admin.inc - textimage_preset_edit in ./
textimage_admin.inc
File
- ./
textimage.module, line 829
Code
function _textimage_preset_load($preset) {
// Load preset by id
if (is_numeric($preset)) {
$preset = db_fetch_array(db_query('SELECT * FROM {textimage_preset} WHERE pid = %d', $preset));
}
else {
$preset = db_fetch_array(db_query("SELECT * FROM {textimage_preset} WHERE name = '%s'", $preset));
}
if (empty($preset)) {
return FALSE;
}
else {
$preset['settings'] = unserialize($preset['settings']);
return $preset;
}
}