function _simpleads_campains_date_diff in SimpleAds 7
Helper function. Timestamp to days.
Parameters
int $ustart_time:
- Start timestamp
int $uend_time:
- End timestamp
2 calls to _simpleads_campains_date_diff()
- _simpleads_campaigns_complete in modules/
simpleads_campaigns/ campaigns.helper.inc - Helper function. Deactivate ad if the ad riches campaings limits.
- _simpleads_campaign_details in modules/
simpleads_campaigns/ campaigns.admin.inc - Menu callback. Campaign details.
File
- modules/
simpleads_campaigns/ campaigns.helper.inc, line 18 - SimpleAds helper functions.
Code
function _simpleads_campains_date_diff($ustart_time, $uend_time) {
$now = time();
if ($ustart_time == '' && $uend_time != '') {
return floor(($uend_time - $now) / 86400);
}
elseif ($ustart_time != '' && $uend_time != '') {
return floor(($uend_time - $ustart_time) / 86400);
}
elseif ($ustart_time == '' && $uend_time == '') {
return FALSE;
}
else {
return 0;
}
}