function dynamic_banner_find_load_default in Dynamic Banner 7.2
Same name and namespace in other branches
- 7 includes/callbacks.inc \dynamic_banner_find_load_default()
- 8.x dynamic_banner.module \dynamic_banner_find_load_default()
Find the default banner and return all of it's attributes
1 call to dynamic_banner_find_load_default()
- dynamic_banner_admin_form in ./
dynamic_banner.module - The main form dealing with dynamic banner There is now only one form for dynamic banner to deal with unlink in the d6 version
File
- ./
dynamic_banner.module, line 914 - Distributed under GNU GPL version 3
Code
function dynamic_banner_find_load_default() {
$query = db_select('dynamic_banner', 'd');
$query
->condition('d.path', 'DEFAULT', '=')
->fields('d');
$result = $query
->execute();
if ($result
->rowCount() > 0) {
return $result
->fetchObject();
}
// Do not return null for this
$blank_banner = new stdClass();
$blank_banner->dbid = 0;
$blank_banner->path = 'DEFAULT';
$blank_banner->imgurl = '';
$blank_banner->mode = 'normal';
$blank_banner->text = '';
$blank_banner->link = '';
$blank_banner->imgfid = '';
return $blank_banner;
}