本文整理匯總了PHP中GDSRHelper::remaining_time_total方法的典型用法代碼示例。如果您正苦於以下問題:PHP GDSRHelper::remaining_time_total方法的具體用法?PHP GDSRHelper::remaining_time_total怎麽用?PHP GDSRHelper::remaining_time_total使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GDSRHelper
的用法示例。
在下文中一共展示了GDSRHelper::remaining_time_total方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render_srt
function render_srt($template, $rating, $unit_count, $votes, $id, $time_restirctions = "N", $time_remaining = 0, $time_date = '')
{
if (($time_restirctions == 'D' || $time_restirctions == 'T') && $time_remaining > 0) {
$time_parts = GDSRHelper::remaining_time_parts($time_remaining);
$time_total = GDSRHelper::remaining_time_total($time_remaining);
$tpl = $template->elm["time_active"];
$rt = html_entity_decode($tpl);
$rt = str_replace('%TR_DATE%', $time_date, $rt);
$rt = str_replace('%TR_YEARS%', $time_parts["year"], $rt);
$rt = str_replace('%TR_MONTHS%', $time_parts["month"], $rt);
$rt = str_replace('%TR_DAYS%', $time_parts["day"], $rt);
$rt = str_replace('%TR_HOURS%', $time_parts["hour"], $rt);
$rt = str_replace('%TR_MINUTES%', $time_parts["minute"], $rt);
$rt = str_replace('%TR_SECONDS%', $time_parts["second"], $rt);
$rt = str_replace('%TOT_DAYS%', $time_total["day"], $rt);
$rt = str_replace('%TOT_HOURS%', $time_total["hour"], $rt);
$rt = str_replace('%TOT_MINUTES%', $time_total["minute"], $rt);
} else {
if ($time_restirctions == 'D' || $time_restirctions == 'T') {
$tpl = $template->elm["time_closed"];
} else {
$tpl = $template->elm["normal"];
}
$rt = html_entity_decode($tpl);
}
$rt = str_replace('%RATING%', $rating, $rt);
$rt = str_replace('%MAX_RATING%', $unit_count, $rt);
$rt = str_replace('%VOTES%', $votes, $rt);
$rt = str_replace('%ID%', $id, $rt);
$word_votes = $template->dep["EWV"];
$tense = $votes == 1 ? $word_votes->elm["singular"] : $word_votes->elm["plural"];
$rt = str_replace('%WORD_VOTES%', __($tense), $rt);
return $rt;
}