function _ed_classified_get_duration in Classified Ads 6.2
Same name and namespace in other branches
- 5.2 ed_classified_utils.inc \_ed_classified_get_duration()
- 5 ed_classified_utils.inc \_ed_classified_get_duration()
- 7.2 ed_classified_utils.inc \_ed_classified_get_duration()
Get duration in days for taxonomy term (array of tids, indexed by vid); Expecting array of size 1, so any more is ignored if nothing set, use the default value TODO - if a single value, not an array, then assume the vid to be the Classified Ads vid
2 calls to _ed_classified_get_duration()
- ed_classified_admin_settings in ./
ed_classified_settings.inc - Implementation of hook_settings().
- _ed_classified_get_longest_duration in ./
ed_classified_utils.inc - Find the longest duration, in days, for a given set of terms
File
- ./
ed_classified_utils.inc, line 533 - Simple text-based classified ads module.
Code
function _ed_classified_get_duration($term) {
$duration = 0;
reset($term);
list($vid, $tid) = each($term);
$def = _ed_classified_variable_get('default_ad_duration', EDI_CLASSIFIED_VAR_DEF_EXPIRATION_DAYS);
$name = 'vid_' . $vid . '_tid_' . $tid . '_duration';
$duration = _ed_classified_variable_get($name, $def);
return $duration;
}