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; }