function _ed_classified_get_duration in Classified Ads 7.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()
- 6.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(). TODO - this is hardcoded to the Classified Ads vid - needs to be able to handle any taxonomy assigned
- _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 520 
- Simple text-based classified ads module. Michael Curry, Exodus Development, Inc. exodusdev@gmail.com for more information, please visit http://exodusdev.com/drupal/modules/classified.module Copyright (c) 2006, 2007 Exodus Development, Inc. All Rights…
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;
}